Lol_marcus Posted July 1 Share Posted July 1 Hi! Today I remembered void armour was a thing, so I made this; it works well and as intended - around 350 points gained so far between testing and actually running. In a nutshell: it will cross the nearest gangplank (that way you can use it on any of the boat levels) it will wait until the game starts when the game starts, it will click between 14-18 tiles south (because the PC map's coords change constantly) it will stay around the void knight and kill any enemies within a specified radius it will constantly 1 tick prayer flick (so you never take too much damage and you always get boosts) rinse and repeat Feel free to use as-is, copyfor your own projects, or suggest improvements! @ScriptManifest(info = "", logo = "", name = "Pest Control", author = "Marcus", version = 1.0) public class pestControl extends Script { private InvokeHelper invokeHelper; private Position ATTACK_ZONE_POSITION; private boolean gameStarted = false; public void onStart() throws InterruptedException { super.onStart(); invokeHelper = new InvokeHelper(this); log("Bot Started!"); } @Override public int onLoop() { if (!isInGame()) { gameStarted = false; if (!isInBoat()) { crossGangplank(); } } else { if (!gameStarted) { setAttackZonePosition(); gameStarted = true; } if (shouldGoToAttackZone()) { goToAttackZone(); } else { attackNearbyNPC(); } } return random(200, 300); } @Override public void onGameTick() { super.onGameTick(); RS2Widget quickPrayerWidget = getQuickPrayerWidget(); if (quickPrayerWidget == null) { return; } if (getPrayer().isQuickPrayerActive()) { invokeHelper.invoke(quickPrayerWidget, 0); invokeHelper.invoke(quickPrayerWidget, 0); } else { invokeHelper.invoke(quickPrayerWidget, 0); } } private RS2Widget getQuickPrayerWidget() { return getWidgets().get(160, 19); } private boolean isInGame() { RS2Widget gameWidget = getWidgets().get(408, 5); return gameWidget != null && gameWidget.isVisible(); } private boolean isInBoat() { RS2Widget boatWidget = getWidgets().get(407, 4); return boatWidget != null && boatWidget.isVisible(); } private void crossGangplank() { RS2Object gangplank = getObjects().closest("Gangplank"); if (gangplank != null && gangplank.interact("Cross")) { Sleep.until(() -> isInBoat(), 5000); if (isInBoat()) { log("Waiting for the game to start..."); Sleep.until(() -> isInGame(), 5000); } } } private void setAttackZonePosition() { Position playerStartPosition = myPosition(); if (playerStartPosition != null) { ATTACK_ZONE_POSITION = new Position(playerStartPosition.getX(), playerStartPosition.getY() - (random(14,18)), 0); log("Attack zone position set to: " + ATTACK_ZONE_POSITION); } } private boolean shouldGoToAttackZone() { return ATTACK_ZONE_POSITION != null && myPlayer().getPosition().distance(ATTACK_ZONE_POSITION) > 7; } private void goToAttackZone() { if (!myPlayer().isAnimating() && !myPlayer().isMoving()) { log("Running to the attack zone at position: " + ATTACK_ZONE_POSITION); getWalking().walk(ATTACK_ZONE_POSITION); Sleep.until(() -> myPlayer().getPosition().distance(ATTACK_ZONE_POSITION) <= 7, 10000); } else { log("Player is moving..."); } } private void attackNearbyNPC() { NPC target = getNpcs().closest(npc -> npc != null && npc.exists() && npc.hasAction("Attack") && getMap().canReach(npc) && isNearAttackZone(npc) ); if (target != null) { log("Attacking NPC: " + target.getName()); if (invokeHelper.invoke(target, "Attack")) { Sleep.until(() -> myPlayer().isAnimating() || myPlayer().isUnderAttack(), 1000); } } else { log("No suitable NPC found."); } } private boolean isNearAttackZone(NPC npc) { return npc != null && ATTACK_ZONE_POSITION != null && ATTACK_ZONE_POSITION.distance(npc.getPosition()) < 7; } @Override public void onExit() { log("Bot Stopped!"); } } 3 Quote Link to comment Share on other sites More sharing options...
Czar Posted July 1 Share Posted July 1 Nice! Scripter rank when? xD 1 Quote Link to comment Share on other sites More sharing options...
Lol_marcus Posted July 1 Author Share Posted July 1 46 minutes ago, Czar said: Nice! Scripter rank when? xD Thank you, I appreciate that! Likely never, my motivation to play tends to come and go 1 Quote Link to comment Share on other sites More sharing options...
adumon Posted July 1 Share Posted July 1 Man keeps on going, nice! 1 Quote Link to comment Share on other sites More sharing options...