@Viston well the problem is that im not actually getting hit, its the wizards tower lesser demon on f2p. I've gotten this issue sorted but i can't get it to stop attacking, its on a constant loop of attacking, then moving mouse outside the screen, then coming back in and attacking again. any ideas?
code
is there something i could do with the return, like somehow make it return if my player has stopped animating?
or could it be on the if part, if i could make it say if lesserdemon is not under attack then to interact and attack? im just not exactly sure how to code this part in.
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;
import org.osbot.rs07.api.model.NPC;
import org.osbot.rs07.utility.ConditionalSleep;
@ScriptManifest(author = "08egans", info = "Kills ", logo = "", name = "", version = 0)
public class main extends Script {
public void onStart(){
log("Welcome to my script!");
}
public void onExit(){
log("Thank you for using my script, goodbye!");
}
public int onLoop() throws InterruptedException{
NPC lesserdemon = getNpcs().closest("Lesser demon");
if(lesserdemon !=null && !myPlayer().isAnimating()){
lesserdemon.interact("Attack");
}
if(myPlayer().isAnimating()){
mouse.moveOutsideScreen();
}
return 500;
}
}
thank you