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) { // if(typed) {
Time.sleep(new SleepCondition() { // Time.sleep(new SleepCondition() {
@Override // @Override
public boolean isValid() { // public boolean isValid() {
return Game.isLoggedIn(); // return Game.isLoggedIn();
} // }
}, 5000); // }, 5000);
Mouse.getInstance().click(point); // Mouse.getInstance().click(point);
Time.sleep(1000); // Time.sleep(1000);
Keyboard.getInstance().clickKey(KeyEvent.VK_ENTER); // Keyboard.getInstance().clickKey(KeyEvent.VK_ENTER);
Time.sleep(1000); // Time.sleep(1000);
Keyboard.getInstance().clickKey(KeyEvent.VK_ENTER); // Keyboard.getInstance().clickKey(KeyEvent.VK_ENTER);
Variables.setStatus("none"); // Variables.setStatus("none");
} // }
} }
} }