Pokerstar Posted May 13, 2018 Posted May 13, 2018 I am starting the journey of trying to learn java and osbot in the hopes to make some personal scripts. private static final Position PLAYER_LOC = new Position(3169, 3423, 0); @Override public void onStart() throws InterruptedException { } @Override public int onLoop() throws InterruptedException { if (myPlayer().getPosition().equals(PLAYER_LOC)); { log("You are in the right location"); getBank().open();} I am trying to make the bot only attempt to open the bank if its standing on that position. But it still attempts to open the bank, regardless of what tile/location I am on. What part is incorrect? Thanks.
Canidae Posted May 13, 2018 Posted May 13, 2018 You are closing your if statement by putting a semicolon at the end of it. Your code should look like this. if (myPlayer().getPosition().equals(PLAYER_LOC)) { getBank().open(); } 1
Alek Posted May 13, 2018 Posted May 13, 2018 Please press Ctrl+Alt+L in IntelliJ. @Canidae's answer is correct though.
dreameo Posted May 13, 2018 Posted May 13, 2018 Haha what's with all the newbies lately. Learn some basic Java first and then try to script. Not the other way around, it doesn't work to well regardless of the outcome.