Skip 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.

onBreak method

Featured Replies

Hello,

I came up with an idea today that could help soms scripters. As some may know, several scripts may need to perform an action before logging out. (Example: combat scripts may need to walk to a safe location; or hunter scripts may need to pick up their traps, as otherwise those will be lost.)

I came up with the idea for an onBreak() method, handled similar to onStart() and onStop().

The idea is fairly simple: when the break timer reaches 0, the script will execute the onBreak() method (if it exists, if not stop and break immediently) after the script gets to finish the onBreak method, the client will then start taking a break. And the script can simply restart after the break is over.

Hope to see this implented, could be very useful, and I don't think it is very hard to make.

Sincerly, Alex

Edited by aekramer

could be usefull for some scripts like combat indeed ;)

I haven't looked into it but don't you add it as a custom random event handler for the break random?

 

edit: yeah you just have to write your own RandomBehaviourHook for the BreakManager random.

 

Although it's talking about an error (which is now fixed), this thread has an example of how you would do something like this for the Miles/Niles/Giles random http://osbot.org/forum/topic/3231-randombehaviourhook-not-working-correctly/

Edited by Diclonius

  • Author

I am not sure, because I haven't looked into it that much either, but don't you think it would be way more usefull if each scripter could write their own onBreak method? Every script needs different handling before it would take a break

Hello,

I came up with an idea today that could help soms scripters. As some may know, several scripts may need to perform an action before logging out. (Example: combat scripts may need to walk to a safe location; or hunter scripts may need to pick up their traps, as otherwise those will be lost.)

I came up with the idea for an onBreak() method, handled similar to onStart() and onStop().

The idea is fairly simple: when the break timer reaches 0, the script will execute the onBreak() method (if it exists, if not stop and break immediently) after the script gets to finish the onBreak method, the client will then start taking a break. And the script can simply restart after the break is over.

Hope to see this implented, could be very useful, and I don't think it is very hard to make.

Sincerly, Alex

the tree node system basically does that, it will only activate the node when the conditions are met, which could be only execute it when you run out of materials etc

This would be very useful for all scripters. I'm sure the dev team will add something like this into v1.8 or beyond.

Guest
This topic is now closed to further replies.

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

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.