Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- case SHOP:
- log("State Shop");
- if(hopTimer == null)
- hopTimer = new Timer();
- shop();
- if(hopTimer.duration().getSeconds() > random(13,17))
- hopTimer = null;
- break;
- public void shop() throws InterruptedException{
- if(npcs.closest("Magic Store owner") == null){
- if(!settings.isRunning())
- settings.setRunning(true);
- walking.webWalk(shopArea);
- humanSleep();
- }
- if(inventory.getAmount("Coins") < 8000){
- return;
- }
- if(myPlayer().isUnderAttack()){
- return;
- }
- if(!getStore().isOpen()) {
- npcs.closest("Magic Store owner").interact("Trade");
- sleep(random(3000,5000));
- new ConditionalSleep(8000) {
- @Override
- public boolean condition() throws InterruptedException {
- return myPlayer().isUnderAttack() || getStore().isOpen();
- }
- }.sleep();
- }
- humanSleep();
- if(getStore().getAmount("Battlestaff") > 0){
- buyItem("Battlestaff", 5);
- }else if(getStore().getAmount("Death rune") > 0){
- buyItem("Death rune", 10);
- }else if(getStore().getAmount("Nature rune") > 0){
- buyItem("Nature rune", 10);
- }else{
- store.close();
- while(hopTimer.duration().getSeconds() < 15)
- sleep(random(1000,1500));
- log("Hopping worlds " + hopTimer.duration().getSeconds());
- hopWorld();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement