Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
501
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.31 KB | None | 0 0
  1. import org.rsbot.script.Script;
  2. import org.rsbot.script.ScriptManifest;
  3. import org.rsbot.script.util.Filter;
  4. import org.rsbot.script.wrappers.RSGroundItem;
  5. import org.rsbot.script.wrappers.RSNPC;
  6. import org.rsbot.script.wrappers.RSObject;
  7. import org.rsbot.script.wrappers.RSTile;
  8.  
  9. @ScriptManifest(authors = { "Ghillie" }, keywords = { "Combat" }, name = "GoblinKiller", version = 1.0, description = "Kills Goblins!")
  10. public class GoblinKiller extends Script {
  11. // Timer150@Gmail.com
  12.  
  13. private int[] GOBLIN = { 12359, 12353, 12354, 12355, 12356, 12357, 12358 };
  14. private int BONES = 526;
  15. private int IRON_ARROW = 884;
  16. private int STAIRSB = 36776;
  17. private int STAIRST = 36777;
  18.  
  19. private boolean isGoblin(int ID) {
  20. for (int TEST_ID : GOBLIN)
  21. if (TEST_ID == ID)
  22. return true;
  23. return false;
  24. }
  25.  
  26. private final Filter<RSNPC> FILTER_GOBLINS = new Filter<RSNPC>() {
  27. public boolean accept(RSNPC npc) {
  28. return ((!npc.isInCombat()) && (isGoblin(npc.getID())));
  29. }
  30. };
  31.  
  32. public int loop() {
  33. if (!getMyPlayer().isInCombat()) {
  34. RSNPC Goblin = npcs.getNearest(FILTER_GOBLINS);
  35. if (Goblin != null) {
  36. Goblin.doAction("Attack");
  37. sleep(random(1500, 3000));
  38. RSGroundItem bones = groundItems.getNearest(BONES);
  39. {
  40. bones.doAction("Take");
  41. }
  42. RSGroundItem ironarrow = groundItems.getNearest(IRON_ARROW);
  43. {
  44. if (ironarrow != null) {
  45. ironarrow.doAction("Take");
  46. if (inventory.contains(IRON_ARROW))
  47. inventory.getItem(IRON_ARROW).doAction("Equip");
  48. }
  49. }
  50. }
  51. if (inventory.isFull()) {
  52. while (calc.distanceBetween(getMyPlayer().getLocation(),
  53. new RSTile(3205, 3228)) < 3)
  54. walking
  55. .walkPathMM(walking
  56. .findPath(new RSTile(3205, 3228)));
  57. RSObject StairsB = objects.getNearest(STAIRSB);
  58. StairsB.doAction("Climb-up");
  59. sleep(random(3000, 6000));
  60. RSObject StairsT = objects.getNearest(STAIRST);
  61. StairsT.doAction("Climb-up");
  62. sleep(random(3000, 6000));
  63. while (calc.distanceBetween(getMyPlayer().getLocation(),
  64. new RSTile(3206, 3226)) < 3)
  65. walking
  66. .walkPathMM(walking
  67. .findPath(new RSTile(3206, 3226)));
  68. bank.open();
  69. bank.deposit(BONES, 0);
  70. bank.close();
  71. }
  72.  
  73. } else {
  74. sleep(random(50, 100));
  75. }
  76. return random(100, 200);
  77. }
  78. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement