Difference between revisions of "OgreEvents"
(→The Events) |
|||
Line 35: | Line 35: | ||
== The Events == | == The Events == | ||
− | * [[ | + | * [[OgreEvent:OnGainedTithe|OgreEvent_OnGainedTithe]] |
− | * [[ | + | * [[OgreEvent:OnAbilityCast|OgreEvent_OnAbilityCast]] |
Revision as of 10:04, 14 December 2015
OgreEvents
OgreEvents are for advanced scripters wanting to make little add-ons etc for Ogrebot.
OgreEvents shares information to outside scripts via Events. These can be basic events, such as when a tithe is gained, or when a spell is cast. As time goes on, more and more OgreEvents will be created.
Ogre knows a LOT of information about encounters, and it gets it 100% safely without spamming the server.
The Basics
The basic premise for all OgreEvents is the same. In your script, you attach to the event, then handle the event in an atom. Here is a very basic example of a script that will send a message to OgreConsole when you gain a tithe.
Note: The below are just examples of syntax. Check each individual OgreEvent for the most up to date information.
function main() { Event[OgreEvent_OnGainedTithe]:AttachAtom[OgreEvent_OnGainedTithe] while 1 { wait 10 } } atom OgreEvent_OnGainedTithe() { oc ${Me.Name} gained a tithe! }
If there are parameters, you can include them and use them as you see fit. For example:
method OgreEvent_OnAbilityCast(string _Caster, uint _AbilityID, string _AbilityName, uint _OnPlayerID, string _OnPlayer) { echo ${Time}: ${_Caster} casted ${_AbilityName} ( ${_AbilityID} ) on ${_OnPlayer} ( ${_OnPlayerID} ) }