Guest User

Untitled

a guest
Jan 19th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.55 KB | None | 0 0
  1. import javax.swing.JOptionPane;
  2.  
  3. import org.powerbot.core.script.ActiveScript;
  4. import org.powerbot.core.script.job.Task;
  5. import org.powerbot.game.api.Manifest;
  6. import org.powerbot.game.api.methods.Walking;
  7. import org.powerbot.game.api.methods.interactive.NPCs;
  8. import org.powerbot.game.api.methods.interactive.Players;
  9. import org.powerbot.game.api.methods.node.GroundItems;
  10. import org.powerbot.game.api.methods.tab.Inventory;
  11. import org.powerbot.game.api.wrappers.Area;
  12. import org.powerbot.game.api.wrappers.Tile;
  13. import org.powerbot.game.api.wrappers.interactive.NPC;
  14. import org.powerbot.game.api.wrappers.node.GroundItem;
  15. import org.powerbot.game.api.wrappers.node.Item;
  16.  
  17. @Manifest(authors = { "Shootinkill(Fixed by Blackstab1337)" }, name = "CowKiller HideBanker", description = "Starts from lumby Bank Grabs 10 Food Walks DownStairs Goes to CowGate Opens then kills Cows Picks Up Hides And Then Walks Back Up Stairs And Banks then Returns ", version = 0.1)
  18. public class KillerOfCows extends ActiveScript{
  19. // all Item IDS
  20. public static int CowGateID = 45212;
  21.  
  22. public static int[] CowID = { 12362, 12363, 12364, 12365 };
  23.  
  24. public static int AttackAnimation = 15074;
  25.  
  26. public static int FoodID = 333;
  27. // FoodID Trout 333 or Salmon 329
  28. public static boolean run1, start;
  29. public static int HideID = 1739;
  30.  
  31. public static int StairsID1 = 36775;
  32. public static int StairsID2 = 36774;
  33. public static int StairsID3 = 36773;
  34.  
  35. public static int BoothID = 494;
  36.  
  37. // all Area IDS
  38.  
  39. public static Area BankArea = new Area(new Tile[] { new Tile(3208,
  40. 3220, 0) });
  41.  
  42. public static Area StairAreaTop = new Area(new Tile[] {
  43. new Tile(3205, 3209, 0), new Tile(3205, 3209, 0),
  44. new Tile(3205, 3208, 0), new Tile(3204, 3208, 0) });
  45.  
  46. public static Area CowArea = new Area(new Tile[] {
  47. new Tile(3252, 3268, 0), new Tile(3264, 3268, 0),
  48. new Tile(3264, 3255, 0), new Tile(3252, 3255, 0) });
  49.  
  50. public static Area StairAreaBottom = new Area(new Tile[] {
  51. new Tile(3205, 3209, 0), new Tile(3205, 3209, 0),
  52. new Tile(3205, 3208, 0), new Tile(3204, 3208, 0) });
  53.  
  54. public static Area GateArea = new Area(new Tile[] {
  55. new Tile(3252, 3266, 0), new Tile(3250, 3264, 0),
  56. new Tile(3252, 3264, 0), new Tile(3252, 3268, 0) });
  57.  
  58. // all Walk IDS
  59. public static Tile[] pathToGate = new Tile[] {
  60. new Tile(3205, 3209, 0), new Tile(3209, 3210, 0),
  61. new Tile(3214, 3210, 0), new Tile(3214, 3215, 0),
  62. new Tile(3214, 3218, 0), new Tile(3219, 3218, 0),
  63. new Tile(3224, 3218, 0), new Tile(3229, 3218, 0),
  64. new Tile(3234, 3218, 0), new Tile(3234, 3223, 0),
  65. new Tile(3234, 3228, 0), new Tile(3229, 3231, 0),
  66. new Tile(3225, 3234, 0), new Tile(3222, 3238, 0),
  67. new Tile(3221, 3243, 0), new Tile(3219, 3248, 0),
  68. new Tile(3217, 3253, 0), new Tile(3217, 3258, 0),
  69. new Tile(3222, 3260, 0), new Tile(3227, 3261, 0),
  70. new Tile(3229, 3261, 0), new Tile(3234, 3261, 0),
  71. new Tile(3239, 3261, 0), new Tile(3244, 3261, 0),
  72. new Tile(3249, 3263, 0), new Tile(3252, 3266, 0) };
  73.  
  74. public static Tile[] pathbankToTopStair = new Tile[] {
  75. new Tile(3208, 3220, 0), new Tile(3205, 3215, 0),
  76. new Tile(3205, 3209, 0) };
  77. @Override
  78. public int loop() {
  79. // TODO Auto-generated method stub
  80. if(foodId.validate())
  81. foodId.run();
  82. if(Attack.validate())
  83. Attack.run();
  84. if(Eat.validate())
  85. Eat.run();
  86. return 25;
  87. }
  88. public static class foodId{
  89. public static void run(){
  90. try{
  91. FoodID = Integer.parseInt(JOptionPane.showInputDialog("Enter food id you want to eat or leave it blank for no food(risk of dying)"));
  92. run1 = true;
  93. }catch(Exception e){
  94. FoodID = -1;
  95. run1 = true;
  96. }
  97. }
  98. public static boolean validate(){
  99. return run1 == false;
  100. }
  101.  
  102. }
  103. public static class Attack{
  104. public static void run(){
  105. NPC cow = NPCs.getNearest(CowID);
  106.  
  107. if(cow != null){
  108. if(cow.isOnScreen()){
  109. if(!cow.isInCombat()){
  110. cow.interact("Attack");
  111. Task.sleep(500,950);
  112. }
  113. }else{
  114. Walking.walk(cow);
  115. Task.sleep(500,550);
  116. }
  117. }
  118. }
  119. public static boolean validate(){
  120. return Players.getLocal().isIdle() && run1;
  121. }
  122. }
  123. public static class Eat{
  124. public static void run(){
  125.  
  126. if(FoodID != -1){
  127. for(Item i : Inventory.getItems()){
  128. if(i.getId() == FoodID){
  129. i.getWidgetChild().interact("Eat");
  130. Task.sleep(500,1000);
  131. }
  132. }
  133. }else{
  134. Task.sleep(30000);
  135. }
  136. }
  137. public static boolean validate(){
  138. return Players.getLocal().getHpPercent() <= 30 && run1;
  139. }
  140. }
  141.  
  142. }
Add Comment
Please, Sign In to add comment