Advertisement
Guest User

Untitled

a guest
Jul 25th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.44 KB | None | 0 0
  1. package main;
  2.  
  3. import org.dreambot.api.input.event.impl.InteractionEvent;
  4. import org.dreambot.api.methods.Calculations;
  5. import org.dreambot.api.methods.map.Area;
  6. import org.dreambot.api.methods.skills.Skill;
  7. import org.dreambot.api.script.AbstractScript;
  8. import org.dreambot.api.script.Category;
  9. import org.dreambot.api.script.ScriptManifest;
  10. import org.dreambot.api.utilities.Timer;
  11. import org.dreambot.api.wrappers.interactive.GameObject;
  12. import org.dreambot.api.wrappers.interactive.NPC;
  13. import sun.rmi.runtime.Log;
  14.  
  15. import java.awt.*;
  16.  
  17. @ScriptManifest(
  18. author = "Dagwood",
  19. name = "Thieving3",
  20. version = 1.0D,
  21. category = Category.THIEVING,
  22. description = "Thieves for you."
  23. )
  24.  
  25. public class main extends AbstractScript {
  26. private Timer timeRan;
  27.  
  28. Area stalls = new Area(3269, 3412, 3268, 3412);
  29. Area lumbridge = new Area(3217, 3226, 3225, 3213);
  30. Area lever = new Area(3090, 3475, 3092, 3474);
  31. Area deathsq = new Area(3153, 3925, 3156, 3922);
  32. Area Ardy = new Area(2678, 3328, 3559, 3277 );
  33. Area ardylever = new Area(2561, 3312, 3562, 3310);
  34. //Area Ardy_Square = new Area(2650, 3318, 2673, 3294);
  35. Area CakeStall = new Area(2662, 3309, 2672, 3313);
  36. Area safespot = new Area(2673, 3321, 2674, 3312);
  37. Area attack = new Area(2667, 3313, 2669, 3312);
  38. Area Silk = new Area(2662, 3317, 2664, 3316);
  39. Area safespot2 = new Area(2652, 3320, 2650, 3316);
  40. private boolean DoneTea = false;
  41.  
  42. private enum State {
  43. Pickman, Stall, Gettoardy, CakeStall, Silk
  44. }
  45.  
  46. private State getState() {
  47. if (CakeStall.contains(getLocalPlayer())){
  48. return State.CakeStall;
  49. }
  50. if (getSkills().getRealLevel(Skill.THIEVING) >= 15 && !CakeStall.contains(getLocalPlayer())
  51. && !safespot.contains(getLocalPlayer()) && !getLocalPlayer().isMoving()){
  52. log("lvl 15+");
  53. return State.Gettoardy;
  54. } else {
  55. if (getSkills().getRealLevel(Skill.THIEVING) >= 5 && getSkills().getRealLevel(Skill.THIEVING) < 15 && !stalls.contains(getLocalPlayer())) {
  56. log("lvl 5+");
  57. return State.Stall;
  58. } else if (lumbridge.contains(getLocalPlayer())) {
  59. log("nuub");
  60. return State.Pickman;
  61. }
  62. return null;
  63. }
  64. }
  65.  
  66.  
  67.  
  68.  
  69. @Override
  70. public void onStart() {
  71. timeRan = new Timer();
  72. super.onStart();
  73. }
  74.  
  75. @Override
  76. public int onLoop() {
  77.  
  78.  
  79. switch (getState()) {
  80.  
  81. case Pickman:
  82. Pickpocketman();
  83. break;
  84. case Stall:
  85. Theestall();
  86. break;
  87. case Gettoardy:
  88. Getardy();
  89. break;
  90. case CakeStall:
  91. CakeStall();
  92. break;
  93. case Silk:
  94. silk();
  95. break;
  96.  
  97. }
  98. return 0;
  99. }
  100.  
  101. private void Pickpocketman() {
  102. NPC npcman = getNpcs().closest("Man");
  103. if (!getLocalPlayer().isHealthBarVisible()) {
  104. if (lumbridge.contains(npcman)) {
  105. npcman.interact("Pickpocket");
  106. sleep(Calculations.random(612, 846));
  107. if (!getLocalPlayer().isHealthBarVisible()) {
  108. sleepUntil(() -> getLocalPlayer().isAnimating(), Calculations.random(5000, 8000));
  109. sleepUntil(() -> !getLocalPlayer().isAnimating(), Calculations.random(5000, 8000));
  110. }
  111. } else {
  112. if (!lumbridge.contains(npcman)) {
  113. sleep(Calculations.random(153, 198));
  114. }
  115. }
  116. }
  117. }
  118.  
  119. private void Theestall() {
  120. if (!stalls.contains(getLocalPlayer())) {
  121. getWalking().walk(stalls.getRandomTile());
  122. } else {
  123. if (stalls.contains(getLocalPlayer())) {
  124. if (getInventory().contains("Cup of tea")) {
  125. getInventory().dropAll("Cup of tea");
  126. sleep(Calculations.random(315, 800));
  127. } else { GameObject tea = getGameObjects().closest("Tea stall");
  128. if (tea != null) {
  129. tea.interact("Steal-from");
  130. sleepUntil(() -> getLocalPlayer().isAnimating(), Calculations.random(5000, 8000));
  131. sleepUntil(() -> !getLocalPlayer().isAnimating(), Calculations.random(5000, 8000));
  132. }
  133. }
  134. }
  135. }
  136. }
  137.  
  138. private void Getardy() {
  139. if (lever.contains(getLocalPlayer())) {
  140. log("6");
  141. GameObject lever = getGameObjects().closest("Lever");
  142. lever.interact("Pull");
  143. sleepUntil(() -> getDialogues().canContinue(), Calculations.random(6000, 9000));
  144. if (getDialogues().canContinue()) {
  145. log("7");
  146. getDialogues().spaceToContinue();
  147. sleep(Calculations.random(1000, 1200));
  148. getDialogues().chooseOption(3);
  149. sleepUntil(() -> deathsq.contains(getLocalPlayer()), Calculations.random(8000, 12000));
  150. if (deathsq.contains(getLocalPlayer())) {
  151. log("8");
  152. lever.interact("Pull");
  153. }
  154. }
  155. } else {
  156. log("9");
  157. if (deathsq.contains(getLocalPlayer())) {
  158. log("10");
  159. GameObject lever = getGameObjects().closest("Lever");
  160. lever.interact("Pull");
  161. sleep(8000);
  162. }
  163. log("11");
  164. getWalking().walk(CakeStall.getRandomTile());
  165. }
  166. }
  167.  
  168. private void CakeStall() {
  169.  
  170. if (getSkills().getBoostedLevels(Skill.HITPOINTS) <= 30){
  171. log("1");
  172. if (getInventory().contains("Bread")) {
  173. getInventory().interact("Bread", "Eat");
  174. } else if (getInventory().contains("Cake")) {
  175. getInventory().interact("Cake", "Eat");
  176. } else if (getInventory().contains("Chocolate slice")) {
  177. getInventory().interact("Chocolate slice", "Eat");
  178. } else if (getInventory().contains("Chocolate bar")) {
  179. getInventory().interact("Chocolate bar", "Eat");
  180. }
  181. }
  182. log("2");
  183. if (CakeStall.contains(getLocalPlayer())) {
  184. if (getLocalPlayer().isHealthBarVisible() || getLocalPlayer().isInCombat()){
  185. log("3");
  186. getWalking().walk(safespot.getRandomTile());
  187. sleepUntil(() -> getLocalPlayer().isMoving(), Calculations.random(2500, 3000));
  188. sleepUntil(() -> !getLocalPlayer().isMoving(), Calculations.random(2500, 3000));
  189. getWalking().walk(attack.getRandomTile());
  190. }
  191. log("save");
  192. GameObject Bakers_stall = getGameObjects().closest("Baker's stall");
  193. if (Bakers_stall != null) {
  194. log("4");
  195. Bakers_stall.interact("Steal-from");
  196. sleepUntil(() -> getLocalPlayer().isAnimating(), Calculations.random(319, 756));
  197. sleepUntil(() -> !getLocalPlayer().isAnimating(), Calculations.random(319, 756));
  198. if (getInventory().contains("Cake")) {
  199. getInventory().dropAll("Cake");
  200. } else if (getInventory().count("Chocolate slice") > 1) {
  201. getInventory().drop("Chocolate slice");
  202. } else if (getInventory().contains("Bread")) {
  203. getInventory().drop("Bread");
  204. } else if (getInventory().contains("Chocolate bar")) {
  205. getInventory().drop("Chocolate bar");
  206. }
  207. } else {
  208. log("5");
  209. log("hu");
  210. sleep(Calculations.random(312, 828));
  211. }
  212. }
  213. }
  214.  
  215. private void silk() {
  216. if (getSkills().getBoostedLevels(Skill.HITPOINTS) <= 30){
  217. log("12");
  218. if (getInventory().contains("Silk")){
  219. getInventory().dropAll("Silk");
  220. if (Silk.contains(getLocalPlayer())) {
  221. if (getLocalPlayer().isHealthBarVisible() || getLocalPlayer().isInCombat()) {
  222. log("13");
  223. getWalking().walk(safespot2.getRandomTile());
  224. sleepUntil(() -> getLocalPlayer().isMoving(), Calculations.random(2500, 3000));
  225. sleepUntil(() -> !getLocalPlayer().isMoving(), Calculations.random(2500, 3000));
  226. getWalking().walk(Silk.getRandomTile());
  227. }
  228. GameObject silk_stall = getGameObjects().closest("Silk stall");
  229. if (silk_stall != null) {
  230. silk_stall.interact("Steal-from");
  231.  
  232.  
  233. }
  234.  
  235.  
  236. }
  237. }
  238. }
  239.  
  240. }
  241.  
  242.  
  243.  
  244. public void onPaint(Graphics g) {
  245. g.drawString("Time ran: " + timeRan.formatTime(), 15, 260);
  246. }
  247.  
  248.  
  249. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement