rendered paste body public boolean isPlayerIdleb() throws InterruptedException
{
int[] Frames = new int[4];
Timer timeTook = new Timer(0);
b5.theMovingDualFrame.setArea(new Rectangle(250,145,40,40));
b5.theMovingDualFrame.grabFrame();
sleep(25);
Frames[0] = b5.theMovingDualFrame.countDifferences();
sleep(50);
Frames[1] = b5.theMovingDualFrame.countDifferences();
Frames[2] = (Frames[0] + Frames[1]) / 2;
debug("isPlayerIdle() took "+timeTook.timePassed()+" ms");
debug("Frame 1: "+Frames[0]);
debug("Frame 2: "+Frames[1]);
debug("Frame Average: "+Frames[2]);
return Frames[2] < 100;
}