Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.util.Filter;
- import org.rsbot.script.wrappers.RSGroundItem;
- import org.rsbot.script.wrappers.RSNPC;
- import org.rsbot.script.wrappers.RSObject;
- import org.rsbot.script.wrappers.RSTile;
- @ScriptManifest(authors = { "Ghillie" }, keywords = { "Combat" }, name = "GoblinKiller", version = 1.0, description = "Kills Goblins!")
- public class GoblinKiller extends Script {
- // Timer150@Gmail.com
- private int[] GOBLIN = { 12359, 12353, 12354, 12355, 12356, 12357, 12358 };
- private int BONES = 526;
- private int IRON_ARROW = 884;
- private int STAIRSB = 36776;
- private int STAIRST = 36777;
- private boolean isGoblin(int ID) {
- for (int TEST_ID : GOBLIN)
- if (TEST_ID == ID)
- return true;
- return false;
- }
- private final Filter<RSNPC> FILTER_GOBLINS = new Filter<RSNPC>() {
- public boolean accept(RSNPC npc) {
- return ((!npc.isInCombat()) && (isGoblin(npc.getID())));
- }
- };
- public int loop() {
- if (!getMyPlayer().isInCombat()) {
- RSNPC Goblin = npcs.getNearest(FILTER_GOBLINS);
- if (Goblin != null) {
- Goblin.doAction("Attack");
- sleep(random(1500, 3000));
- RSGroundItem bones = groundItems.getNearest(BONES);
- {
- bones.doAction("Take");
- }
- RSGroundItem ironarrow = groundItems.getNearest(IRON_ARROW);
- {
- if (ironarrow != null) {
- ironarrow.doAction("Take");
- if (inventory.contains(IRON_ARROW))
- inventory.getItem(IRON_ARROW).doAction("Equip");
- }
- }
- }
- if (inventory.isFull()) {
- while (calc.distanceBetween(getMyPlayer().getLocation(),
- new RSTile(3205, 3228)) < 3)
- walking
- .walkPathMM(walking
- .findPath(new RSTile(3205, 3228)));
- RSObject StairsB = objects.getNearest(STAIRSB);
- StairsB.doAction("Climb-up");
- sleep(random(3000, 6000));
- RSObject StairsT = objects.getNearest(STAIRST);
- StairsT.doAction("Climb-up");
- sleep(random(3000, 6000));
- while (calc.distanceBetween(getMyPlayer().getLocation(),
- new RSTile(3206, 3226)) < 3)
- walking
- .walkPathMM(walking
- .findPath(new RSTile(3206, 3226)));
- bank.open();
- bank.deposit(BONES, 0);
- bank.close();
- }
- } else {
- sleep(random(50, 100));
- }
- return random(100, 200);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement