- Thread Author
- #1
I'm trying to use air runes on an altar but the bot clicks on the air runes and doesn't use them on the altar.
Code:
import com.runemate.game.api.hybrid.entities.GameObject;
import com.runemate.game.api.hybrid.local.hud.interfaces.SpriteItem;
public class Test extends LoopingBot {
GameObject altar;
SpriteItem air_rune;
public static boolean used = false;
@Override
public void onStart(String... args){
setLoopDelay(400,800);
}
@Override
public void onLoop(){
air_rune = Inventory.newQuery().names("Air rune").results().first();
altar = GameObjects.newQuery().names("Altar").results().nearest();
if(air_rune!=null && used == false){
air_rune.interact("Use");
used = true;
} else if(altar!=null){
air_rune.interact("Use", air_rune.getDefinition().getName() + " -> " + altar);
used = false;
}
}
}