Thread Tools Display Modes
11-30-09, 07:35 AM   #1
Amenity
Guest
Posts: n/a
If (numeric variable) increases, do (action)?

(Please keep in mind...I'm more of a code monkey hack than a true programmer. Also, I tried searching and came up with nil.)

Let's say I have variable HUMANS, which is a list of players that's updated whenever EVENT occurs. I have action ACTION that does "stuff".

Basically what I want is this:

If #HUMANS increased when EVENT happened, then ACTION
If #HUMANS decreased, or remained the same, then NIL

Exactly how would one go about that?
  Reply With Quote
11-30-09, 07:51 AM   #2
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
lua Code:
  1. local HUMANS = 1
  2. function(self, event, newValue)
  3.    if(newValue > HUMANS) then
  4.       -- Do stuff
  5.    end
  6. end
__________________
「貴方は1人じゃないよ」
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » If (numeric variable) increases, do (action)?


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