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.

Random event behaviour overruling

Featured Replies

  • Developer

Ok, I want to discuss this with you script writers. Basically, we have a system setup which allows you to load random events simply by putting the files in the correct folder and it will be activated once the onActivate() method returns true.

 

For most randoms, this will work fine. For example if you get the strange box, or if you're taken to the surprise exam, you want to solve it on the spot in most cases. But what if you get the evil chicken? Then you want to specify your own way out, either to run away, either to kill it etc. So I was thinking, we need to provide you with a random management system.

 

See, we as OSBot will provide most and eventually all randoms through the SDN. These will be written by us and, as has already been done by some, people from within our community. But what if you're at the fight caves and you get an evil chicken outside? Well obviously the easiest way to avoid the random would be to hop back into the cave again. 

 

tl;dr

 

I want to suggest to have a library with an unique id for each random (to be documented in the API), where for each id you can subscribe your own handler to with parameters to completely override the preprogrammed random behaviour, or to extend it in such a way that your handler will perform its logic and after that the code inside the random will take over.

 

Before I start writing an implementation for this, I want you to think about any functionality you see fit in this system that we did not come across.

 

Discuss.

This sound good so far.

 

But what I was thinking is that you should give people the options to override the class using classLoader

 

Eg. random.replace(String randomName, Class<?> class);

or you can go even more simple by replacing the Class<?> class with RandomEventSolver

Edited by Doout

And what if you are using a script where you are under attack all the time. Then you CANNOT solve the strange box. You can use something like:

@Overridepublic void onRandomActivate(RandomEventSolver res) {    if(res instanceof StrangeBox) {        runSomewhereSafe();    }}@Overridepublic void onRandomDeactivate(RandomEventSolver res) {    if(res instanceof StrangeBox) {        runBack();    }}

would be nice. You don't have to script your own random code this way. You can just execute a part of your code, before the OSBot random code gets executed.

 

And you could use:

@Overridepublic void onRandomActivate(RandomEventSolver res) {    if(res instanceof EvilChicken) {        res.stop(); // onRandomDeactivate() gets called too.        runIntoFightCave();    }}

 

Edit:

Above answer sounds good to for totally overriding the OSBot random system.

Edited by SXForce

This sound good so far.

 

But what I was thinking is that you should give people the options to override the class using classLoader

 

Eg. random.replace(String randomName, Class<?> class);

or you can go even more simple by replacing the Class<?> class with RandomEventSolver

 

Bot class is obfuscated but you can still remove osbot randoms in this version.

		//unload bot broken randoms		List<RandomEventSolver> solvers = bot.H();		int loginIndex = -1;		for(int i = 0; i < solvers.size(); i++){			if(solvers.get(i) == null)				continue;			if(solvers.get(i).getName().equals("Login"))				loginIndex = i;		}		if(loginIndex > -1){			bot.H().remove(loginIndex);			System.out.println("Removed Login, index:"+loginIndex);		}		

 

Anyway, some randoms, mostly the combat ones, should be be made by scripter as it's not feasible to have a solver that will guarantee your account security in all places/situations.

 

if the bot give's us a platform to do it or not, doesn't really matter.

Bot class is obfuscated but you can still remove osbot randoms in this version.

		//unload bot broken randoms		List<RandomEventSolver> solvers = bot.H();		int loginIndex = -1;		for(int i = 0; i < solvers.size(); i++){			if(solvers.get(i) == null)				continue;			if(solvers.get(i).getName().equals("Login"))				loginIndex = i;		}		if(loginIndex > -1){			bot.H().remove(loginIndex);			System.out.println("Removed Login, index:"+loginIndex);		}		

 

Anyway, some randoms, mostly the combat ones, should be be made by scripter as it's not feasible to have a solver that will guarantee your account security in all places/situations.

 

if the bot give's us a platform to do it or not, doesn't really matter.

Can you read my post before posting random stuff.

Can you read my post before posting random stuff.

 

lol

 

Read the code, what you suggested can be done with remove+add methods on randomsolver list...

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.