[AI] count ticks up instead of down.

This commit is contained in:
RedSparr0w 2019-09-26 19:09:21 +12:00
parent 68707e4047
commit 941aa9c93f
2 changed files with 19 additions and 17 deletions

View file

@ -9,29 +9,29 @@ public class LowestBot extends PvMBots{
super(name, l);
// TODO Auto-generated constructor stub
}
private int tick = 0;
@Override
public void tick(){
super.tick();
this.tick++;
//Despawn
if (this.getSkills().getLifepoints() == 0)
//this.teleport(new Location(500, 500));
//Despawning not being delayed causes 3 errors in the console
AIPlayer.deregister(this.getUid());
//Npc Combat
if (tick == 0)
{
if (this.tick % 10 == 0) {
if (!this.inCombat())
AttackNpcsInRadius(this, 5);
this.tick = 10;
}
else
this.tick--;
if (this.tick == 100) this.tick = 0;
this.eat(329);
//this.getPrayer().toggle()
}

View file

@ -90,7 +90,9 @@ public class PvMBots extends AIPlayer {
@Override
public void tick() {
super.tick();
super.tick();
this.tick++;
//Despawn
if (this.getSkills().getLifepoints() == 0)
@ -99,12 +101,12 @@ public class PvMBots extends AIPlayer {
AIPlayer.deregister(this.getUid());
//Npc Combat
if (tick == 0) {
if (!this.inCombat())
AttackNpcsInRadius(this, 5);
this.tick = 10;
} else
this.tick--;
if (this.tick % 10 == 0) {
if (!this.inCombat())
AttackNpcsInRadius(this, 5);
}
if (this.tick == 100) this.tick = 0;
//this.eat();
//this.getPrayer().toggle()