Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Map;
- import org.rsbot.bot.Bot;
- import org.rsbot.gui.AccountManager;
- import org.rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.wrappers.RSInterface;
- import org.rsbot.script.wrappers.RSInterfaceChild;
- import org.rsbot.script.wrappers.RSInterfaceComponent;
- @ScriptManifest(authors = { "ProCrus" },
- category = "Login",
- name = "ProLogin",
- version = 1.0,
- description = "" +
- "
- " +
- "ProLogin" +
- "
- " +
- "by ProCrus" +
- "
- " +
- "Uses Username and Password from Account Manager." +
- "
- ")
- public class ProLogin extends Script
- {
- private String userName;
- private String passWord;
- private RSInterfaceChild memberLogin = getInterface(905, 38);//Make 38 59 for F2P
- private RSInterfaceComponent clickMem = memberLogin.getComponents()[4];
- private RSInterface enterUsernamePass = getInterface(596);
- private RSInterfaceChild userNameEnter = getInterface(596, 71);
- private RSInterfaceChild passWordEnter = getInterface(596, 91);
- private RSInterfaceChild loginButton = getInterface(596, 75);
- private RSInterfaceChild clickWorld = getInterface(906, 179);
- @Override
- public void onFinish()
- {
- return;
- }
- @Override
- public boolean onStart(final Map args)
- {
- return true;
- }
- private int getLogin()
- {
- return getLoginIndex();
- }
- @Override
- public int loop()
- {
- userName = Bot.getAccountName().replaceAll("_", " ").toLowerCase().trim();
- passWord = AccountManager.***********(Bot.getAccountName());
- if (getLogin() == 2)
- {
- if (enterUsernamePass.isValid())
- {
- int x;
- int y;
- if (checkForUsername() && checkForPassword())
- {
- x = (loginButton.getAbsoluteX() + random(10, 60));
- y = (loginButton.getAbsoluteY() + random(5, 20));
- moveMouse(x, y, true);
- wait(60);
- clickMouse(true);
- }
- if (!checkForUsername())
- {
- x = (userNameEnter.getAbsoluteX() + random(10, 60));
- y = (userNameEnter.getAbsoluteY() + random(5, 20));
- moveMouse(x, y, true);
- wait(60);
- clickMouse(true);
- wait(60);
- sendText(userName, false);
- return 70;
- }
- if (checkForUsername() && !checkForPassword())
- {
- x = (passWordEnter.getAbsoluteX() + random(10, 60));
- y = (passWordEnter.getAbsoluteY() + random(5, 20));
- moveMouse(x, y, true);
- wait(60);
- clickMouse(true);
- wait(60);
- sendText(passWord, false);
- return 70;
- }
- return 70;
- }
- else
- {
- if (memberLogin.isValid())
- {
- clickRSComponent(clickMem, true);
- }
- }
- }
- if (getLogin() == 6)
- {
- atInterface(clickWorld, "");
- }
- if (getLogin() == 9)
- {
- onFinish();
- }
- return 0;
- }
- private boolean checkForUsername()
- {
- String currentEntered = userNameEnter.getText().toLowerCase();
- if (currentEntered.equalsIgnoreCase(userName))
- return true;
- return false;
- }
- private boolean checkForPassword()
- {
- int currentEntered = passWordEnter.getText().toLowerCase().length();
- if (currentEntered == passWord.length())
- return true;
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement