Thread Tools Display Modes
06-20-07, 06:12 PM   #1
tantrik
A Kobold Labourer
AddOn Author - Click to view addons
Join Date: Sep 2005
Posts: 1
Double event logging

I am trying to write a mod in which i have to track a sequence of events. For example, when we kill a mob one event is fired, and immediately another event is fired that gives u a certain buff. Is there a way to track the events such that a lua function is executed only when the two events occur in succession.

Another example will be when a mob dies and you gain reputation. The function should not fire when u only gain rep or only the mob dies, but when a mob dies and u gain reputation.
  Reply With Quote
06-25-07, 04:11 AM   #2
Wintry
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 28
That would be possible. Basically, start 2 event listeners - as you've most likely done already - and get the first one to set a variable stating the current time in milliseconds / seconds. On the second event, compare the difference between the current time and the last time recorded, and if it's less than half a second or so, you have your new "event".
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Double event logging


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off