Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.85 KB | None | 0 0
  1. import org.osbot.rs07.api.map.Area;
  2. import org.osbot.rs07.api.map.Position;
  3. import org.osbot.rs07.api.model.Item;
  4. import org.osbot.rs07.api.model.RS2Object;
  5. import org.osbot.rs07.script.Script;
  6. import org.osbot.rs07.script.ScriptManifest;
  7.  
  8. import java.awt.*;
  9. import java.util.List;
  10.  
  11. @ScriptManifest(author = "You", info = "My first script", name = "walking", version = 0, logo = "")
  12. public class Trial extends Script {
  13. boolean Composted = false;
  14. int Tele = 0;
  15. Area cath = new Area(2811, 3465, 2816, 3461);
  16. Area farm = new Area(3057, 3313, 3060, 3309);
  17. Area ard = new Area(2668, 3376, 2674, 3372);
  18.  
  19. @Override
  20. public void onStart() {
  21. log("Welcome to Simple Tea Thiever by Apaec.");
  22. log("If you experience any issues while running this script please report them to me on the forums.");
  23. log("Enjoy the script, gain some thieving levels!.");
  24. }
  25.  
  26. private enum State {
  27. PLANT, COMPOST, RAKE, CAMMY, FALLY, ARDY, HARVEST
  28. };
  29.  
  30. private State getState() {
  31. RS2Object herbs = getObjects().closest("Herbs");
  32. RS2Object patch = getObjects().closest("Herb patch");
  33. if (herbs != null && herbs.hasAction("Pick"))
  34. return State.HARVEST;
  35. if (patch != null && patch.hasAction("Rake"))
  36. return State.RAKE;
  37. if (patch != null && !patch.hasAction("Rake") && Composted != true)
  38. return State.COMPOST;
  39. if (patch != null && !patch.hasAction("Rake") && Composted == true)
  40. return State.PLANT;
  41. if (patch == null && !myPlayer().isMoving() && Tele == 1)
  42. return State.FALLY;
  43. if (patch == null && !myPlayer().isMoving() && Tele == 2)
  44. return State.CAMMY;
  45. if (patch == null && !myPlayer().isMoving() && Tele == 3);
  46. return State.ARDY;
  47. }
  48.  
  49. @Override
  50. public int onLoop() throws InterruptedException {
  51. switch (getState()) {
  52. case COMPOST:
  53. if(getInventory().isItemSelected()){
  54. RS2Object patch = getObjects().closest("Herb patch");
  55. if(patch != null)
  56. patch.interact("Use");
  57. }else{
  58. getInventory().interact("Use", "Supercompost");
  59. Composted = true;
  60. sleep(random(1300, 2500));
  61. }
  62. break;
  63. case PLANT:
  64. if(getInventory().isItemSelected()){
  65. RS2Object patch = getObjects().closest("Herb patch");
  66. if(patch != null)
  67. patch.interact("Use");
  68. }else{
  69. getInventory().interact("Use", "Guam seed");
  70. Tele ++;
  71. sleep(random(1300, 2000));
  72. }
  73. case HARVEST:
  74. RS2Object herbs = getObjects().closest("Herbs");
  75. if (herbs.hasAction("Pick") & !myPlayer().isAnimating()) {
  76. herbs.interact("Pick");
  77. sleep(3000);
  78. sleep(5000);
  79. }
  80. case RAKE:
  81. RS2Object patch1 = getObjects().closest("Herb patch");
  82. if (patch1.hasAction("Rake") & !myPlayer().isAnimating()) {
  83. patch1.interact("Rake");
  84. sleep(1000);
  85. }
  86. break;
  87. case FALLY:
  88. if (!farm.contains(myPosition()) && Tele == 1) {
  89. Composted = false;
  90. getWalking().webWalk(farm);
  91.  
  92. }
  93. break;
  94. case CAMMY:
  95. if (!farm.contains(myPosition()) && Tele == 2) {
  96. Composted = false;
  97. getWalking().webWalk(cath);
  98. }
  99. break;
  100. case ARDY:
  101. if (!farm.contains(myPosition()) && Tele == 3) {
  102. Composted = false;
  103. getWalking().webWalk(ard);
  104. }
  105. break;
  106. }
  107. return random(200, 300);
  108. }
  109. @Override
  110. public void onExit() {
  111. log("Thanks for running my Tea Thiever!");
  112. }
  113.  
  114. @Override
  115. public void onPaint(Graphics2D g) {
  116.  
  117. }
  118.  
  119. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement