View Single Post
02-26-13, 11:07 PM   #12
shalom69
A Fallenroot Satyr
Join Date: Feb 2013
Posts: 22
Originally Posted by Phanx View Post
3. As for your event question, I can't answer that either because you didn't post complete code. Did you set an OnEvent script for the same frame you registered the event on? How do you know the event didn't register?

4. Do you have BugSack installed and enabled? If not, go get it. Without something showing you Lua errors, you are totally in the dark when it comes to trying to figure out why your code isn't working, and the default error display is a useless for developers because it can't show errors that occur during the initial loading process (which is where most errors happen during addon writing).



Yes. Anything enclosed in "quotes" or [[double square brackets]] or [=[double square brackets with equals signs in between them]=] is a string value in Lua. The only actual nil value is nil, but both nil and false are equivalent when performing a simple "if X then" boolean check, so nil and false are only different if you explicitly check "if X == nil then" or "if X == false then", or if you are checking the return value from "type(X)".
Ok good information man! It's useful to know what the difference between nil and false is. I was using "nil" and nil interchangeably, just being careless because I didn't clearly delineate the difference in my mind. Although if someone had called me on it long enough for me to think about it, as F16 did I probably would have seen the difference.

Lol dude, my code actually worked with my nil set to "nil" string... because the value was in fact nil on bootup before I iterated thisIsLeadWindow function. So it would work the first 2 times before it got stuck. And I was checking it twice per instance so it never got stuck. Hahaha wotanoob. When I checked it was actually spitting out "nil" as the string for thisIsLeadWindow (when it should just be blank if it's nil value) and I wasn't noticing it.

I'll download and learn BugSack. I did have the OnEvent script in the same frame, but maybe BugSack can help me figure out what is wrong. I'm just kind of learning WOW LUA semantically... monkey see monkey do basically what I see in other scripts and tutorials, Phanx, is there a way to call 2 OnEvent scripts in the same frame?

for example in my script

Code:
LeaderMessageHandlerFrame:SetScript("OnEvent", function(self, event, msg, sender, ...)
if I wanted to SetScript("OnEvent", function(...)) I'd have to make a new frame for it, correct? I can't regsiter more OnEvent scripts to the same frame...
  Reply With Quote