Advertisement
Guest User

Untitled

a guest
Oct 27th, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. case SHOP:
  2. log("State Shop");
  3. if(hopTimer == null)
  4. hopTimer = new Timer();
  5. shop();
  6. if(hopTimer.duration().getSeconds() > random(13,17))
  7. hopTimer = null;
  8. break;
  9.  
  10.  
  11.  
  12. public void shop() throws InterruptedException{
  13.  
  14. if(npcs.closest("Magic Store owner") == null){
  15. if(!settings.isRunning())
  16. settings.setRunning(true);
  17. walking.webWalk(shopArea);
  18. humanSleep();
  19. }
  20.  
  21. if(inventory.getAmount("Coins") < 8000){
  22. return;
  23. }
  24.  
  25. if(myPlayer().isUnderAttack()){
  26. return;
  27. }
  28.  
  29.  
  30.  
  31. if(!getStore().isOpen()) {
  32. npcs.closest("Magic Store owner").interact("Trade");
  33. sleep(random(3000,5000));
  34. new ConditionalSleep(8000) {
  35. @Override
  36. public boolean condition() throws InterruptedException {
  37. return myPlayer().isUnderAttack() || getStore().isOpen();
  38. }
  39. }.sleep();
  40. }
  41. humanSleep();
  42.  
  43. if(getStore().getAmount("Battlestaff") > 0){
  44. buyItem("Battlestaff", 5);
  45. }else if(getStore().getAmount("Death rune") > 0){
  46. buyItem("Death rune", 10);
  47. }else if(getStore().getAmount("Nature rune") > 0){
  48. buyItem("Nature rune", 10);
  49. }else{
  50. store.close();
  51. while(hopTimer.duration().getSeconds() < 15)
  52. sleep(random(1000,1500));
  53. log("Hopping worlds " + hopTimer.duration().getSeconds());
  54. hopWorld();
  55. }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement