View Single Post
12-11-13, 05:19 PM   #15
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by RooR View Post
Well i cant read out a function for that.
As I said before, rather than just going "omg code, too hard, spoon-feed me the answer plz!" take a few minutes to slow down and just look at the code. Lua is almost plain English, with a little bit of simple math notation like + and - signs for adding and subtracting, < and > signs for comparing greater-than and less-than, and = signs for indicating that something is equal to something else.

For example, if you set aside your mental block and actually think about what this line could mean:

if cur < max then

... you should be able to figure out that it's checking "if" the current health (since "cur" is short for "current" and you're in a section about health) is less than (that's what "<" means in math) the maximum health (since "max" is short for "maximum") and if it is, "then" do what's written afterward.

Similarly, I think there's really only one possible interpretation of a line that says:

elseif bar.__owner.isMouseOver then

I'm willing to help, but there's a difference between helping you do something, and just doing it for you because you're unwilling to make any effort to help yourself.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote