Guest User

Untitled

a guest
Dec 7th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.33 KB | None | 0 0
  1. import org.rsbot.script.Script;
  2. import org.rsbot.script.ScriptManifest;
  3. import org.rsbot.script.wrappers.RSNPC;
  4. import org.rsbot.script.wrappers.RSObject;
  5. import org.rsbot.script.wrappers.RSTile;
  6.  
  7. import org.rsbot.script.wrappers.*;
  8.  
  9.  
  10. @ScriptManifest(authors = {""}, keywords = {""}, name = "Skeleton", description = "dsa.", version = 1)
  11.  
  12. public class Test extends Script{
  13.  
  14.  
  15. RSTile[] Cows = {
  16. new RSTile(3205, 3209, 0)
  17. , new RSTile(3217,3219,0)
  18. , new RSTile(3234,3222,0)
  19. , new RSTile(3249,3226,0)
  20. , new RSTile(3259,3239,0)
  21. , new RSTile(3250,3252,0)
  22. , new RSTile(3252,3267,0)};
  23. RSTile Ne= new RSTile(3263, 3256);
  24. RSTile Sw= new RSTile(3243, 3293);
  25. //RSArea CowPen = ("3263, 3256");
  26. RSArea CowPen = new RSArea(Sw, Ne);
  27.  
  28.  
  29. RSTile BankTile = new RSTile(3208, 3220, 2);
  30. RSTile TopStairs = new RSTile(3205, 3209, 2);
  31. RSTile MiddleStairs = new RSTile(3205, 3209, 1);
  32. RSTile BottomStairs = new RSTile(3205, 3209, 0);
  33.  
  34.  
  35. int CowHide=0;
  36. int CurrentExp;
  37. int BankerID= 494;
  38. int LowLife=200;
  39. int CowID = 12362;
  40. int Stairs = 36775;
  41. boolean Walked = false;
  42.  
  43. //private int[] FoodIDS = { 1895, 1893, 1891, 4293, 2142, 291, 2140, 3228, 9980, 7223, 6297, 6293, 6295, 6299, 7521, 9988, 7228, 2878, 7568, 2343,1861, 13433, 315, 325, 319, 3144, 347, 355, 333, 339, 351, 329, 3381, 361, 10136, 5003, 379, 365, 373, 7946, 385, 397, 391, 3369, 3371, 3373, 2309, 2325, 2333, 2327, 2331, 2323, 2335, 7178, 7180, 7188, 7190, 7198, 7200, 7208, 7210, 7218, 7220, 2003, 2011, 2289, 2291, 2293, 2295, 2297, 2299, 2301, 2303, 1891, 1893, 1895, 1897, 1899, 1901, 7072, 7062, 7078, 7064, 7084, 7082, 7066, 7068, 1942, 6701, 6703, 7054, 6705, 7056, 7060, 2130, 1985, 1993, 1989, 1978, 5763, 5765, 1913, 5747, 1905, 5739, 1909, 5743, 1907, 1911, 5745, 2955, 5749, 5751, 5753, 5755, 5757, 5759, 5761, 2084, 2034, 2048, 2036, 2217, 2213, 2205, 2209, 2054, 2040, 2080, 2277, 2225, 2255, 2221, 2253, 2219, 2281, 2227, 2223, 2191, 2233, 2092, 2032, 2074, 2030, 2281, 2235, 2064, 2028, 2187, 2185, 2229, 6883, 1971, 4608, 1883, 1885, 15272 };
  44.  
  45. @Override
  46. public boolean onStart()
  47. {
  48. walkPath(Cows);
  49. return true;
  50. }
  51.  
  52. public int loop() {
  53. if(getMyPlayer().getLocation().equals(CowPen) == true && inventory.isFull()==false)
  54. {
  55. RSNPC Cow = npcs.getNearest(CowID);
  56. Cow.interact("Attack");
  57. log.severe("Im at cows.");
  58. }
  59. if(getMyPlayer().getLocation().equals(BankTile) == true && bank.isOpen()==false && inventory.isFull()==true)
  60. {
  61. bank.open();
  62. log("Bank open");
  63. if(bank.isOpen()==true){
  64. sleep(random(400,400));
  65. bank.depositAll();
  66. log("Deposited stuff.");
  67. sleep(random(400,600));
  68. if (inventory.empty()==true){
  69. sleep(random(350,500));
  70. bank.close();
  71. log("Bank should close");
  72. sleep(random(500,600));
  73.  
  74. sleep(random(700,900));
  75. while(getMyPlayer().isMoving()){
  76. sleep(100,300);
  77. }
  78. sleep(100,300);
  79. if((getMyPlayer().getLocation().equals(TopStairs) == true || getMyPlayer().getLocation().equals(MiddleStairs) == true))
  80. {
  81. try{
  82. GoDownStairs();
  83. }
  84. finally{
  85.  
  86. }
  87.  
  88.  
  89. {
  90. if(getMyPlayer().getLocation().equals(TopStairs) == false && getMyPlayer().getLocation().equals(MiddleStairs) == true)
  91. {
  92. try{
  93.  
  94. }
  95. finally{
  96.  
  97. }
  98. }
  99.  
  100. }
  101.  
  102. }
  103.  
  104. if(getMyPlayer().getLocation().equals(BottomStairs) ==true){
  105.  
  106. walkPath(Cows);
  107.  
  108. }
  109.  
  110. }
  111. }}
  112. return random(100,400);}
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124. private boolean walkPath(RSTile[] path) {
  125. if (calc.distanceTo(path[path.length - 1]) > 4) {
  126. RSTile n = getNext(path);
  127. if(n!=null){
  128. walking.walkTileMM(n.randomize(2, 2));
  129. if(random(1,6) != 2){
  130. mouse.moveRandomly(20);
  131. }
  132. }
  133. }
  134. return false;
  135. }
  136. private RSTile getNext(RSTile[] path) {
  137. boolean found = false;
  138. for (int a = 0; a < path.length&&!found; a++) {
  139. if(calc.tileOnMap(path[path.length-1-a])){
  140. found = true;
  141. return path[path.length-1-a];
  142. }
  143. }
  144. return null;
  145. }
  146.  
  147. private void GoDownStairs()
  148. {
  149. RSObject staircase = objects.getNearest(Stairs);
  150. if(staircase.isOnScreen()==false){
  151. staircase = objects.getNearest(36774);
  152. doAction(staircase, "Climb-down");
  153. }
  154. doAction(staircase, "Climb-down");
  155. }
  156.  
  157.  
  158.  
  159. @Override
  160. public void onFinish() {
  161. }
  162.  
  163.  
  164. private boolean doAction(RSObject object, String action) {
  165. if (object != null) {
  166. int iters = random(3, 6);
  167. while (--iters > 0 && !menu.contains(action)) {
  168. try {
  169. mouse.move(object.getPoint());
  170. if (menu.contains(action)) {
  171. sleep(random(20,100));
  172. if (menu.contains(action)) {
  173. break;
  174. }
  175. }
  176. } catch (Exception e) {
  177. }
  178. }
  179. if (menu.contains(action)) {
  180. return menu.doAction(action);
  181. } else {
  182. return false;
  183. }
  184. }
  185. return false;
  186. }
  187.  
  188. }
Add Comment
Please, Sign In to add comment