Guest User

Untitled

a guest
Nov 16th, 2018
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.69 KB | None | 0 0
  1. import java.awt.Graphics;
  2.  
  3. import com.rarebot.event.listeners.PaintListener;
  4. import com.rarebot.script.Script;
  5. import com.rarebot.script.ScriptManifest;
  6. import com.rarebot.script.wrappers.RSArea;
  7. import com.rarebot.script.wrappers.RSObject;
  8. import com.rarebot.script.wrappers.RSTile;
  9. import com.rarebot.script.wrappers.RSWeb;
  10.  
  11. @ScriptManifest(name="CloudyWoods", authors={""}, keywords={""}, version= 1.0, description="")
  12. public class CloudyWoods extends Script implements PaintListener {
  13.  
  14. //Areas
  15. RSArea DraynorBankArea = new RSArea(3092,3246,3095,3240);
  16. RSArea DraynorTreeArea = new RSArea(3057,3255,3064,3251);
  17.  
  18. //Tiles
  19. RSTile DraynorBankTile = new RSTile(3093,3244);
  20. RSTile DraynorTreeTile = new RSTile(3060,3253);
  21.  
  22. //Info
  23. int status = 0;
  24. String[] statusText = { };
  25.  
  26. //Vars
  27. RSWeb WalkPath;
  28. int chopCD = 0;
  29. int anim = 867;
  30.  
  31. @Override
  32. public int loop() {
  33. log("wtF");
  34. if(players.getMyPlayer().getAnimation() == anim) {
  35. chopCD = 50;
  36. } else {
  37. chopCD--;
  38. }
  39.  
  40. if(chopCD == 0) {
  41. switch(getStatus()) {
  42. case 1: //in bank
  43. {
  44. if(inventory.isFull()) {
  45. if(bank.isOpen()) {
  46. bank.depositAll();
  47. } else {
  48. bank.open();
  49. }
  50. } else {
  51. WalkPath = web.getWeb(getMyPlayer().getLocation(),DraynorTreeTile);
  52. walkProcedure();
  53. }
  54. } break;
  55. case 2: //walking
  56. {
  57. if(inventory.isFull()) {
  58. WalkPath = web.getWeb(getMyPlayer().getLocation(),DraynorTreeTile);
  59. } else {
  60. WalkPath = web.getWeb(getMyPlayer().getLocation(),DraynorBankTile);
  61. }
  62. walkProcedure();
  63. } break;
  64. case 3: //chopping
  65. {
  66. if(!inventory.isFull()) {
  67. RSObject tree = objects.getNearest("Willow");
  68. if(tree != null) {
  69. tree.interact("Chop");
  70. }
  71. } else {
  72. WalkPath = web.getWeb(getMyPlayer().getLocation(),DraynorBankTile);
  73. walkProcedure();
  74. }
  75. } break;
  76. }
  77. }
  78. return calc.random(200, 800);
  79. }
  80.  
  81. public void walkProcedure() {
  82. if(WalkPath != null) {
  83. if(calc.distanceTo(walking.getDestination()) <= 7 || walking.getDestination() == null) {
  84. try {
  85. WalkPath.step();
  86. sleep(200,500);
  87. } catch (Exception e) {
  88. log("borked");
  89. }
  90. }
  91. }
  92. }
  93.  
  94. public int getStatus() {
  95. if(DraynorBankArea.contains(players.getMyPlayer().getLocation())) {
  96. return 1;
  97. }
  98. if(DraynorTreeArea.contains(players.getMyPlayer().getLocation())) {
  99. return 3;
  100. }
  101. return 2;
  102. }
  103.  
  104. @Override
  105. public void onRepaint(Graphics g) {
  106. g.drawString("Status: " + statusText[status], 10, 10);
  107. g.drawString("Cooldown: " + chopCD, 10, 20);
  108. g.drawString("Inventory: ", 10, 30);
  109. g.drawString("Object: ", 10, 40);
  110. g.drawString("NPC: ", 10, 50);
  111. }
  112. }
Add Comment
Please, Sign In to add comment