Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!

Question Script just idles after worldHop.

Joined
Aug 7, 2015
Messages
28
So i have this little mining script which supposed to hop worlds if there is no rocks available. At the start everything is ok it mines all rocks and when there is no rocks left it hops world. And here the problem starts. It doesnt do anything, the script is still runing but account just idle. Its a LoopingBot so its supposed to start from begining again right?
Code:
public void onLoop() {
if (!Inventory.isFull() && isInMine()) { // Mining
                if (ore != null && isIdle() && ore.isVisible()) {
                    if (ore.interact("Mine"))
                        Execution.delayUntil(() -> player.getAnimationId() != -1, 3000, 6000);
                } else if (ore != null && !ore.isVisible()) {
                    Camera.concurrentlyTurnTo(ore);
                } else if (isIdle()) {
                    Random random = new Random();
                    WorldHop.hopTo(worlds[random.nextInt(worlds.length)]);

                }
            }
}
 
Go check out new bots and give helpful feedback.
Joined
Jan 31, 2016
Messages
5,413
So i have this little mining script which supposed to hop worlds if there is no rocks available. At the start everything is ok it mines all rocks and when there is no rocks left it hops world. And here the problem starts. It doesnt do anything, the script is still runing but account just idle. Its a LoopingBot so its supposed to start from begining again right?
Code:
public void onLoop() {
if (!Inventory.isFull() && isInMine()) { // Mining
                if (ore != null && isIdle() && ore.isVisible()) {
                    if (ore.interact("Mine"))
                        Execution.delayUntil(() -> player.getAnimationId() != -1, 3000, 6000);
                } else if (ore != null && !ore.isVisible()) {
                    Camera.concurrentlyTurnTo(ore);
                } else if (isIdle()) {
                    Random random = new Random();
                    WorldHop.hopTo(worlds[random.nextInt(worlds.length)]);

                }
            }
}
Can you send what isIdle() looks like?
 
Joined
Oct 1, 2017
Messages
13
So i have this little mining script which supposed to hop worlds if there is no rocks available. At the start everything is ok it mines all rocks and when there is no rocks left it hops world. And here the problem starts. It doesnt do anything, the script is still runing but account just idle. Its a LoopingBot so its supposed to start from begining again right?
Code:
public void onLoop() {
if (!Inventory.isFull() && isInMine()) { // Mining
                if (ore != null && isIdle() && ore.isVisible()) {
                    if (ore.interact("Mine"))
                        Execution.delayUntil(() -> player.getAnimationId() != -1, 3000, 6000);
                } else if (ore != null && !ore.isVisible()) {
                    Camera.concurrentlyTurnTo(ore);
                } else if (isIdle()) {
                    Random random = new Random();
                    WorldHop.hopTo(worlds[random.nextInt(worlds.length)]);

                }
            }
}

Also, not to nitpick but you can use a filter for your worlds.

This is how I hop worlds.
Code:
WorldHop.hopToRandom(w -> !w.isPVP() && !w.isBounty() && !w.isDeadman() && !w.isHighRisk()
                    && !w.isTournament() && !blackList.contains(w.getId()));

blackList is just an ArrayList of King of the Skill worlds cause RM doesn't support w.isKoTS yet lol
 
Joined
Aug 7, 2015
Messages
28
Also, not to nitpick but you can use a filter for your worlds.

This is how I hop worlds.
Code:
WorldHop.hopToRandom(w -> !w.isPVP() && !w.isBounty() && !w.isDeadman() && !w.isHighRisk()
                    && !w.isTournament() && !blackList.contains(w.getId()));

blackList is just an ArrayList of King of the Skill worlds cause RM doesn't support w.isKoTS yet lol
Thanks for help but i like my aproach.
 
Joined
Dec 20, 2016
Messages
37
If this is your only method, then how are you obtaining the values `ore`.

The problem may lie within the structure of your code, here are some improvements that I can think of:

Note: This has not been tested, so may not work 100%, but some things I did was adding the line
Code:
GameObject ore = GameObjects.newQuery().names("Iron").results().nearest();
You want to keep this line of code next to the null check if statement. This will make sure you are always detecting the rock.
Code:
if (!isIdle()) {
    if(Inventory.isFull()) {
        dropInventory();
    } else {
        if (isInMine()) {
            GameObject ore = GameObjects.newQuery().names("Iron").results().nearest();
            if (ore != null) {
                if (!ore.isVisible()) {
                    if (Camera.turnTo(ore)) {
                        Execution.delayUntil(() -> ore.isVisible(), 2000,4000);
                    }
                }
                if (ore.interact("Mine")) {
                    Execution.delayUntil(() -> Players.getLocal().getAnimationId() != -1, 1200,3600);
                }
            }
        }
    }
} else if (isIdle()) {
    Random random = new Random();
    WorldHop.hopTo(worlds[random.nextInt(worlds.length)]);
}
 
Last edited:
Joined
Aug 7, 2015
Messages
28
So aftew awesome123man suggestion i manged to find out that after world hop player somehow isnotWithin area. Player !=null, area !=null. This is how i check if i am within area:
Code:
private static boolean isInMine() {
        return mineArea.contains(player);
  }
 
Joined
Oct 1, 2017
Messages
13
The problem that bot after hop dont understand that he is inmineArea and it messes up my other things like walking to bank and so on. If it would be powerminer when everything would be ok

So begin your mine loop with
Code:
if (!inMineArea()) {
            goToMine();
}

// continue mine loop
GameObject rocks = ...
 
Top