Update HandleLogin.java

This commit is contained in:
Danial
2021-10-07 12:37:46 +13:00
parent b1ade815ca
commit 86a7808958
@@ -31,37 +31,38 @@ public class HandleLogin implements Strategy {
} }
if (!Game.isLoggedIn()) { if (!Game.isLoggedIn()) {
if(Variables.getAccountPassword() != null && Variables.getAccountUsername() != null) { if(Variables.getAccountPassword() != null && Variables.getAccountUsername() != null) {
if(!typed) { Game.login(Variables.getAccountUsername(), Variables.getAccountPassword());
Mouse.getInstance().click(point); // if(!typed) {
Time.sleep(1000); // Mouse.getInstance().click(point);
clearInput(); // Time.sleep(1000);
Keyboard.getInstance().sendKeys(Variables.getAccountUsername()); // clearInput();
Time.sleep(2000); // Keyboard.getInstance().sendKeys(Variables.getAccountUsername());
// Time.sleep(2000);
clearInput(); // clearInput();
// Checking again so people don't type their passwords ingame. // // Checking again so people don't type their passwords ingame.
if(!Game.isLoggedIn()) { // if(!Game.isLoggedIn()) {
Keyboard.getInstance().sendKeys(Variables.getAccountPassword()); // Keyboard.getInstance().sendKeys(Variables.getAccountPassword());
// }
// typed = true;
// }
} }
typed = true; // if(typed) {
} // Time.sleep(new SleepCondition() {
} // @Override
// public boolean isValid() {
if(typed) { // return Game.isLoggedIn();
Time.sleep(new SleepCondition() { // }
@Override // }, 5000);
public boolean isValid() { // Mouse.getInstance().click(point);
return Game.isLoggedIn(); // Time.sleep(1000);
} // Keyboard.getInstance().clickKey(KeyEvent.VK_ENTER);
}, 5000); // Time.sleep(1000);
Mouse.getInstance().click(point); // Keyboard.getInstance().clickKey(KeyEvent.VK_ENTER);
Time.sleep(1000); // Variables.setStatus("none");
Keyboard.getInstance().clickKey(KeyEvent.VK_ENTER); // }
Time.sleep(1000);
Keyboard.getInstance().clickKey(KeyEvent.VK_ENTER);
Variables.setStatus("none");
}
} }
} }