Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.95 KB | None | 0 0
  1. import org.rsbot.script.ScriptManifest;
  2. import org.rsbot.script.Script;
  3.  
  4. import org.rsbot.script.wrappers.RSObject;
  5. import org.rsbot.script.wrappers.RSTile;
  6. import org.rsbot.script.wrappers.RSArea;
  7.  
  8. @ScriptManifest(authors = { "Susta1nz" }, keywords = { "Power Cutter" }, name = "CutandDrop", version = 1.0, description = "Power cuts Trees")
  9. public class CutAndDrop extends Script {
  10.  
  11. private int treeTree = 1278;
  12. private int runeHatchet = 1359;
  13.  
  14. private RSTile[] walkingPath = (new RSTile(3165, 3456), new RSTile(3169, 3454), new RSTile(3182, 3446), new RSTile(3182, 3444)};
  15. //^trees to bank
  16. private RSArea bankArea = new RSArea(new RSTile(3182, 3440), new RSTile(3189, 3446));
  17. private RSArea treeArea = new RSArea(new RSTile(3153, 3451), new RSTile(3161, 3459));
  18.  
  19. public boolean onStart(){
  20. mouse.setSpeed(random(4, 7));
  21. return true;
  22. }
  23.  
  24. public int loop(){
  25. if(inventory.isFull()){
  26. if(bankArea.contains(getMyPlayer().getLocation())){
  27. if(!bank.isOpen()){
  28. bank.open();
  29. return random(500, 700);
  30. }
  31. bank.depositAllExcept(runeHatchet);
  32. if(bank.isOpen()){
  33. bank.close();
  34. return random(500, 700);
  35. }
  36. }else{
  37. if(walking.getDestination() == null || calc.distanceTo(walking.getDestination() < random(4, 6)
  38. walking.walkPathMM(walkingPath);
  39. return random(300, 600);
  40. }
  41. }
  42. }else{
  43. if(treeArea.contains(getMyPlayer().getLocation())){
  44. if(getMyPlayer().getAnimation() != 867){
  45. RSObject tree = objects.getNearest(treeTree);
  46. if(tree != null){
  47. tree.doAction("Chop");
  48. sleep(500, 800);
  49. }
  50. }
  51. }else{
  52. if(walking.getDestination() == null || calc.distanceTo(walking.getDestination() < random(4, 6)
  53. walking.walkPathMM(walking.reversePath(walkingPath));
  54. return random(300, 600);
  55. }
  56. }
  57. }
  58. return random(100, 200);
  59. }
  60.  
  61. public void onFinish(){
  62. log("Script finished");
  63. }
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement