0
0
mirror of https://github.com/Wurst-Imperium/Wurst7.git synced 2024-09-20 01:12:13 +02:00
This commit is contained in:
Alexander01998 2024-04-17 14:03:14 +02:00
parent 40a4924e2c
commit 0b7dde2e0e

View File

@ -93,13 +93,10 @@ public final class AntiAfkHack extends Hack
private void setTimer() private void setTimer()
{ {
if(movetime.getValueI() == 0) if(movetime.getValueI() == 0)
{
timer = 40 + random.nextInt(21); timer = 40 + random.nextInt(21);
}else else
{
timer = movetime.getValueI(); timer = movetime.getValueI();
} }
}
@Override @Override
public void onUpdate() public void onUpdate()
@ -128,10 +125,14 @@ public final class AntiAfkHack extends Hack
if(!pathFinder.isDone() && !pathFinder.isFailed()) if(!pathFinder.isDone() && !pathFinder.isFailed())
{ {
PathProcessor.lockControls(); PathProcessor.lockControls();
pathFinder.think(); pathFinder.think();
if(!pathFinder.isDone() && !pathFinder.isFailed()) if(!pathFinder.isDone() && !pathFinder.isFailed())
return; return;
pathFinder.formatPath(); pathFinder.formatPath();
// set processor // set processor
processor = pathFinder.getProcessor(); processor = pathFinder.getProcessor();
} }
@ -146,18 +147,16 @@ public final class AntiAfkHack extends Hack
// process path // process path
if(!processor.isDone()) if(!processor.isDone())
{
processor.process(); processor.process();
}else else
{
pathFinder = new RandomPathFinder(start); pathFinder = new RandomPathFinder(start);
// wait 2 - 3 seconds (40 - 60 ticks) // wait 2 - 3 seconds (40 - 60 ticks)
if(processor.isDone()) if(processor.isDone())
{ {
PathProcessor.releaseControls(); PathProcessor.releaseControls();
setTimer(); setTimer();
} }
}
}else }else
{ {
// set next block // set next block