Thread Tools Display Modes
02-06-07, 06:16 PM   #1
mulesh
A Chromatic Dragonspawn
 
mulesh's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2006
Posts: 193
Reading variables

Lets say I have a variable (var1). Lets say I need to check its value in a function every X seconds without depending on an event to fire. How can I do this?
  Reply With Quote
02-06-07, 06:41 PM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Use OnUpdate. arg1 for OnUpdate is how much time has elapsed since the last OnUpdate, so just set up a variable to hold a time, then check if the difference between "last checked time" and the elapsed time is greater than or equal to, in your case, one second. If it is, run your check on var1 and updated the "last checked time" variable.
  Reply With Quote
02-12-07, 07:31 AM   #3
mulesh
A Chromatic Dragonspawn
 
mulesh's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2006
Posts: 193
Thank you Phanx That worked perfectly.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Reading variables

Thread Tools
Display Modes

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