Welcome!

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

Sign up now!

Chicken killer botting help

Joined
Nov 3, 2018
Messages
1
Hey guys,

I'm trying to use the RM api so i can bot different things and get comfrotable with it. First i tried a simple goblin killer to see how far i can get and i'm having some issues atm.

Can anyone help please (promise i'll release a few free scripts ! :D and i've left my current script below).

1-
it keeps spam clicking after it attacks a chicken, even though i have an execution.delay which makes it wait 25 seconds or until the player isnt animating.

2-
is there a way to check NPC animation IDs / players in game.
Other bot clients have a debug log available which gives info in real time but i cant find it in RM. The developermode has a script but say for example i'm looking for "one" chicken thats near me, i cant do that. The mode returns a list of all chickens so i cant identify from the list, which is which

3-
is there a way to set a random delay time during actions or is that "setLoopDelay". This is to add some anti pattern.

4-
I can't get coordinates to work (nor can i find them within the game) otherwise i would set it as a condition to check if i should attack a goblin thats within a set coordinate


'''Java
import com.runemate.game.api.hybrid.entities.Npc;
import com.runemate.game.api.hybrid.location.Area;
import com.runemate.game.api.hybrid.region.Npcs;
import com.runemate.game.api.hybrid.region.Players;
import com.runemate.game.api.script bot.Execution;
import com.runemate.game.api.script bot.framework.LoopingBot;

public class script bot extends LoopingBot {


@Override
public void onLoop() {
Area farm;
//farm = Area.rectangular((new Area(100,500)) , new Area(100,200));

Npc goblin = Npcs.newQuery().names("Goblin").actions("Attack").results().nearest();
if (Players.getLocal().getAnimationId() == -1){
if (goblin != null && goblin.getAnimationId() ==-1 ){
if(goblin.interact("Attack")){
getLogger().debug("We are killing a Goblin!");
Execution.delayUntil(()-> Players.getLocal().getAnimationId() ==-1 , 250000);
setLoopDelay(1000,2000);

}

}

}setLoopDelay(1000,4000);
//if (Players.getLocal().getAnimationId() > 0){

//setLoopDelay(500,2000);

}





}
'''

Thanks!
 
I've been called a god before.
Joined
Aug 5, 2014
Messages
3,212
1. When you’re attacking, an animation is tops 2s. So when you have a loop delay of a few ms there is a big chance it’ll hop when animation is -1 and spam click it.

To avoid this do a check if your target is either dead(dying) or does not exist.

2. Check Visual Developer on the bot store.
You can using the Random class from runemate.

4. Coordinates work the same as on other clients.

No idea which bots are used for debugging nowadays but i used to have my own which sadly is lost.
 
Top