changed the way of should_work; Added reset, when the button is not
detected; Added Info, when the button is detected.
This commit is contained in:
parent
7161ce8420
commit
42b2ad5a4b
|
@ -76,8 +76,6 @@ public class Clicker implements Runnable{
|
||||||
sleep(500);
|
sleep(500);
|
||||||
clickL(rob, battle);//smash the start button
|
clickL(rob, battle);//smash the start button
|
||||||
sleep(1000);
|
sleep(1000);
|
||||||
if(!should_run)
|
|
||||||
break;
|
|
||||||
clickL(rob, battle);//press start again (if there is an alert poping up)
|
clickL(rob, battle);//press start again (if there is an alert poping up)
|
||||||
//battle is starting up
|
//battle is starting up
|
||||||
sleep(9000);//wait for the battle to start (loading screen)
|
sleep(9000);//wait for the battle to start (loading screen)
|
||||||
|
@ -93,8 +91,13 @@ public class Clicker implements Runnable{
|
||||||
if(((System.currentTimeMillis() - start) / 1000) > 20) {//game is older then 20 seconds
|
if(((System.currentTimeMillis() - start) / 1000) > 20) {//game is older then 20 seconds
|
||||||
if(checkOK(end, rob))
|
if(checkOK(end, rob))
|
||||||
okcount ++;
|
okcount ++;
|
||||||
if(okcount > 5)
|
else
|
||||||
|
okcount = 0;//reste the counter
|
||||||
|
if(okcount > 5) {
|
||||||
|
Main.get().ui.info("OK-button detected!");
|
||||||
|
System.out.println("OK-Button-detected!");
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//try to play out a card
|
//try to play out a card
|
||||||
|
@ -116,6 +119,8 @@ public class Clicker implements Runnable{
|
||||||
long startwait = System.currentTimeMillis();//record needed time
|
long startwait = System.currentTimeMillis();//record needed time
|
||||||
if(checkOK(end, rob))//check
|
if(checkOK(end, rob))//check
|
||||||
okcount ++;//ok button detected
|
okcount ++;//ok button detected
|
||||||
|
else
|
||||||
|
okcount = 0;//reset
|
||||||
sleep((int) (3000 - (System.currentTimeMillis() - startwait)));//sleep the rest of 3 seconds, that was not gone for checking
|
sleep((int) (3000 - (System.currentTimeMillis() - startwait)));//sleep the rest of 3 seconds, that was not gone for checking
|
||||||
waittime = (int) (waittime - (System.currentTimeMillis() - startwait));//calculate waittime that is left
|
waittime = (int) (waittime - (System.currentTimeMillis() - startwait));//calculate waittime that is left
|
||||||
}
|
}
|
||||||
|
@ -125,14 +130,9 @@ public class Clicker implements Runnable{
|
||||||
}
|
}
|
||||||
skipbattle = false;
|
skipbattle = false;
|
||||||
inbattle = false;
|
inbattle = false;
|
||||||
|
clickL(rob, end);//ok button
|
||||||
Main.get().ui.info("Battle ended.");
|
Main.get().ui.info("Battle ended.");
|
||||||
|
sleep(10000);//10 sec-loading screen
|
||||||
if(!should_run)
|
|
||||||
break;
|
|
||||||
clickL(rob, end);//ok knopf
|
|
||||||
if(!should_run)
|
|
||||||
break;
|
|
||||||
sleep(10000);//10 sec-lade screen
|
|
||||||
}
|
}
|
||||||
} catch (AWTException e) {
|
} catch (AWTException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
@ -209,6 +209,8 @@ public class Clicker implements Runnable{
|
||||||
}
|
}
|
||||||
|
|
||||||
private void clickL(Robot b, Point a) {
|
private void clickL(Robot b, Point a) {
|
||||||
|
if(!should_run)
|
||||||
|
return;
|
||||||
Point old = getMouse();
|
Point old = getMouse();
|
||||||
b.mouseMove(a.x, a.y);
|
b.mouseMove(a.x, a.y);
|
||||||
sleep(50);
|
sleep(50);
|
||||||
|
|
Loading…
Reference in New Issue