mo1154 Posted February 17, 2015 Share Posted February 17, 2015 So i stopped scripting for a while and my old scripts ran off version 1.7 of osbot and now 2 is out and everything is wacked. I've gotten majority of it fixed, but it still needs work! if anyone wants to help me fix this that would be great. its a fishingGuildAIO so if it gets back up and running by all means use it haha. package fishingGuildBot; import java.awt.Color; import java.awt.Font; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Image; import java.net.URL; import java.io.IOException; import javax.imageio.ImageIO; import org.osbot.rs07.api.ui.Skill; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import org.osbot.rs07.utility.*; import org.osbot.rs07.api.model.*; import org.osbot.rs07.api.model.Entity; import org.osbot.rs07.api.Bank; import org.osbot.rs07.api.Inventory; import org.osbot.rs07.api.Client; import org.osbot.rs07.api.NPCS; import org.osbot.rs07.api.util.Utilities; import org.osbot.rs07.api.map.*; import org.osbot.rs07.input.mouse.*; @ScriptManifest(name = "Fishing", author = "Mo Fucking Peyman", version = 1.0, info = "", logo = "") public class FishingGuildAIO extends Script { Timer timer = new Timer(); Image image; int fishCaught = 0; int startExp; int startLvl; int sharksfished = 0; int fishingSpotID = 0; int fishingWith = 0; String howToFish = ""; public static final int LOBSTERSPOT = 2782; public static final int SWORDFISHSPOT = 2782; public static final int SHARKSPOT = 2783; public static final int HARPOONID = 311; public static final int LOBSTERPOTID = 301; public static final String HARPOON = "Harpoon"; public static final String CAGE = "Cage"; private final Color color1 = new Color(0, 0, 0, 101); private final Color color2 = new Color(0, 0, 0); private final Color color3 = new Color(0, 0, 0); private final Font font1 = new Font("Arial", 0, 25); private final Font font2 = new Font("Arial", 0, 12); boolean didIfail = false; public void onStart() { log("Hello, sit back we're fishing"); startLvl = skills.getExperience(Skill.FISHING); experienceTracker.start(Skill.FISHING); tracker.resetSkills(); fishingGuildGui myGui = new fishingGuildGui(); while(myGui.submit) { if(myGui.isVisible() == false) { myGui.submit = false; } } myGui.setVisible(false); if(myGui.lobsterButton.isSelected()) { fishingSpotID = LOBSTERSPOT; fishingWith = LOBSTERPOTID; howToFish = CAGE; try { image = ImageIO.read(new URL("http://imageshack.com/a/img39/5752/gr2g.png")); } catch (IOException e) { log("Error retrieving paint"); } timer.start(); } else if(myGui.sharkButton.isSelected()) { fishingSpotID = SHARKSPOT; fishingWith = HARPOONID; howToFish = HARPOON; try { image = ImageIO.read(new URL("http://img28.imageshack.us/img28/5810/6aa1.png")); } catch (IOException e) { log("Error retrieving paint"); } timer.start(); } else if(myGui.swordfishButton.isSelected()) { fishingSpotID = SWORDFISHSPOT; fishingWith = HARPOONID; howToFish = HARPOON; try { image = ImageIO.read(new URL("http://imageshack.com/a/img69/594/fzsw.png")); } catch (IOException e) { log("Error retrieving paint"); } timer.start(); } myGui.dispose(); } public void onPaint(Graphics g) { g.drawImage(image, 4, 245, null); Graphics2D gr = (Graphics2D) g; gr.setColor(color1); gr.setFont(font1); gr.setColor(color2); gr.drawString("FishingGuildAIO", 210, 336); gr.setFont(font2); gr.setColor(color3); g.drawString(timer.getFormattedString(), 226, 280); g.drawString("Fishing Guild:", 5, 266); g.drawString("Fish Caught: " + fishCaught, 5, 279); String fishingGained = "XP P/H: " + String.valueOf(experienceTracker.getGainedXPPerHour(Skill.FISHING)); g.drawString(fishingGained, 5, 331); } public int onLoop() throws InterruptedException { bankFish(); Fish(); //AntiBan(); return 50; } public void bankFish() throws InterruptedException { Area walktobank = new Area(2599, 3408, 2594, 3419); Area bankArea = new Area(2586, 3418, 2588, 3421); Area fishingArea = new Area(2611, 3425, 2595, 3410); Inventory inv = client. Entity banktime; if(inv.isFull()) { if(me.isInArea(fishingArea)) { walktobank.getRandomPosition(0).walkMinimap(bot); } if(me.isInArea(walktobank)) { bankArea.getRandomPosition(0).walkMinimap(bot); sleep(2000); } banktime = closestObject(2196); if(me.isInArea(bankArea)) { if(banktime != null) { banktime.interact("Bank"); sleep(1500); Bank myBank = client.getBank(); myBank.depositAllExcept(fishingWith); } } } } public void Fish() throws InterruptedException { Entity fishingtool = closestGroundItem(fishingWith); Inventory inv = client.getInventory(); NPC fishingspot = closestNPC(fishingSpotID); Area fishingArea = new Area(2611, 3425, 2595, 3410); Player me = client.getMyPlayer(); if(!inv.isFull()) { if(!me.isInArea(fishingArea)) { fishingArea.getRandomPosition(0).walkMinimap(bot); } } if(client.getInventory().contains(fishingWith)) { if(!inv.isFull()) { if(fishingspot != null) { if(!me.isAnimating()) { fishingspot.interact(howToFish); sleep(4000); } } } } if(!client.getInventory().contains(fishingWith)) { if(fishingtool.isInArea(fishingArea)) { if(fishingtool != null) { fishingtool.interact("Take"); sleep(2500 + random(500)); } } } } public void onMessage(String m) { if (m.toLowerCase().contains("you catch")) { fishCaught++; } } public void onExit() { log("Cya bro"); } } Link to comment Share on other sites More sharing options...
Alek Posted February 17, 2015 Share Posted February 17, 2015 We have a new API. You're better off re-writing your fisher. Also, you might need to work on your OOP: Inventory inv = client.getInventory(); Inventory inv = client. Entity banktime; Link to comment Share on other sites More sharing options...