Hi my name is Andrew and I am very new to writing my own scripts. I tried to code my own goblin killer but it is very slow and is just not as effective as id like it to be. I don't have any specific questions right now but here is my code, any suggestions? And also how do i post my code neatly like above?
@Override
public int onLoop() throws InterruptedException {
Player myself = myPlayer();
NPC victim = npcs.closest("Goblin");
if(!myself.isUnderAttack()){
if(victim != null){
if(victim.isAttackable()){
victim.interact("Attack");
sleep(random(2000, 3000));
}
}
}
// TODO Auto-generated method stub
return 50;
}