Difference between revisions of "Event Handler"

From Legends of Aria Admin and Modding Wiki
Jump to: navigation, search
Line 1: Line 1:
 
  An Event Handler is a function registered in a special way to be called when certain things (events) happen.
 
  An Event Handler is a function registered in a special way to be called when certain things (events) happen.
 +
 +
Official Events Documentation: [[http://shardsonline.com/lN2rwhz4jSVambqesEBZ/lua-reference/events.html Events]]
  
 
* Registering a function as Event Handlerin the general abstract form is:
 
* Registering a function as Event Handlerin the general abstract form is:
<code>
+
RegisterEventHandler( (EventType)mEvent, (string)mEventIdentifier, (function)mEventHandler)  
RegisterEventHandler( (EventType)mEvent, (string)mEventIdentifier, (function)mEventHandler)  
 
<code>
 
mEvent can be one of the following event types:
 
  
  EventType.
+
mEvent can be one of the following events:
  EventType.
+
EventType.LoadedFromBackup
  EventType.
+
EventType.Destroyed
  EventType.
+
EventType.CreatedObject
  EventType.
+
EventType.ModuleAttached
  EventType.
+
EventType.Timer
  EventType.
+
EventType.Message
  EventType.
+
EventType.EnterView
  EventType.
+
EventType.LeaveView
  EventType.
+
EventType.RequestPickUp
  EventType.
+
EventType.RequestDrop
 +
EventType.RequestEquip
 +
EventType.ContainerItemAdded
 +
EventType.ContainerItemRemoved
 +
EventType.ItemEquipped
 +
EventType.ItemUnequipped
 +
EventType.StartMoving
 +
EventType.Arrived
 +
  EventType.Use
 +
  EventType.PlayerSpeech
 +
  EventType.ClientUserCommand
 +
  EventType.ClientObjectCommand
 +
  EventType.ClientTargetAnyObjResponse
 +
  EventType.ClientTargetGameObjResponse
 +
  EventType.ClientTargetLocResponse
 +
  EventType.ContextMenuResponse
 +
  EventType.DynamicWindowResponse
 +
  EventType.UserLogout
 +
  EventType.GlobalVarUpdateResult

Revision as of 16:30, 1 November 2016

An Event Handler is a function registered in a special way to be called when certain things (events) happen.

Official Events Documentation: [Events]

  • Registering a function as Event Handlerin the general abstract form is:
RegisterEventHandler( (EventType)mEvent, (string)mEventIdentifier, (function)mEventHandler) 

mEvent can be one of the following events:

EventType.LoadedFromBackup
EventType.Destroyed
EventType.CreatedObject
EventType.ModuleAttached
EventType.Timer
EventType.Message
EventType.EnterView
EventType.LeaveView
EventType.RequestPickUp
EventType.RequestDrop
EventType.RequestEquip
EventType.ContainerItemAdded
EventType.ContainerItemRemoved
EventType.ItemEquipped
EventType.ItemUnequipped
EventType.StartMoving
EventType.Arrived
EventType.Use
EventType.PlayerSpeech
EventType.ClientUserCommand
EventType.ClientObjectCommand
EventType.ClientTargetAnyObjResponse
EventType.ClientTargetGameObjResponse
EventType.ClientTargetLocResponse
EventType.ContextMenuResponse
EventType.DynamicWindowResponse
EventType.UserLogout
EventType.GlobalVarUpdateResult