Advertisement
Guest User

code

a guest
Jan 19th, 2017
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.86 KB | None | 0 0
  1. package winterTodt;
  2.  
  3. import org.dreambot.api.methods.Calculations;
  4. import org.dreambot.api.methods.interactive.GameObjects;
  5. import org.dreambot.api.methods.map.Area;
  6. import org.dreambot.api.script.AbstractScript;
  7. import org.dreambot.api.script.ScriptManifest;
  8. import org.dreambot.api.script.Category;
  9. import org.dreambot.api.wrappers.interactive.GameObject;
  10. import org.dreambot.api.wrappers.interactive.Player;
  11.  
  12. @ScriptManifest(author = "themcpker", name = "winterbank", version = 0.1, description = "does the wintertodt skilling boss", category = Category.MONEYMAKING)
  13. public class main extends AbstractScript {
  14.  
  15. Area bankarea = new Area(1638, 3943, 1640, 3945);
  16. Area Entrance = new Area(1628, 3963, 1632, 3957);
  17. Area Bossarea = new Area(1638, 3988, 1641, 3999);
  18. Area Exit = new Area(1632, 3969, 1628, 3975);
  19. Area Spawn = new Area(1634, 3978, 1626, 3985);
  20.  
  21. public Boolean gottaBank = true;
  22.  
  23. GameObject bank;
  24. GameObject gate;
  25. GameObject brazier;
  26. GameObject Burningbrazier;
  27. GameObject roots;
  28.  
  29.  
  30. public enum State{
  31. BANK, GETREADY, PLAY, ERROR
  32. }
  33.  
  34. public State getstate()
  35. {
  36. if (gottaBank)
  37. {
  38. log("State = BANK");
  39. return State.BANK;
  40. }
  41. else if (Spawn.contains(getLocalPlayer()))
  42. {
  43. log("Going to play the mini-game");
  44. return State.PLAY;
  45. }
  46. else if (!gottaBank)
  47. {
  48. return State.GETREADY;
  49. }
  50. return State.GETREADY;
  51. }
  52. public void onStart()
  53. {
  54. log("Script has started without problems");
  55. }
  56.  
  57. public void onStop(){
  58. log("Script has stopped");
  59. }
  60.  
  61. @Override
  62. public int onLoop() {
  63. switch (getstate())
  64. {
  65. case BANK:
  66.  
  67. if(bankarea.contains(getLocalPlayer()))
  68. {
  69. log("Bot is in the bank area and wil bank");
  70. bank = getGameObjects().closest("Bank chest");
  71. bank.interact("bank");
  72. sleep(Calculations.random(500, 2000));
  73. getBank().depositAllItems();
  74. sleep(Calculations.random(500, 2000));
  75. getBank().withdraw("Adamant axe");
  76. sleep(Calculations.random(500, 1000));
  77. getBank().withdraw("Knife");
  78. sleep(Calculations.random(1000, 2000));
  79. getBank().withdraw("Jug of wine", 5);
  80. sleep(Calculations.random(1000, 3000));
  81. getBank().close();
  82. gottaBank = false;
  83. }
  84. else if(!bankarea.contains(getLocalPlayer()))
  85. {
  86. log("Bot will walk to the bank");
  87. getWalking().walk(bankarea.getRandomTile());
  88. sleep(500, 2000);
  89. }
  90. break;
  91.  
  92. case PLAY:
  93. if(!Bossarea.contains(getLocalPlayer()))
  94. {
  95. getWalking().walk(getLocalPlayer());
  96. sleep(2000, 5000);
  97. }
  98. else if(true)
  99. {
  100.  
  101. }
  102.  
  103. break;
  104. case GETREADY:
  105. {
  106. if(!Entrance.contains(getLocalPlayer()))
  107. {
  108. getWalking().walk(Entrance.getRandomTile());
  109.  
  110. }
  111. }
  112. break;
  113. case ERROR:
  114. log("Script has ran into a error");
  115. break;
  116. default:
  117. break;
  118.  
  119. }
  120. return Calculations.random(500, 1000);
  121. }
  122.  
  123. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement