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.

How To Event Style?

Featured Replies

I was converting some old scripts to use Events oppose to states as it appears to me to be a lot cleaner and easier to apply maintenance. Currently they will run but don not loop? If Events arn't the best way of going about changing my scripting I would appreciate any direction or help!

 

 

 

public int onLoop() throws InterruptedException {
      for ( Event e : allEvents){
             execute(e);
      }
      return 1000;
}
 
 
When they complete i set them as finished. Any help appreciated!

Btw i have one aSync event

If you set them to finished at the end of the first loop, will they still run in the second loop despite being "finished"?

EDIT: Code is ran more or less line by line, so your onLoop would look like this:

execute(allEvents.get(0));
execute(allEvents.get(1));
..etc

This means that there is no need to check them as finished, as when one of the executes is done the next will run.

The only problem I see is the asynchronous event, which may not finish by its next loop. Maybe if you have the "finished" check within the Event itself, and then in your execute method:

void execute(Event ev) {
    if (ev.finished) { //Last loop was complete, so we can continue
        ev.loop();
    }
}

And in your Event class:

void loop() {
    finished = false; //Reset the loop
    //logic here
    finished = true;
}

Edited by Bobrocket

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.