Difference between revisions of "OgreEvents"

From ISXOgre
Jump to: navigation, search
(The Events)
(The Events)
 
Line 38: Line 38:
 
* [[OgreEvent:OnAbilityCast|OgreEvent_OnAbilityCast]]
 
* [[OgreEvent:OnAbilityCast|OgreEvent_OnAbilityCast]]
 
* [[OgreEvent:OnItemUse|OgreEvent_OnItemUse]]
 
* [[OgreEvent:OnItemUse|OgreEvent_OnItemUse]]
 +
* [[OgreEvent:OthersOnAbilityCast|OgreEvent_OthersOnAbilityCast]]
 +
* [[OgreEvent:OthersOnItemUse|OgreEvent_OthersOnItemUse]]
  
 
== Comments ==
 
== Comments ==

Latest revision as of 12:03, 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} )
}

The Events

Comments