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.