- Thread Author
- #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 ! 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 classscript 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'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 ! 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.
import com.runemate.game.api.
public class
@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!