bumzag Posted July 16, 2019 Share Posted July 16, 2019 (edited) Alright so I literally just dove into the API like 45 minutes ago, got IntelliJ up and running and am able to build a jar. Literally the only success I've had so far is writing a script that hovers over the nearest bank booth and logs a string. What I'm trying to do now is actually open the bank booth. Not deposit or anything, literally just open the booth. How do I do that? Here's my code (like I said, all it does it hover over the nearest bank booth when standing in a bank): import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import java.awt.*; @ScriptManifest(name = "Skeleton", author = "Alek", version = 1.0, info = "", logo = "") public final class CowMain extends Script { @Override public void onStart() { //Code here will execute before the loop is started } @Override public void onExit() { //Code here will execute after the script ends } @Override public int onLoop() { objects.closest("Bank booth").interact("Use"); log("It's not working atm"); return 100; //The amount of time in milliseconds before the loop starts over } @Override public void onPaint(Graphics2D g) { //This is where you will put your code for paint(s) } } Edited July 16, 2019 by bumzag Link to comment Share on other sites More sharing options...
bumzag Posted July 16, 2019 Author Share Posted July 16, 2019 Okay so screwing around some more I figured it out, I add to add "throws Interrupted Exception" to the onLoop() method and added this to it: getBank().open(); return 5000; //arbitrary number until the loop runs again, I know Link to comment Share on other sites More sharing options...
Kramnik Posted July 16, 2019 Share Posted July 16, 2019 4 minutes ago, bumzag said: Okay so screwing around some more I figured it out, I add to add "throws Interrupted Exception" to the onLoop() method and added this to it: getBank().open(); return 5000; //arbitrary number until the loop runs again, I know Dig more into Conditional sleeps as this will try to open back meanwhile waiting 5 seconds, which is not very efficient, with conditional sleep it would sleep until condition is met in this case bank interface is open Link to comment Share on other sites More sharing options...
bumzag Posted July 16, 2019 Author Share Posted July 16, 2019 2 minutes ago, Kramnik said: Dig more into Conditional sleeps as this will try to open back meanwhile waiting 5 seconds, which is not very efficient, with conditional sleep it would sleep until condition is met in this case bank interface is open Thanks for the response. Not trying to make you do the work, but can you sort of push me in the right direction? I know the basic structure of what you're saying would be along the lines of if (bank is open) sleep; else open bank; but I'm wildly unfamiliar with Java methods Link to comment Share on other sites More sharing options...
Muffins Posted July 16, 2019 Share Posted July 16, 2019 Learn java basics before you attempt scripting, there are a bunch of tutorials in the tutorial section. Link to comment Share on other sites More sharing options...