Guest User

Untitled

a guest
Dec 7th, 2017
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.21 KB | None | 0 0
  1. import java.awt.geom.Area;
  2. import org.rsbot.script.Script;
  3. import org.rsbot.script.ScriptManifest;
  4. import java.awt.*;
  5. import java.awt.event.ActionEvent;
  6. import java.awt.event.ActionListener;
  7. import java.awt.event.MouseEvent;
  8. import java.awt.event.MouseListener;
  9. import java.awt.image.BufferedImage;
  10. import org.rsbot.event.events.MessageEvent;
  11. import org.rsbot.event.listeners.MessageListener;
  12. import org.rsbot.event.listeners.PaintListener;
  13. import org.rsbot.script.wrappers.RSComponent;
  14. import org.rsbot.script.wrappers.RSGroundItem;
  15. import org.rsbot.script.wrappers.RSNPC;
  16. import org.rsbot.script.wrappers.RSObject;
  17. import org.rsbot.script.wrappers.RSTile;
  18. import org.rsbot.script.*;
  19. import org.rsbot.script.methods.Bank;
  20. import org.rsbot.script.methods.Skills;
  21. import org.rsbot.script.wrappers.*;
  22. import java.io.IOException;
  23. import java.net.URL;
  24. import java.io.BufferedReader;
  25. import java.io.InputStreamReader;
  26. import java.io.PrintWriter;
  27. import java.util.regex.Matcher;
  28. import java.util.regex.Pattern;
  29. import java.awt.BasicStroke;
  30. import java.awt.Container;
  31. import java.awt.Image;
  32.  
  33. @ScriptManifest(authors = {""}, keywords = {""}, name = "Skeleton", description = "boodsbies.", version = 1)
  34.  
  35. public class Test extends Script{
  36.  
  37.  
  38. RSTile[] Cows = {
  39. new RSTile(3205, 3209, 0)
  40. , new RSTile(3217,3219,0)
  41. , new RSTile(3234,3222,0)
  42. , new RSTile(3249,3226,0)
  43. , new RSTile(3259,3239,0)
  44. , new RSTile(3250,3252,0)
  45. , new RSTile(3252,3267,0)};
  46. RSTile Ne= new RSTile(3263, 3256);
  47. RSTile Sw= new RSTile(3243, 3293);
  48. //RSArea CowPen = ("3263, 3256");
  49. RSArea CowPen = new RSArea(Sw, Ne);
  50.  
  51.  
  52. RSTile BankTile = new RSTile(3208, 3220, 2);
  53. RSTile TopStairs = new RSTile(3205, 3209, 2);
  54. RSTile MiddleStairs = new RSTile(3205, 3209, 1);
  55. RSTile BottomStairs = new RSTile(3205, 3209, 0);
  56.  
  57. int CowHide=0;
  58. int CurrentExp;
  59. int BankerID= 494;
  60. int LowLife=200;
  61. int CowID = 12362;
  62. int Stairs = 36775;
  63. boolean Walked = false;
  64.  
  65. //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 };
  66.  
  67. @Override
  68. public boolean onStart()
  69. {
  70. return true;
  71. }
  72.  
  73. public int loop() {
  74. log.severe("okay, Started.");
  75. if(getMyPlayer().getLocation().equals(CowPen) == true && inventory.isFull()==false)
  76. walkPath(Cows);
  77. {
  78. RSNPC Cow = npcs.getNearest(CowID);
  79. Cow.interact("Attack");
  80. log.severe("Im at cows.");
  81. }
  82. RSTile BankTile = new RSTile(3208, 3220, 2);
  83. if(getMyPlayer().getLocation().equals(BankTile) == true && bank.isOpen()==false && inventory.isFull()==true)
  84. {
  85. bank.open();
  86. log("Bank open");
  87. if(bank.isOpen()==true){
  88. sleep(random(400,400));
  89. bank.depositAll();
  90. log("Deposited stuff.");
  91. sleep(random(400,600));
  92. if (inventory.empty()==true){
  93. sleep(random(350,500));
  94. bank.close();
  95. log("Bank should close");
  96. sleep(random(500,600));
  97. TopStairWalk();
  98. sleep(random(700,900));
  99. while(getMyPlayer().isMoving()){
  100. sleep(100,300);
  101. }
  102. sleep(100,300);
  103. if((!getMyPlayer().getLocation().equals(TopStairs) == true))
  104. {
  105. GoDownStairs();
  106.  
  107. {
  108. TopStairWalk();
  109. }
  110.  
  111. if(getMyPlayer().getLocation().equals(BottomStairs) ==false){
  112. GoDownStairs();
  113. }
  114.  
  115. }
  116. if(getMyPlayer().getLocation().equals(BottomStairs) ==true){
  117. try{
  118. walkPath(Cows);
  119. }
  120. finally{
  121.  
  122. }
  123. }
  124.  
  125. }
  126. }}
  127. return random(100,400);}
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139. private boolean walkPath(RSTile[] path) {
  140. if (calc.distanceTo(path[path.length - 1]) > 4) {
  141. RSTile n = getNext(path);
  142. if(n!=null){
  143. walking.walkTileMM(n.randomize(2, 2));
  144. if(random(1,6) != 2){
  145. mouse.moveRandomly(20);
  146. }
  147. }
  148. }
  149. return false;
  150. }
  151. private RSTile getNext(RSTile[] path) {
  152. boolean found = false;
  153. for (int a = 0; a < path.length&&!found; a++) {
  154. if(calc.tileOnMap(path[path.length-1-a])){
  155. found = true;
  156. return path[path.length-1-a];
  157. }
  158. }
  159. return null;
  160. }
  161.  
  162. private void GoDownStairs()
  163. {
  164. RSObject staircase = objects.getNearest(Stairs);
  165. if(staircase.isOnScreen()==false){
  166. staircase = objects.getNearest(36774);
  167. doAction(staircase, "Climb-down");
  168. }
  169. doAction(staircase, "Climb-down");
  170. }
  171.  
  172.  
  173.  
  174. @Override
  175. public void onFinish() {
  176. }
  177.  
  178.  
  179. private boolean doAction(RSObject object, String action) {
  180. if (object != null) {
  181. int iters = random(3, 6);
  182. while (--iters > 0 && !menu.contains(action)) {
  183. try {
  184. mouse.move(object.getPoint());
  185. if (menu.contains(action)) {
  186. sleep(random(20,100));
  187. if (menu.contains(action)) {
  188. break;
  189. }
  190. }
  191. } catch (Exception e) {
  192. }
  193. }
  194. if (menu.contains(action)) {
  195. return menu.doAction(action);
  196. } else {
  197. return false;
  198. }
  199. }
  200. return false;
  201. }
  202.  
  203. private void WalkToCows() {
  204. RSWeb walkWeb = web.getWeb(getMyPlayer().getLocation(), CowTile);
  205. if (walkWeb != null) {
  206. if (!getMyPlayer().isMoving()
  207. || calc.distanceTo(walking.getDestination()) < 4) {
  208. try {
  209. walkWeb.step();
  210. } catch (Exception e) {
  211. }}}}
  212.  
  213. private void TopStairWalk() {
  214. RSWeb walkWeb = web.getWeb(getMyPlayer().getLocation(), TopStairs);
  215. if (walkWeb != null) {
  216. if (!getMyPlayer().isMoving()
  217. || calc.distanceTo(walking.getDestination()) < 4) {
  218. try {
  219. walkWeb.step();
  220. } catch (Exception e) {
  221. }}}}
  222.  
  223.  
  224. private void WalkToBank() {
  225. RSWeb walkWeb = web.getWeb(getMyPlayer().getLocation(), BankTile);
  226. if (walkWeb != null) {
  227. if (!getMyPlayer().isMoving()
  228. || calc.distanceTo(walking.getDestination()) < 4) {
  229. try {
  230. walkWeb.step();
  231. } catch (Exception e) {
  232. }}}}
  233. }
Add Comment
Please, Sign In to add comment