ok button gets now instant klicked, Arena view fixed

This commit is contained in:
mrbesen 2017-04-29 14:21:42 +02:00
parent 101d80ee83
commit 600761ad46
1 changed files with 55 additions and 66 deletions

View File

@ -10,8 +10,6 @@ import java.awt.image.BufferedImage;
public class Clicker implements Runnable{
private int okcountmin = 2;//min count of ok button detections in a row, to trigger a new round.
private boolean running = false;
private boolean should_run = false;
private boolean inbattle = false;
@ -85,21 +83,17 @@ public class Clicker implements Runnable{
float modifier = 1;
long start = System.currentTimeMillis();
long lastwait = start;//actions like moving mouse and do stuff gets messured and subtracted of the wait's
int okcount = 0;
while( ((System.currentTimeMillis() - start) / 6000) < 41 & should_run & !skipbattle) {
//check für ok-button
if(round(start) > 20) {//game is older then 20 seconds
if(checkOK(end, rob)) {//check
okcount ++;//ok button detected
if(okcount >= okcountmin) {
Main.get().ui.info("OK-button detected!");
// System.out.println("OK-Button-detected!");
skipbattle = true;
break;
}
} else
okcount = 0;//reset
}
}
//try to play out a card
@ -123,14 +117,10 @@ public class Clicker implements Runnable{
while (waittime > 1500 & !skipbattle) {//check for the ok-button every 3 seconds
long startwait = System.currentTimeMillis();//record needed time
if(checkOK(end, rob)) {//check
okcount ++;//ok button detected
if(okcount >= okcountmin) {
Main.get().ui.info("OK-button detected!");
skipbattle = true;
break;
}
} else
okcount = 0;//reset
sleep((int) (1500 - (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
}
@ -142,12 +132,11 @@ public class Clicker implements Runnable{
inbattle = false;
clickL(rob, end);//ok button
Main.get().ui.info("Battle ended.");
sleep(12000);//10 sec-loading screen
sleep(9000);//9 sec-loading screen
//checken, ob Arena wechsel pop-up
if(checkOK(arena_switch, rob)) {
while(checkOK(arena_switch, rob)) {
clickL(rob, arena_switch);
sleep(5000);
}
sleep(2000);
}
} catch (AWTException e) {
e.printStackTrace();
@ -300,6 +289,6 @@ public class Clicker implements Runnable{
ps = p.serialize();
out += i + " " + ps + "\n";
}
return out.substring(0, out.length()-1);
return out.substring(0, out.length()-1);//remove last \n
}
}