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.

Conditions true but won't execute code...

Featured Replies

So following this guide I am writing a script:

 

Mostly it works flawlessly, but some of my classes just wont work. For example I have a class where the condition check is::

@Override
    public boolean canProcess() {
        return VarWest.contains(api.myPlayer())
                && !api.bank.isOpen();
    }

If this is true it is supposed to open the bank. Works great, when the bot is in the bank and the bank is not open, it opens it.

Then I have another class that is supposed to withdraw specific items from the bank when the following is true:

@Override
    public boolean canProcess() {
        return VarWest.contains(api.myPlayer())
                && api.bank.isOpen();
    }

 

Does not work, it falls past that task all the way to my debug class where I have it checking if the above is true and if so to print "true" to the log. The script knows the condition has been met because the logs show this:

[INFO][04/28 12:13:05 PM]: Started bot #1
[INFO][Bot #1][04/28 12:14:31 PM]: Loaded 1 built-in random solvers!
[INFO][Bot #1][04/28 12:14:31 PM]: Started script : 
[INFO][Bot #1][04/28 12:14:32 PM]: Opening Varrock bank
[INFO][Bot #1][04/28 12:14:37 PM]: Emptying inventory
[INFO][Bot #1][04/28 12:14:37 PM]: true
[INFO][Bot #1][04/28 12:14:38 PM]: true
[INFO][Bot #1][04/28 12:14:40 PM]: true
[INFO][Bot #1][04/28 12:14:41 PM]: true
[INFO][Bot #1][04/28 12:14:42 PM]: true
[INFO][Bot #1][04/28 12:14:42 PM]: Terminating script ..
[INFO][Bot #1][04/28 12:14:42 PM]: Script has exited!

I am not sure what to make of this, the script sees that the conditions are met but never executes the class, and I have checked to see that the task is in the list of tasks loaded onStart.

 

Any thoughts?

You can add a log before the return in canProcess()

You may be having an issue with something inside the process function.

  • Author

Root cause found  PEBCAK error. It was processing the class, my code was just bad and I didn't have log entries in the code so it was just bypassing it.

Create an account or sign in to comment

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.