Guest User

Untitled

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