In my firemaking script I'm working on I want that if it accidentally wants to light fires at a tile where already is a fire to move a coord.
This is what I've tried:
RS2Object fire = objects.closest("Fire");
if(fire.getY() == myPlayer().getY()) {
mouse.click(myPlayer().getX(), myPlayer().getY() + 1, true);
log("help");
}
(Placed the log "help" there to debug and yes it does spam help in the console.)
This doesn't work, I've also tried with the MessageListener like this:
if (txt.contains("light a fire here")) {
mouse.click(myPlayer().getX(), myPlayer().getY() + 1, true);
sleep(random(150, 250));
}
But none of it works, so I'm wondering is it broken in the API or is there another better way to do this? Cause I really need it.
Thanks,
Rudie.