TheManWhoBots Posted July 16, 2018 Share Posted July 16, 2018 (edited) DISCLAIMER: USE AT YOUR OUR OWN RISK!! THIS SCRIPT WORKS BUT WILL GET YOU BANNED!! Link: http://www.mediafire.com/file/u7uddd9ifyg0f1t/ChinHunter.jar/file Hello, guys. About 2 months ago I started working on my first ever bot script. I had no clue what the OsBot API was like, but I went in and tried it anyways. This script in particular does a rather good job of hunting chins. You can expect anywhere from 150-300 chins per hour with this script. The script is very bulky, with lots of "Human-like Anti-Ban" measures to prevent ban. However most of the anti-ban measures are unfinished and still look incredibly bot-like (particularly the acceleration and timing intervals of the mouse movements). The script got me a 1-day ban, but it lasted for about 2 weeks with no ban. FEATURES: -picking up all fallen traps on ground, whether it is yours or another player's -never lays a trap in a position where another player's trap exists -placing traps in new/ random positions (about 5% or so chance per trap collected) -only placing traps in the "HuntArea", which is a 25-tile zone in the popular red chin spawn area in Feldip Hills -random mouse movements such as: random idle movement, afk off screen movement, random box trap hovering, random player position hovering, random inventory trap placement -traps can also be placed for Grey chins as well, but to do this the code of the script itself must be edited to initialize different trap positions upon initialization of the script. This is very easy and works flexibly within the program. Any user could easily edit the source to make a GUI to select which HuntArea gets defined to support chin hunting for Red and Grey chins. The positions for the Grey Chin Hunt area are already programmed within the script, but there is no way of choosing which area. ERRORS: -randomly runs south and attempts to pick up a random box trap set by another player (Even though I put in precautionary code that never walked the player to the next trap position if it wasn't in the pre-defined 'hunt area' Position. Must be a bug with the API or Jagex has ID swapping code, not sure). -not picking up a failed trap before placing another trap, or getting stuck between the priority of picking up a trap and laying/collecting a trap. -will not know if another player laid the trap down before you successfuly laid your trap at the same time, otherwise never lays a trap in a position with a trap already placed by another player. -sometimes attempts to collect 2 traps at the same time. -CPU intensive, about 10-25% for 1 instance of the script running on 3.1 GHz quad core HERE IS THE SOURCE CODE: package scripts.ChinHunter; import java.awt.Font; import java.awt.Graphics2D; import java.awt.Rectangle; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import java.text.NumberFormat; import java.util.Arrays; import java.util.Collections; import java.util.Locale; import java.util.Random; import javax.imageio.ImageIO; import org.osbot.rs07.api.map.Area; import org.osbot.rs07.api.map.Position; import org.osbot.rs07.api.model.GroundItem; import org.osbot.rs07.api.model.Player; import org.osbot.rs07.api.model.RS2Object; import org.osbot.rs07.api.ui.Skill; import org.osbot.rs07.event.WalkingEvent; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; @ScriptManifest(author = "TheManWhoBots", info = "Hunts Chins", name ="Fedora Chinner", version = 1.0, logo = "https://i.imgur.com/B9VsT1v.png") public class ChinHunter extends Script { String state; public Rectangle playerHoverZone; long actionTimer; boolean[] collectATrap; boolean[] layATrap; boolean allTrapsLaid = false; int hunterXP, hxph; int hunterLevel; boolean maxTrapsLaid; int maxTraps = 1; int trapsLaid = 0; Area huntArea; Position[] positions; Position[] trapPositions; double chinsPerHour; boolean[] trapIsLaid; boolean changeTrapLayout = true; boolean greyChins = false, redChins = true, blackChins = false; int chinPrice = 1650, chinXp = 265; boolean[] doesInventorySlotHaveBoxTrap; boolean hoveringOverBox = false; int maxTrapPositionLength = 0; boolean reset = false; long resetTimer; BufferedImage img; public static long resetTimeThreshold; int randomPositioningOffset1 = 0, randomPositioningOffset2 = 0, randomPositioningOffset3 = 0, randomPositioningOffset4 = 0, randomPositioningOffset5 = 0; public void onStart() { resetTimeThreshold = 40000; // time in ms it takes to reset program if stuck in method (40 seconds, by defaul) doesInventorySlotHaveBoxTrap = new boolean[28]; hunterLevel = skills.getDynamic(Skill.HUNTER); maxTrapsLaid = false; trapsLaid = 0; calculateMaxTraps(); collectATrap = new boolean[maxTraps]; layATrap = new boolean[maxTraps]; trapPositions = new Position[maxTraps]; trapIsLaid = new boolean[maxTraps]; initializePositions(); initializeTrapPositions(); Random r = new Random(); int ra = r.nextInt(maxTraps); randomizeTrapPositionsWithinRange(ra, 1, 2); resetTimer = System.currentTimeMillis(); String directory = getDirectoryData(); log(directory); try{ img = ImageIO.read((new File("C:\\Users\\Ryan\\OSBot\\Data\\scriptOverlays\\ScriptOverlay1.png"))); } catch(IOException e){ log(e); } experienceTracker.start(Skill.HUNTER); } public void checkResetTimer(long x) { Random r = new Random(); int ra = r.nextInt(5000+1); if ((System.currentTimeMillis() - resetTimer) > x + ra) { reset(); } } public void reset() { for (int i =0; i < maxTraps; i++) { // reset variables to exit while loops if program is stuck allTrapsLaid = true; trapIsLaid[i] = false; layATrap[i] = true; collectATrap[i] = false; } pickUpAllFallenTraps(); // pick up fallen traps try { resetAllTraps(); // dismantle all traps in trap positions allTrapsLaid = false; } catch (InterruptedException e) { e.printStackTrace(); } initializeTrapPositions(); // re-initialize trap positions for (int i =0; i < maxTraps; i++) { randomizeTrapPosition(i); // randomize trap positions to any position in HuntArea } try { sleep(random(123,321)); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } walk(new Position(huntArea.getRandomPosition())); // walk to new random spot resetTime(); // reset timer } public void resetTime() { resetTimer = System.currentTimeMillis(); } public void checkIfTrapPositionHasAPlayer(int positionIndex) { if (positionHasPlayer(trapPositions[positionIndex])) { randomizeTrapPositionsWithinRange(positionIndex, 1, 3); } } public void checkIfTrapPositionsHavePlayers() { for (int i= 0; i < maxTraps; i++) { if (positionHasPlayer(trapPositions[i])) { randomizeTrapPositionsWithinRange(i, 1, 3); } } } public boolean positionHasPlayer(Position p) { java.util.List<Player> players = getPlayers().getAll(); for (int i=0; i < players.size(); i++) { if (players.get(i).getPosition().equals(p) && !players.get(i).equals(myPlayer())) { return true; } } return false; } public void scanAreaToCollectTraps() throws InterruptedException { java.util.List<RS2Object> objects = getObjects().getAll(); for (int i = 0; i < objects.size(); i++) { if ((objects.get(i).getId() == 9385 || objects.get(i).getName().contains("Shaking box"))) { for (int x = 0; x < trapPositions.length; x++) { if (objects.get(i).getPosition().equals(trapPositions[x]) && trapIsLaid[x] && objects.get(i).getName().contains("Shaking box")) { // scans to see if positon has YOUR trap collectATrap[x] = true; collectTrap(x, true); } if (objects.get(i).getPosition().equals(trapPositions[x]) && trapIsLaid[x] && objects.get(i).getId() == 9385) { // scans to see if positon has YOUR trap collectATrap[x] = true; collectTrap(x, false); } else if ((objects.get(i).getId() == 9385 || objects.get(i).getName().contains("Shaking box")) // randomizes position if your position has OTHER PLAYER'S trap && objects.get(i).getPosition().equals(trapPositions[x]) && !trapIsLaid[x]) { randomizeTrapPositionsWithinRange(x, 1, 3); layTrap(x); } } } } } public void scanAreaToLayTraps() { while (!allTrapsLaid) { for (int y=0; y < trapPositions.length; y++) { // checks if each trap position has a trap checkResetTimer(resetTimeThreshold); if (!positionHasTrap(trapPositions[y]) && !trapIsLaid[y]) { checkResetTimer(resetTimeThreshold); log("Laying trap at position [" + y + "]"); layATrap[y] = true; // adds this position to the trap lay Queue collectATrap[y] = false; layTrap(y); trapIsLaid[y] = true; } else if (positionHasTrap(trapPositions[y]) && !trapIsLaid[y]) { log("Position has a trap from another player, randomizing position ["+y+"]"); checkResetTimer(resetTimeThreshold); randomizeTrapPositionsWithinRange(y, 1, 3); //pickUpFallenTraps(); layATrap[y] = true; collectATrap[y] = false; layTrap(y); trapIsLaid[y] = true; } } int o = 0; for (int j = 0; j < trapIsLaid.length; j++) { checkResetTimer(resetTimeThreshold); if (trapIsLaid[j]) { o++; if (o == trapIsLaid.length ) { allTrapsLaid = true; } } } } } public void doubleCheckIfTrapIsLaid() { for (int y=0; y < trapPositions.length; y++) { checkResetTimer(resetTimeThreshold); if (!positionHasTrap(trapPositions[y])) { trapIsLaid[y] = false; layATrap[y] = true; collectATrap[y] = false; } } } public void collectTrap(int i, boolean f) throws InterruptedException { long firstTime = System.currentTimeMillis(); int increment = 0; long loopTime = System.currentTimeMillis(); boolean loop = false; Random r = new Random(); int randomElement = r.nextInt(4920+572); Random ra = new Random(); int randomMaxLoop = ra.nextInt(3+1); Random rara = new Random(); int randomTime = rara.nextInt(12); boolean fbc = false, sbc = false; while (collectATrap[i]) { checkResetTimer(resetTimeThreshold); if (!myPlayer().getPosition().equals(trapPositions[i])) { //log("Walking to position [" +i+"] to collect trap"); checkResetTimer(resetTimeThreshold); walk(trapPositions[i]); sleep(random(37,85)); } else { if(f) { checkResetTimer(resetTimeThreshold); if ((System.currentTimeMillis() - loopTime) > (67 + randomTime) && increment <= randomMaxLoop) { loop = true; } //log("Entering loop for collecting chin.."); RS2Object chinCaught = getObjects().closest("Shaking box"); if (collectATrap[i] && f && loop) { checkResetTimer(resetTimeThreshold); log("Collecting shaking box at position [" + i + "]"); chinCaught.getPosition().hover(this.bot); sleep(random(0,12)); chinCaught.interact("Check"); sleep(random(20,30)); // executeChanceToRandomlyHoverOverBoxTrapInInventory(9, 28); sleep(random(27,92)); allTrapsLaid = false; trapIsLaid[i] = false; layATrap[i] = true; increment++; loopTime = System.currentTimeMillis(); checkIfTrapPositionHasAPlayer(i); loop = false; } else if (!positionHasTrap(trapPositions[i]) && !sbc) { checkResetTimer(resetTimeThreshold); executeChanceToRandomizeTrapPositionWithinRange(3, i, 1, 3); log("Laying trap at position[" + i +"] after collecting Shaking box"); layTrap(i); sbc = true; executeChanceToHoverOverRandomTrapPosition(42); int b = r.nextInt(2+1); if (b==1) { executeChanceToHoverOverClosestShakingBox(823); } else { executeChanceToHoverOverClosestFailedTrap(485); } resetTime(); } if (positionHasTrap(trapPositions[i]) && sbc) { collectATrap[i] = false; } } else if (!f) { checkResetTimer(resetTimeThreshold); if ((System.currentTimeMillis() - loopTime) > (67 + randomTime) && increment <= randomMaxLoop) { loop = true; } //log("entering loop for collecting a trap.."); RS2Object failedTrap = getObjects().closest(9385); if (collectATrap[i] && !f && loop) { checkResetTimer(resetTimeThreshold); log("Collecting failed Box trap at position [" + i + "]"); failedTrap.interact("Dismantle"); sleep(random(19,34)); hoverOverPlayerPosition(); // executeChanceToRandomlyHoverOverBoxTrapInInventory(12, 12); sleep(random(34,82)); allTrapsLaid = false; trapIsLaid[i] = false; layATrap[i] = true; increment++; loopTime = System.currentTimeMillis(); loop = false; } else if (!positionHasTrap(trapPositions[i]) && !fbc) { checkResetTimer(resetTimeThreshold); executeChanceToRandomlyPickRandomTrapPositionWithOrWithoutRangeRestriction(i, 4, 4, 3, 8); log("Laying trap at position[" + i +"] after collecting failed Box trap"); layTrap(i); fbc = false; executeChanceToHoverOverRandomTrapPosition(29); executeChanceToHoverOverRandomPosition(42); resetTime(); collectATrap[i] = false; } } if ((System.currentTimeMillis() - firstTime) >= 5723 + randomElement) { resetTime(); log("Idled too long during collect trap phase, stage has reset"); increment = 0; loopTime = System.currentTimeMillis(); loop = true; sbc = false; fbc = false; pickUpFallenTraps(); doubleCheckIfTrapIsLaid(); collectATrap[i] = false; } } } } public void layTrap(int i) { long firstTime = System.currentTimeMillis(); Random r = new Random(); int randomElement = r.nextInt(6620+372); while (layATrap[i]) { checkResetTimer(resetTimeThreshold); if (positionHasPlayer(trapPositions[i])) { randomizeTrapPositionsWithinRange(i, 2, 7); } if (!myPlayer().getPosition().equals(trapPositions[i])) { checkResetTimer(resetTimeThreshold); walk(trapPositions[i]); } else if (myPlayer().getPosition().equals(trapPositions[i]) && !trapIsLaid[i]){ checkResetTimer(resetTimeThreshold); log("Player is laying a trap at position [" + i + "]"); clickRandomBoxTrapInInventory(); try { sleep(random(124,235)); } catch (InterruptedException e) { e.printStackTrace(); } executeChanceToHoverOverRandomTrapPosition(142); trapIsLaid[i] = true; } else if (positionHasTrap(trapPositions[i]) && trapIsLaid[i]) { checkResetTimer(resetTimeThreshold); try { sleep(random(72,161)); } catch (InterruptedException e) { e.printStackTrace(); } hoverOverPlayerPosition(); resetTime(); layATrap[i] = false; } else if ((System.currentTimeMillis() - firstTime) > 6821 + randomElement) { log("Idled too long during lay trap phase, stage has reset"); trapIsLaid[i] = false; allTrapsLaid = false; hoveringOverBox = false; collectATrap[i] = false; pickUpFallenTraps(); doubleCheckIfTrapIsLaid(); firstTime = System.currentTimeMillis(); r = new Random(); randomElement = r.nextInt(4620+372); resetTime(); layATrap[i] = false; } } } public boolean positionHasFallenTrap(Position position) { GroundItem fallenTrap = getGroundItems().closest("Box trap"); if (fallenTrap.getPosition().equals(position)) { return true; } return false; } public void executeChanceToHoverOverRandomTrapPosition(int target) { Random ra = new Random(); int rara = ra.nextInt(1000 +1); if (rara <= target) { log("Executing random chance to hover over a random TRAP position"); hoverOverRandomTrapPosition(); } } public void executeChanceToHoverOverRandomPosition(int target) { Random ra = new Random(); int rara = ra.nextInt(100 +1); if (rara <= target) { log("Executing random chance to hover over a random POSITION"); hoverOverRandomPosition(); } } public void hoverOverRandomTrapPosition() { Random ra = new Random(); int r = ra.nextInt(maxTraps); Position p = new Position(trapPositions[r]); p.hover(this.bot); } public void hoverOverRandomPosition() { Position p = new Position(huntArea.getRandomPosition()); p.hover(this.bot); } public void hoverOverPlayerPosition() { log("Moving mouse to player position"); Random r = new Random(); int randomOffsetX = r.nextInt(30+1); int randomOffsetY = r.nextInt(62+1); getMouse().move((int)playerHoverZone.getX() + randomOffsetX, (int)playerHoverZone.getY() + randomOffsetY); try { sleep(random(randomOffsetX + 20, randomOffsetY + 75)); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } if (randomOffsetX >= 15){ randomOffsetX *= -1; } if (randomOffsetY >= 24){ randomOffsetY *= -1; } getMouse().move((int)playerHoverZone.getX() + (int)(randomOffsetX / 1.45), ((int)playerHoverZone.getY() + (int)(randomOffsetY /1.3) + (randomOffsetX))); } public void clickRandomBoxTrapInInventory() { updateBoxTrapSlotsInInventory(); boolean conditionMet = false; while (!conditionMet) { int ra = generateRandomCalculatedBoxTrapInventorySlot(); if (doesInventorySlotHaveBoxTrap[ra]) { log("Executing random chance to click random box trap in inventory"); hoverOnInventorySlot(ra); try { sleep(random(67, 121)); } catch (InterruptedException e) { e.printStackTrace(); } getMouse().click(false); try { sleep(random(67, 121)); } catch (InterruptedException e) { e.printStackTrace(); } conditionMet = true; } } } public void randomlyHoverOverBoxTrapInInventory(boolean shouldCompletelyRandomize, int min, int max) { int ra = 0; updateBoxTrapSlotsInInventory(); boolean conditionMet = false; while (!conditionMet) { if (!shouldCompletelyRandomize) { ra = generateRandomCalculatedBoxTrapInventorySlot(); } else if (shouldCompletelyRandomize) { ra = (new Random().nextInt(28+1)); } if (doesInventorySlotHaveBoxTrap[ra]) { if (getInventory().getItemInSlot(ra).nameContains("Box trap")) { log("Executing random chance to click random box trap in inventory"); hoverOnInventorySlot(ra); try { sleep(random(min, max)); } catch (InterruptedException e) { e.printStackTrace(); } conditionMet = true; } } } } public int generateRandomCalculatedBoxTrapInventorySlot() { Random r = new Random(); int ra = r.nextInt(1000+1); if (ra <= 20) { return r.nextInt(28); } else if (ra <= 35) { int randomValue = r.nextInt(3+1); if (randomValue == 0) { int rx = r.nextInt(100+1); if (rx <= 34) { return 10; } else if (rx <= 46) { return 11; } else if (rx <= 100) { return 13; } } } else if (ra <= 73) { int randomValue = r.nextInt(3+1); if (randomValue == 0) { int rx = r.nextInt(100+1); if (rx <= 15) { return 8; } else if (rx <= 27) { return 7; } else if (rx <= 100) { return 9; } } } else if (ra <= 174) { int randomValue = r.nextInt(3+1); if (randomValue == 0) { int rx = r.nextInt(100+1); if (rx <= 17) { return 6; } else if (rx <= 33) { return 5; } else if (rx <= 100) { return 4; } } } else if (ra <= 975) { int randomValue = r.nextInt(3+1); if (randomValue == 0) { int rx = r.nextInt(100+1); if (rx <= 11) { return 3; } else if (rx <= 23) { return 2; } else if (rx <= 100) { return 1; } } } else { return r.nextInt(28); } return r.nextInt(28); } public void broadcastInventorySlotsIfTrap() { for (int i =0; i < 28; i++ ) { updateBoxTrapSlotsInInventory(); log (i + " is "+ doesInventorySlotHaveBoxTrap[i]); } } public void updateBoxTrapSlotsInInventory() { for (int i=0; i < 28; i++) { if (getInventory().getItemInSlot(i) != null) { if (getInventory().getItemInSlot(i).getName().contains("Box trap")) { doesInventorySlotHaveBoxTrap[i] = true; } } else { doesInventorySlotHaveBoxTrap[i] = false; } } } public void executeChanceToRandomlyHoverOverBoxTrapInInventory(int target, int min, int max) { Random r = new Random(); int ra = r.nextInt(100+1); if(ra <= target) { log("Executing random chance to HOVER over box trap in INVENTORY"); randomlyHoverOverBoxTrapInInventory(false, min, max); hoveringOverBox = true; } } public void hoverOnInventorySlot(int i) { getInventory().hover(i); } public boolean playerIsInHuntArea() { if (huntArea.contains(myPlayer().getPosition())) { return true; } return false; } public void walk(Position position) { log("WALKING TO TARGETED POSITION"); if (!myPlayer().getPosition().equals(position)) { WalkingEvent event = new WalkingEvent(position); event.setMiniMapDistanceThreshold(10); event.setMinDistanceThreshold(0); execute(event); } } public void resetAllTraps() throws InterruptedException { java.util.List<RS2Object> objects = getObjects().getAll(); for (int x = 0; x < objects.size(); x++) { if (objects.get(x).getName().equals("Shaking Box")) { for (int i=0; i < trapPositions.length; i++) { if (objects.get(x).getPosition().equals(trapPositions[i])) { sleep(random(31,94)); objects.get(x).interact("Check"); sleep(random(321,564)); } } } else if (objects.get(x).getId() == 9385){ for (int i=0; i < trapPositions.length; i++) { if (objects.get(x).getPosition().equals(trapPositions[i])) { sleep(random(21,84)); objects.get(x).interact("Dismantle"); sleep(random(341,614)); } } } } } public void pickUpAllFallenTraps() { while (anyPositionHasFallenTrap()) { pickUpFallenTraps(); } } public boolean anyPositionHasFallenTrap() { GroundItem item = getGroundItems().closest("Box trap"); for (int x=0; x < positions.length; x++) { if (item!=null) { if (item.getPosition().equals(positions[x]) && item.getName() == "Box trap") { return true; } } } return false; } public void pickUpFallenTraps() { Random r = new Random(); int ra = r.nextInt(100+1); int rar = r.nextInt(20+1); GroundItem fallenTrap = getGroundItems().closest("Box trap"); if (fallenTrap != null) { if (huntArea.contains(fallenTrap)) { if (ra <= 72) { walk(fallenTrap.getPosition()); try { sleep(random(67,121)); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } try { sleep(random(67,121)); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } log("PICKING UP FALLEN TRAPS"); fallenTrap.interact("Box trap", "Take"); } try { sleep(random(367,612)); } catch (InterruptedException e) { e.printStackTrace(); } } } public void executeChanceToMoveMouseOffScreen(int target) { Random r = new Random(); int ra = r.nextInt(1000 + 1); int rara = r.nextInt(10000+1); if (rara <= 50) { rara = 32750; } else { rara = 27; } if (ra <= target) { getMouse().moveOutsideScreen(); try { sleep(random(2233 + ra, 7454 + ra + rara +target)); } catch (InterruptedException e) { e.printStackTrace(); } } } public void executeChanceToIdle(int target) throws InterruptedException { Random r = new Random(); int ra = r.nextInt(1000+1); if (ra <= target) { sleep(random(target + 4482, 12447)); } else { sleep(random(12,37)); } } public void executeChanceToMoveToRandomPositionWithinRange(int target) { Random r = new Random(); int ra = r.nextInt(1000); if (ra <= target) { log("IDLE: Moving to random position"); walkToRandomPositionWithinRange(getNewRandomPositionToWalkToWithinRange()); } } public void walkToRandomPositionWithinRange(Position p) { walk(p); } public Position getNewRandomPositionToWalkToWithinRange() { Random r = new Random(); int ra = r.nextInt(8); int base = r.nextInt(3); Position randomPosition = new Position(base, base, base); for (int i = 0; i < positions.length; i++) { if (myPlayer().getPosition().equals(positions[i])) { int min = i -( base + ra); if (min < 0) { min = 0; } int max = i + (base +ra); if (max > 24) { max = 24; } int rarara = r.nextInt((max - min) + (min+1)); randomPosition = new Position(positions[rarara]); // randomizes position adjacent to player from range of +/- 11 tiles } } return randomPosition; } public boolean anyTrapsPresent() { for (int i=0; i < maxTraps; i++) { if (positionHasTrap(trapPositions[i])) { return true; } } return false; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public int onLoop() throws InterruptedException { Random ra = new Random(); int rara = ra.nextInt(30+1); //randomizeTrapPositionPriority(); pickUpAllFallenTraps(); doubleCheckIfTrapIsLaid(); scanAreaToLayTraps(); scanAreaToCollectTraps(); if(!anyTrapsPresent()) executeChanceToMoveToRandomPositionWithinRange(92 + rara); if(!anyTrapsPresent()) executeChanceToHoverOverRandomPosition(12 + rara); executeChanceToMoveMouseOffScreen(87 + rara); if(!anyTrapsPresent()) executeChanceToIdle(15 + rara); return 27 + rara; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public void initializePositions() { if (greyChins) { maxTrapPositionLength = 25; chinPrice = 950; huntArea = new Area(2337,3591,2341,3587); positions = new Position[25]; positions[0] = new Position(2337,3591,0); positions[1] = new Position(2338,3591,0); positions[2] = new Position(2339,3591,0); positions[3] = new Position(2340,3591,0); positions[4] = new Position(2341,3591,0); positions[5] = new Position(2337,3590,0); positions[6] = new Position(2338,3590,0); positions[7] = new Position(2339,3590,0); positions[8] = new Position(2340,3590,0); positions[9] = new Position(2341,3590,0); positions[10] = new Position(2337,3589,0); positions[11] = new Position(2338,3589,0); positions[12] = new Position(2339,3589,0); positions[13] = new Position(2340,3589,0); positions[14] = new Position(2341,3589,0); positions[15] = new Position(2337,3588,0); positions[16] = new Position(2338,3588,0); positions[17] = new Position(2339,3588,0); positions[18] = new Position(2340,3588,0); positions[19] = new Position(2341,3588,0); positions[20] = new Position(2337,3587,0); positions[21] = new Position(2338,3587,0); positions[22] = new Position(2339,3587,0); positions[23] = new Position(2340,3587,0); positions[24] = new Position(2341,3587,0); } else if (redChins) { maxTrapPositionLength = 25; huntArea = new Area(2553,2937,2557, 2933); chinPrice = 1550; positions = new Position[maxTrapPositionLength]; positions[0] = new Position(2553,2937,0); positions[1] = new Position(2554,2937,0); positions[2] = new Position(2555,2937,0); positions[3] = new Position(2556,2937,0); positions[4] = new Position(2557,2937,0); positions[5] = new Position(2553,2936,0); positions[6] = new Position(2554,2936,0); positions[7] = new Position(2555,2936,0); positions[8] = new Position(2556,2936,0); positions[9] = new Position(2557,2936,0); positions[10] = new Position(2553,2935,0); positions[11] = new Position(2554,2935,0); positions[12] = new Position(2555,2935,0); positions[13] = new Position(2556,2935,0); positions[14] = new Position(2557,2935,0); positions[15] = new Position(2553,2934,0); positions[16] = new Position(2554,2934,0); positions[17] = new Position(2555,2934,0); positions[18] = new Position(2556,2934,0); positions[19] = new Position(2557,2934,0); positions[20] = new Position(2553,2933,0); positions[21] = new Position(2554,2933,0); positions[22] = new Position(2555,2933,0); positions[23] = new Position(2556,2933,0); positions[24] = new Position(2557,2933,0); //positions[30] = new Position(2553,2931,0); //positions[31] = new Position(2554,2931,0); //positions[32] = new Position(2555,2931,0); //positions[33] = new Position(2556,2931,0); //positions[34] = new Position(2557,2931,0); //positions[35] = new Position(2553,2930,0); //positions[36] = new Position(2554,2930,0); //positions[37] = new Position(2555,2930,0); //positions[38] = new Position(2556,2930,0); //positions[39] = new Position(2557,2930,0); //positions[40] = new Position(2553,2929,0); //positions[41] = new Position(2554,2929,0); //positions[42] = new Position(2555,2929,0); //positions[43] = new Position(2556,2929,0); //positions[44] = new Position(2557,2929,0); //positions[45] = new Position(2553,2928,0); //positions[46] = new Position(2554,2928,0); //positions[47] = new Position(2555,2928,0); //positions[48] = new Position(2556,2928,0); //positions[49] = new Position(2557,2928,0); } } public void executeChanceToRandomlyPickRandomTrapPositionWithOrWithoutRangeRestriction(int positionIndex, int target1, int target2, int base, int zz) { Random r = new Random(); int ra = r.nextInt(100); if(ra <= 75) { executeChanceToRandomizeTrapPositionWithinRange(target1, positionIndex,base, zz); } else { executeChanceToRandomizeTrapPosition(target2, positionIndex); } } public void executeChanceToRandomizeTrapPositionWithinRange(int target, int positionIndex, int base, int zz) { Random r = new Random(); int ra = r.nextInt(100+1); if (ra <= target) { log("Executing random chance to RANDOMIZE TRAP POSITION"); randomizeTrapPositionsWithinRange(positionIndex, base, zz); } } public void randomizeTrapPositionsWithinRange(int positionIndex, int base, int xx) { boolean trapNotSet = true; while (trapNotSet) { Random r = new Random(); int ra = r.nextInt(xx); for (int i = 0; i < positions.length; i++) { if (trapPositions[positionIndex].equals(positions[i])) { int min = i -( base + ra); if (min < 0) { min = 0; } int max = i + (base +ra); if (max > 24) { max = 24; } int rarara = r.nextInt((max - min) + (min+1)); if (!positionHasTrap(positions[rarara])) { trapPositions[positionIndex] = new Position(positions[rarara]); // randomizes position adjacent to player from range of +/- (x + xx) tiles trapNotSet = false; } } } } } public void executeChanceToRandomizeTrapPosition(int target, int positionIndex) { Random r = new Random(); int ra = r.nextInt(100); if (ra <= target && !(positionHasTrap(trapPositions[positionIndex]))) { log("Executing random chance to RANDOMIZE TRAP POSITION"); randomizeTrapPosition(positionIndex); } } public void randomizeTrapPosition(int positionIndex) { boolean r = true; if (!(positionHasTrap(trapPositions[positionIndex]))) { while (r) { Random t = new Random(); int transitionPosition = t.nextInt(positions.length); if (!positionHasTrap(positions[transitionPosition])) { trapPositions[positionIndex] = positions[transitionPosition]; r = false; } else r = true; } } } public void onPaint(Graphics2D g) { // if (img != null) { // g.drawImage(img, 7, 344, img.getWidth(), img.getHeight(), null); // } g.setFont(new Font("Chin Hunter", Font.BOLD, 15)); g.drawString("ULTIMATE CHIN HUNTER -TheManWhoBots", 10, 20); hunterXP = experienceTracker.getGainedXP(Skill.HUNTER); hxph = experienceTracker.getGainedXPPerHour(Skill.HUNTER); chinsPerHour =(int) hxph / chinXp; g.drawString("Hunter Experience Gained: " + hunterXP + " (" + NumberFormat.getNumberInstance(Locale.US).format(hxph) + "xp/h)", 10, 80); g.drawString("Chins caught per hour: " + (int)chinsPerHour + ", Profit per hour: " + (int)chinsPerHour *chinPrice, 10, 50); } public boolean moreThanTwoPlayers() { if (getPlayers().getAll().size() > 2) { return true; } return false; } public void initializeTrapPositions() { Random r = new Random(); int random = r.nextInt(1000 +1); if (random >= 1) { trapPositions[0] = positions[7 + randomPositioningOffset1]; if (maxTraps >=2) { trapPositions[1] = positions[9 + randomPositioningOffset2]; } if (maxTraps >= 3) { trapPositions[2] = positions[13 + randomPositioningOffset3]; } if (maxTraps >= 4) { trapPositions[3] = positions[18 + randomPositioningOffset4]; } if (maxTraps >= 5) { trapPositions[4] = positions[20 + randomPositioningOffset5]; } } else if (random >= 810) { } changeTrapLayout = false; } public void calculateMaxTraps() { if (hunterLevel >= 80) maxTraps = 5; else if (hunterLevel >= 60) maxTraps = 4; else if (hunterLevel >= 40) maxTraps = 3; else if (hunterLevel >= 20) maxTraps = 2; else maxTraps = 1; } public boolean positionHasTrap(Position position) { java.util.List<RS2Object> g = getObjects().getAll(); for (int i = 0; i <g.size(); i++) { if (g.get(i).getName().contains("Box trap") || g.get(i).getName().contains("Shaking box")) { if (position.equals((g.get(i).getPosition()))) { return true; } } } return false; } public void onExit() { for (int i = 0; i < collectATrap.length; i++) { collectATrap[i] = false; allTrapsLaid = true; } for (int x = 0; x < layATrap.length; x++) { layATrap[x] = false; allTrapsLaid = true; } } public void hoverOverClosestShakingBox() { RS2Object chinCaught = getObjects().closest("Shaking box"); if (chinCaught != null) { chinCaught.getPosition().hover(this.bot); try { sleep(random(12,27)); } catch (InterruptedException e) { e.printStackTrace(); } } } public void hoverOverClosestFailedTrap() { RS2Object failedTrap = getObjects().closest(9385); if (failedTrap != null) { failedTrap.getPosition().hover(this.bot); try { sleep(random(24,42)); } catch (InterruptedException e) { e.printStackTrace(); } } } public void executeChanceToHoverOverClosestFailedTrap(int target) { Random r = new Random(); int ra = r.nextInt(1000+1); if (ra <= target) { hoverOverClosestShakingBox(); } } public void executeChanceToHoverOverClosestShakingBox(int target) { Random r = new Random(); int ra = r.nextInt(1000+1); if (ra <= target) { hoverOverClosestShakingBox(); } } } Sorry for the incredibly long post, and 1100 lines of code. The script is free to use, and it is somehow decent. It is a script that may require babysitting, but will most definitely be more than enough for a FREE script. I've given up on the script months ago, as I've undergone other botting endeavours. There are better scripts out there, but as far as I'm aware there is no other functioning red chin script for free. So, Enjoy! *EDIT: Removed approximately 100-150 lines of code of useless methods and variables that were never used, updated source and download link* Edited July 16, 2018 by TheManWhoBots improvement 1 Quote Link to comment Share on other sites More sharing options...
TheManWhoBots Posted July 16, 2018 Author Share Posted July 16, 2018 Will potentially post proggy testing this script soon Quote Link to comment Share on other sites More sharing options...
The Plug Posted July 16, 2018 Share Posted July 16, 2018 (edited) "bot is still incredibly bot-like" Yeah you see, I got this thing, maybe some other time buddy. Edited July 16, 2018 by The Plug Quote Link to comment Share on other sites More sharing options...
jesenican Posted July 16, 2018 Share Posted July 16, 2018 thanks for the script! Quote Link to comment Share on other sites More sharing options...
TheManWhoBots Posted July 16, 2018 Author Share Posted July 16, 2018 1 hour ago, The Plug said: "bot is still incredibly bot-like" Yeah you see, I got this thing, maybe some other time buddy. Lol well a really good bot program shouldn't look like a bot imo 1 hour ago, jesenican said: thanks for the script! No problem! It has some methods and variables that aren't used and could use some cleaning up. But it definitely does its job. Enjoy Quote Link to comment Share on other sites More sharing options...
TheManWhoBots Posted July 25, 2018 Author Share Posted July 25, 2018 Anyone have some progress reports to see how functional the script is? I haven't gotten around to testing recently. Quote Link to comment Share on other sites More sharing options...
oscar159 Posted January 30, 2021 Share Posted January 30, 2021 Como puedo ejecutarlo? Quote Link to comment Share on other sites More sharing options...
FuryShark Posted January 30, 2021 Share Posted January 30, 2021 1 hour ago, oscar159 said: Como puedo ejecutarlo? Learn English Quote Link to comment Share on other sites More sharing options...
Herman Posted March 20, 2021 Share Posted March 20, 2021 On 1/30/2021 at 2:23 AM, FuryShark said: Learn English Quote Link to comment Share on other sites More sharing options...
SlurepieeG Posted January 23, 2022 Share Posted January 23, 2022 How is this doing? Quote Link to comment Share on other sites More sharing options...
wcinglvl999 Posted February 5, 2022 Share Posted February 5, 2022 On 1/29/2021 at 7:23 PM, FuryShark said: Learn English ? Quote Link to comment Share on other sites More sharing options...