**Found this from a Wbot Source I know** Has most the the random info I just glanced through it. //TODO start antirandoms public static Point getRandomPointNear(Point p, int offset) { int r = Random.nextInt(0, 4); Point rP = null; switch (r) { case 1: rP = new Point(p.x + Random.nextInt(0, offset), p.y + Random.nextInt(0, offset)); break; case 2: rP = new Point(p.x - Random.nextInt(0, offset), p.y - Random.nextInt(0, offset)); break; case 3: rP = new Point(p.x - Random.nextInt(0, offset), p.y + Random.nextInt(0, offset)); break; default: rP = new Point(p.x + Random.nextInt(0, offset), p.y - Random.nextInt(0, offset)); } return rP; } public void clickToContinue() { Mouse.move(getRandomPointNear(new Point(305, 449), 7)); sleep(200, 400); Mouse.click(true); } public static boolean valid(Widget w) { for (Widget i : Widgets.getLoaded()) { if (w.getIndex() == i.getIndex()) { return true; } } return false; } public boolean isValid(int id) { return valid(Widgets.get(id)); } public void runFromCombat() { while (me.inCombat()) { ////status = "Running from Combat!"; //walk(path, true); } } public boolean isRandomHere(int id) { try { NPC rNpc = Npcs.getNearest(id); Entity e = rNpc.getInteractingEntity(); if ((rNpc != null) && (e != null) && ((e instanceof Player))) { Player p = (Player)e; if ((p != null) && (Calculations.distanceBetween(rNpc.getLocation(), me.getLocation()) <= 2.0D) && (!rNpc.inCombat())) { return true; } } return false; } catch (Exception e) { } return false; } public int getRandomHere() { NPC rNpc = Npcs.getNearest(randomEventNpcs); if ((rNpc != null) && (isRandomHere(rNpc.getId()))) { return rNpc.getId(); } return -1; } public void handleGenie() { log("Genie"); NPC genie = Npcs.getNearest(409); if (genieIsMine) { if (genie.isVisible()) { sleep(50, 100); log("Talking to Genie"); genie.interact("Talk-to Genie"); waitFor(new Condition() { public boolean validate() { return SickFletcher.valid(Widgets.get(242)); } } , 2000L); if (valid(Widgets.get(242))) { if (Widgets.get(242).getChild(3).getText().contains("ignoring")) { log("Not yours"); genieIsMine = false; } else { sleep(900, 1150); clickToContinue(); sleep(2000, 2500); Item lamp = Inventory.getItem(2529); if (lamp != null) { log("Using lamp on Crafting"); lamp.interact("Rub"); sleep(1500, 2000); Mouse.click(Widgets.getComponent(134, 20).getRandomPoint()); sleep(1500, 2000); Mouse.click(Widgets.getComponent(134, 26).getRandomPoint()); sleep(500, 900); } } } else { sleep(900, 1150); clickToContinue(); sleep(2000, 2500); Item lamp = Inventory.getItem(2529); if (lamp != null) { log("Using lamp on Crafting"); lamp.interact("Rub"); sleep(1500, 2000); Mouse.click(Widgets.getComponent(134, 20).getRandomPoint()); sleep(1500, 2000); Mouse.click(Widgets.getComponent(134, 26).getRandomPoint()); sleep(500, 900); } } } } else if (genie == null) genieIsMine = true; } public void handlePlant() { final NPC plant = Npcs.getNearest(407); if (plant != null) { if ((!plant.inCombat()) && (plantIsMine) && (Calculations.distanceBetween(me.getLocation(), plant.getLocation()) <= 5.0D)) { log("Strange Plant"); Camera.turnToTile(plant.getLocation()); waitFor(new Condition() { public boolean validate() { return plant.getAnimation() != 348; } } , 20000L); plant.interact("Pick"); plantIsMine = false; } } else plantIsMine = true; } public void handleOldMan() { NPC oldman = Npcs.getNearest(410); if (oldManIsMine) { log("Old Man"); oldman.interact("Talk-to Mysterious Old Man"); waitFor(new Condition() { public boolean validate() { return SickFletcher.valid(Widgets.get(242)); } } , 2000L); Camera.turnToTile(oldman.getLocation()); if ((valid(Widgets.get(242))) && (Widgets.get(242).getChild(3).getText().contains("ignoring"))) { log("Not yours"); oldManIsMine = false; } sleep(2000, 4000); clickToContinue(); sleep(2000, 4000); } else if (oldman == null) { oldManIsMine = true; } } public void handlePirate() { NPC pirate = Npcs.getNearest(2539); if (pirateIsMine) { log("Pirate"); Camera.turnToTile(pirate.getLocation()); pirate.interact("Talk-to Cap'n Hand"); waitFor(new Condition() { public boolean validate() { return SickFletcher.valid(Widgets.get(242)); } } , 2000L); if ((valid(Widgets.get(242))) && (Widgets.get(242).getChild(3).getText().contains("landlubber"))) { log("Not yours"); pirateIsMine = false; } sleep(2000, 4000); clickToContinue(); sleep(2000, 4000); } else if (pirate == null) { pirateIsMine = true; } } public void handleHyde() { log("Dr Jekyll"); NPC hyde = Npcs.getNearest(2540); if (hydeIsMine) { if (hyde.interact("Talk-to Dr Jekyll")) { waitFor(new Condition() { public boolean validate() { return SickFletcher.valid(Widgets.get(241)); } } , 2000L); if (valid(Widgets.get(241))) { if (Widgets.get(241).getChild(2).getText().contains("Excuse me")) { //randomstatus = "Not yours"; hydeIsMine = false; } else { sleep(2000, 4000); clickToContinue(); sleep(2000, 4000); clickToContinue(); sleep(2000, 4000); clickToContinue(); sleep(2000, 4000); clickToContinue(); sleep(2000, 4000); } } else { sleep(2000, 4000); clickToContinue(); sleep(2000, 4000); clickToContinue(); sleep(2000, 4000); clickToContinue(); sleep(2000, 4000); clickToContinue(); sleep(2000, 4000); } } } else if (hyde == null) hydeIsMine = true; } public void handleDwarf() { log("Dwarf"); NPC dwarf = Npcs.getNearest(956); if (dwarfIsMine) { Camera.turnToTile(dwarf.getLocation()); if (dwarf.interact("Talk-to Drunken Dwarf")) { waitFor(new Condition() { public boolean validate() { return SickFletcher.valid(Widgets.get(241)); } } , 2000L); if ((valid(Widgets.get(241))) && (Widgets.get(241).getChild(2).getText().contains("not my matey!"))) { log("Not yours"); dwarfIsMine = false; } sleep(2000, 4000); clickToContinue(); sleep(2000, 4000); } } else if (dwarf == null) { dwarfIsMine = true; } } public void handleGuard() { log("Security Guard"); NPC guard = Npcs.getNearest(4375); if (guardIsMine) { if (guard.isVisible()) { Camera.turnToTile(guard.getLocation()); sleep(50, 100); log("Talking to Guard"); guard.interact("Talk-to Security Guard"); waitFor(new Condition() { public boolean validate() { return SickFletcher.valid(Widgets.get(241)); } } , 2000L); if ((valid(Widgets.get(241))) && (Widgets.get(241).getChild(2).getText().contains("I'm not talking"))) { log("Not yours"); guardIsMine = false; } sleep(900, 1150); clickToContinue(); sleep(2000, 2500); Item book = Inventory.getItem(2529); if (book != null) { log("Dropping that shit"); book.interact("Drop"); } } } else if (guard == null) guardIsMine = true; } public void handleTurpentine() { NPC rick = Npcs.getNearest(2476); if (rickIsMine) { log("Rick Turpentine"); Camera.turnToTile(rick.getLocation()); rick.interact("Talk-to Rick Turpentine"); waitFor(new Condition() { public boolean validate() { return SickFletcher.valid(Widgets.get(243)); } } , 2000L); if ((valid(Widgets.get(243))) && (Widgets.get(243).getChild(3).getText().contains("not yours"))) { log("Not yours"); rickIsMine = false; } sleep(2000, 4000); clickToContinue(); sleep(2000, 4000); } else if (rick == null) { rickIsMine = true; } } public void checkForRandoms() { switch (getRandomHere()) { case -1: //randomstatus = "Safe"; break; case 407: handlePlant(); break; case 410: handleOldMan(); break; case 409: handleGenie(); break; case 2539: handlePirate(); break; case 2538: log("Giles"); break; case 2540: handleHyde(); break; case 956: handleDwarf(); break; case 2536: log("Niles"); break; case 2537: log("Miles"); break; case 4375: handleGuard(); break; case 2476: handleTurpentine(); break; case 3117: solveSandwichLady(); break; case 2478: log("Evil Bob"); break; } } public void handleFrogPrincess() { NPC frog = Npcs.getNearest(2469); if (frog != null) { if ((frogIsMine) && (frog.interact("Talk-to Frog"))) { waitFor(new Condition() { public boolean validate() { return (SickFletcher.valid(Widgets.get(241))) || (SickFletcher.valid(Widgets.get(243))); } } , 2000L); if (valid(Widgets.get(241))) { if (Widgets.get(241).getChild(2).getText().contains("Ribbit!")) { log("Not yours"); frogIsMine = false; sleep(700, 1000); } } else if (valid(Widgets.get(243))) { log("Frog Princess"); clickToContinue(); waitFor(new Condition() { public boolean validate() { return SickFletcher.valid(Widgets.get(228)); } } , 2000L); if (Widgets.get(228).getChild(1).getText().contains("right")) Mouse.click(Widgets.get(228).getChild(1).getRandomPoint()); else { Mouse.click(Widgets.get(228).getChild(2).getRandomPoint()); } clickToContinue(); sleep(4000, 6000); clickToContinue(); } } } else frogIsMine = true; } private boolean contains(int[] y, int i) { for (int x : y) { if (x == i) { return true; } } return false; } public void pinball() { if (Npcs.getNearest(3912) != null) { int[] poles = { 15000, 15002, 15004, 15006, 15008 }; int[] wrongpoles = { 15001, 15003, 15005, 15007, 15009 }; GameObject pole = Objects.getNearest(poles); GameObject wrongpole = Objects.getNearest(wrongpoles); GameObject poledoor = Objects.getNearest(15010); int polepoint = 0; while (wrongpole != null) { log("Solving Pinball"); if ((pole != null) && (polepoint != 0)) { sleep(200); pole.interact("Tag"); sleep(7000, 9000); polepoint++; pole = Objects.getNearest(poles); } if (pole == null) { sleep(2000); if (pole == null) { Camera.turnToTile(poledoor.getLocation()); Camera.setPitch(10); sleep(500); if (poledoor.interact("Exit")) { sleep(15000); polepoint = 0; wrongpole = Objects.getNearest(wrongpoles); pole = Objects.getNearest(poles); } else { Walking.walkTo(poledoor.getLocation()); } } } if ((poledoor != null) && (polepoint == 0)) { Mouse.click(674, 483); sleep(300); Mouse.click(640, 430); sleep(300); polepoint++; } } } } public void solveEvilBob() { if ((Npcs.getNearest(2479) != null) && (Calculations.distanceBetween(me.getLocation(), Npcs.getNearest(2479).getLocation()) <= 5.0D)) { sleep(5000, 8000); try { EvilBob.evilBob(); } catch (NullPointerException npe) { log("Evil Bob Random Stopped"); } } } public void solveDrillDemon() { if ((Npcs.getNearest(2790) != null) && (Calculations.distanceBetween(me.getLocation(), Npcs.getNearest(2790).getLocation()) <= 5.0D)) try { DrillDemon demon = new DrillDemon(); sleep(5000, 8000); demon.execute(); } catch (NullPointerException npe) { log("Drill Demon Random Stopped"); } } public void solvePrisonPete() { if ((Npcs.getNearest(3118) != null) && (Calculations.distanceBetween(me.getLocation(), Npcs.getNearest(3118).getLocation()) <= 5.0D)) try { PrisonPete pp = new PrisonPete(); sleep(5000, 8000); pp.execute(); } catch (NullPointerException npe) { log("Prison Pete Random Stopped"); } } @SuppressWarnings("deprecation") public void solveMime() { int mime = 1056; int mimeEmote = -1; boolean yourTurn = false; int turns = 0; if ((Npcs.getNearest(mime) != null) && (Calculations.distanceBetween(me.getLocation(), Npcs.getNearest(mime).getLocation()) <= 2.0D)) while (Npcs.getNearest(mime) != null) { //randomstatus = "Mime School"; while ((mimeEmote == -1) && (!yourTurn) && (turns < 5)) { mimeEmote = Npcs.getNearest(mime).getAnimation(); sleep(1000); if ((mimeEmote != -1) && (valid(Widgets.get(188)) == true)) { yourTurn = true; } } if (yourTurn == true) { int child = 0; switch (mimeEmote) { case 860: child = 2; break; case 857: child = 3; break; case 861: child = 4; break; case 866: child = 5; break; case 1130: child = 6; break; case 1129: child = 7; break; case 1128: child = 8; break; case 1131: child = 9; } int x = Widgets.get(188).getChild(child).getX(); int y = Widgets.get(188).getChild(child).getY(); Mouse.move(x + 50, y + 35); sleep(50, 150); Mouse.click(true); mimeEmote = -1; yourTurn = false; turns++; sleep(1000); } } } public void solveSandwichLady() { log("Sandwich Lady"); NPC lady = Npcs.getNearest(3117); if ((lady != null) && (sandwichMine)) { lady.interact("Talk-to Sandwich lady"); sleep(1000, 4000); clickToContinue(); waitFor(new Condition() { public boolean validate() { return SickFletcher.valid(Widgets.get(297)); } } , 2000L); if (isValid(297)) { sleep(1000, 1500); if (Widgets.getComponent(297, 8).getText().contains("square")) { int child = findSandwich(10731); if (child != -1) Widgets.getComponent(297, child).click(); } else if (Widgets.getComponent(297, 8).getText().contains("roll")) { int child = findSandwich(10727); if (child != -1) Widgets.getComponent(297, child).click(); } else if (Widgets.getComponent(297, 8).getText().contains("chocolate")) { int child = findSandwich(10728); if (child != -1) Widgets.getComponent(297, child).click(); } else if (Widgets.getComponent(297, 8).getText().contains("baquette")) { int child = findSandwich(10726); if (child != -1) Widgets.getComponent(297, child).click(); } else if (Widgets.getComponent(297, 8).getText().contains("triangle")) { int child = findSandwich(10732); if (child != -1) Widgets.getComponent(297, child).click(); } else if (Widgets.getComponent(297, 8).getText().contains("kebab")) { int child = findSandwich(10729); if (child != -1) Widgets.getComponent(297, child).click(); } else if (Widgets.getComponent(297, 8).getText().contains("pie")) { int child = findSandwich(10730); if (child != -1) Widgets.getComponent(297, child).click(); } } else { log("Not yours"); sandwichMine = false; } } else if (lady == null) { sandwichMine = true; } } public int findSandwich(int id) { for (int i = 1; i < 8; i++) { if (Widgets.getComponent(297, i).getModelId() == id) { return i; } } return -1; } public void solveFreakyForester() { int freakyForester = 2458; boolean completed = false; int chickentokill = 0; boolean gotMeat = false; NPC lumberjack = Npcs.getNearest(freakyForester); GroundItem pheasantMeat = GroundItems.getNearest(6179); GameObject forestportal = Objects.getNearest(8972); int meats = 6179; if ((lumberjack != null) && (Calculations.distanceBetween(me.getLocation(), lumberjack.getLocation()) <= 2.0D)) while (lumberjack != null) try { if (chickentokill == 0) { log("Starting forrester random"); Camera.turnToTile(lumberjack.getLocation()); sleep(500); Npcs.getNearest(freakyForester).interact("Talk-To"); sleep(150, 250); String chickentokilltext = "test"; if (Widgets.getComponent(242, 2) != null) chickentokilltext = Widgets.getComponent(242, 2).getText(); else if (Widgets.getComponent(243, 2) != null) { chickentokilltext = Widgets.getComponent(243, 2).getText(); } String one = "one"; String two = "two"; String three = "three"; String four = "four"; if (chickentokilltext.indexOf(one) != -1) { chickentokill = 2459; sleep(150, 250); } else if (chickentokilltext.indexOf(two) != -1) { chickentokill = 2460; sleep(150, 250); } else if (chickentokilltext.indexOf(three) != -1) { chickentokill = 2461; sleep(150, 250); } else if (chickentokilltext.indexOf(four) != -1) { chickentokill = 2462; sleep(150, 250); } sleep(1000); pheasantMeat = GroundItems.getNearest(meats); } else if ((!Inventory.contains(meats)) && (!gotMeat)) { if (pheasantMeat == null) { Npcs.getNearest(chickentokill).interact("Attack"); sleep(3000, 5000); pheasantMeat = GroundItems.getNearest(meats); } else if ((pheasantMeat != null) && (!Inventory.isFull())) { pheasantMeat = GroundItems.getNearest(meats); pheasantMeat.interact("Take"); gotMeat = true; sleep(3000, 6000); } else if ((pheasantMeat != null) && (Inventory.isFull())) { if (Inventory.contains(59)) { Inventory.getItem(59).interact("drop"); sleep(3000, 6000); pheasantMeat.interact("Take"); gotMeat = true; sleep(3000, 6000); } else if ((Inventory.contains(1516)) && (!Inventory.contains(59))) { Inventory.getItem(1516).interact("drop"); sleep(3000, 6000); pheasantMeat.interact("Take"); gotMeat = true; sleep(300, 600); } else { log("Inventory full cannot complete random"); } } } if (gotMeat == true) { Camera.turnToTile(lumberjack.getLocation()); sleep(500); Npcs.getNearest(freakyForester).interact("Talk-to"); sleep(4000); completed = true; } if (completed == true) { forestportal = Objects.getNearest(8972); Walking.walkTo(forestportal.getLocation()); sleep(10000); Camera.turnToTile(forestportal.getLocation()); sleep(500); Objects.getNearest(8972).click(); sleep(10000); if (valid(Widgets.get(566))) { Widgets.getComponent(566, 18).click(); } sleep(5000); lumberjack = Npcs.getNearest(freakyForester); } sleep(2000); } catch (NullPointerException npe) { } } public void SolveTheBox() { try { Item box = Inventory.getItem(3063); if (box != null) if (isValid(190)) { String anw = getAnwser(); for (int i = 10; i < 13; i++) { Component found = Widgets.getComponent(190, i); if (found.getText().toLowerCase().contains(anw)) { found.click(); } for (Timer ii = new Timer(2000L); (ii.getElapsed() < 2000L) && (isValid(190)); sleep(100)); } } else { box.interact("Open"); for (Timer ii = new Timer(2000L); (ii.getElapsed() < 2000L) && (!isValid(190)); sleep(100)); } } catch (NullPointerException e) { } } public String getAnwser() { String anw = ""; String question = getQuestion(); String anwser = getSides(); String[] temp = anwser.split("-"); for (String i : temp) { if (i.contains(question)) { anw = i.replace(question, ""); } } return anw; } public String getQuestion() { String question = ""; if (isValid(190)) { question = Widgets.getComponent(190, 6).getText(); if (question.contains("shape has")) { question = question.substring(question.indexOf("number ") + 7, question.indexOf("?")); } if (question.contains("number is")) { question = question.substring(question.indexOf("the ") + 4, question.indexOf("?")).toLowerCase(); } } return question; } public String getSides() { String result = ""; String[] shape = { "", "", "" }; String[] number = { "", "", "" }; int[] circle = { 7005, 7020, 7035 }; int[] pentagon = { 7006, 7021, 7036 }; int[] square = { 7007, 7022, 7037 }; int[] star = { 7008, 7023, 7038 }; int[] triangle = { 7009, 7024, 7039 }; int[] n0 = { 7010, 7025, 7040 }; int[] n1 = { 7011, 7026, 7041 }; int[] n2 = { 7012, 7027, 7042 }; int[] n3 = { 7013, 7028, 7043 }; int[] n4 = { 7014, 7029, 7044 }; int[] n5 = { 7015, 7030, 7045 }; int[] n6 = { 7016, 7031, 7046 }; int[] n7 = { 7017, 7032, 7047 }; int[] n8 = { 7018, 7033, 7048 }; int[] n9 = { 7019, 7034, 7049 }; if (isValid(190)) { for (int i = 0; i < 3; i++) { if (contains(circle, Widgets.getComponent(190, i).getModelId())) { shape[i] = "circle"; } if (contains(pentagon, Widgets.getComponent(190, i).getModelId())) { shape[i] = "pentagon"; } if (contains(star, Widgets.getComponent(190, i).getModelId())) { shape[i] = "star"; } if (contains(square, Widgets.getComponent(190, i).getModelId())) { shape[i] = "square"; } if (contains(triangle, Widgets.getComponent(190, i).getModelId())) { shape[i] = "triangle"; } } for (int i = 3; i < 6; i++) { if (contains(n0, Widgets.getComponent(190, i).getModelId())) { number[(i - 3)] = "0"; } if (contains(n1, Widgets.getComponent(190, i).getModelId())) { number[(i - 3)] = "1"; } if (contains(n2, Widgets.getComponent(190, i).getModelId())) { number[(i - 3)] = "2"; } if (contains(n3, Widgets.getComponent(190, i).getModelId())) { number[(i - 3)] = "3"; } if (contains(n4, Widgets.getComponent(190, i).getModelId())) { number[(i - 3)] = "4"; } if (contains(n5, Widgets.getComponent(190, i).getModelId())) { number[(i - 3)] = "5"; } if (contains(n6, Widgets.getComponent(190, i).getModelId())) { number[(i - 3)] = "6"; } if (contains(n7, Widgets.getComponent(190, i).getModelId())) { number[(i - 3)] = "7"; } if (contains(n8, Widgets.getComponent(190, i).getModelId())) { number[(i - 3)] = "8"; } if (contains(n9, Widgets.getComponent(190, i).getModelId())) { number[(i - 3)] = "9"; } } for (int i = 0; i < 3; i++) { result = result + shape[i] + number[i] + "-"; } } return result; } //TODO end of antirandoms