Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Beginner questions: 1 - banking

Featured Replies

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 by bumzag

  • Author

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

 

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 :) 

  • Author
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

  • Muffins locked this topic
Guest
This topic is now closed to further replies.

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.