syberium
2008-12-01 18:47:33
Hey, I'm learning java but i cant understand why this failsafe does not work.
now i'm guessing the for (int = 0; i < 5; i++) means that it loops while i < 5? and the i++ means increment I by one each time it loops? so it should once it has done this loop 5 times correct? The problem is this loop repeats thousands of times, and I have no idea why. Any help would appreciated.
Thanks.
-Syberium
public boolean login() {
if (isLoggedIn()) {
return true;
}
if (!isLoginScreen()) {
return false;
}
for (int i = 0; i < 5; i++) {
if (getLoginIndex() == 10) {
//clickMouse(300, 165, 146, 14, true);
input.sendKeys("", true);
wait(random(50, 200));
Account account = getAccount();
input.sendKeys(account.getUsername(), true);
wait(random(100, 400));
input.sendKeys(account.getPassword(), true);
//clickMouse(300, 360, 146, 14, true);
}
if (getLoginIndex() == 30) {
break;
}
wait(random(500, 1000));
}
return getLoginIndex() == 30;
}
now i'm guessing the for (int = 0; i < 5; i++) means that it loops while i < 5? and the i++ means increment I by one each time it loops? so it should once it has done this loop 5 times correct? The problem is this loop repeats thousands of times, and I have no idea why. Any help would appreciated.
Thanks.
-Syberium