-
Posted by jc on Fri, 01 Apr 2011 07:41:46
Hi Jim,
right now I'm in process to add a Tranquility Monitor to my existing Druid Raid Addon. So, I want to watch Tranquilitiy's ready or on cooldown (for all druids). Within the creation and testing phase of this new module I don't want to code it for raid only.
My question would be, is it possible to use
COMBAT_LOG_EVENT_UNFILTERED
without being in Raid or Combat to include something like spellID == 740 and event == "SPELL_TRANQUILITY" etc.?If so it would be alot easier to program this module first and after everythings working I could include it showing up in raids only etc.
Thanks.
JC
-
Posted by jnwhiteh on Fri, 01 Apr 2011 08:07:02
Hi Jim,
right now I'm in process to add a Tranquility Monitor to my existing Druid Raid Addon. So, I want to watch Tranquilitiy's ready or on cooldown (for all druids). Within the creation and testing phase of this new module I don't want to code it for raid only.
My question would be, is it possible to use
COMBAT_LOG_EVENT_UNFILTERED
without being in Raid or Combat to include something like spellID == 740 and event == "SPELL_TRANQUILITY" etc.?If so it would be alot easier to program this module first and after everythings working I could include it showing up in raids only etc.
The event wouldn't be
SPELL_TRANQUILITY
, it would beSPELL_CAST_SUCCESS
. You don't just make up event names, there's quite a rigid set of sub-events for COMBATLOGEVENT_UNFILTERED. But rather than using the spell id, I would get the spell name from the spell id (this way its properly localised, but handled different ranks and variations of the same spell). -
Posted by jc on Sat, 02 Apr 2011 09:20:13
Thanks Jim - working now. Thanks for the Tip again.
Greets,
JC
-
Posted by jc on Sat, 02 Apr 2011 18:44:11
Jim,
found another qustion. Within a function I want to check if a variable is nil (without any input) so I included a if then else - but I guess I have something wrong , because I always get true also if the variable has a value.
So here's a example to show what I mean:
if tostring(rezzer.cdnamesmessage) == "nil" then msg = "All Druids have Rebirth >> Ready" SendChatMessage(msg, "RAID_WARNING") else msg = msgformat .. tostring(rezzer.cdnamesmessage) SendChatMessage(msg, "RAID_WARNING") end
I always get a nil is true, also when rezzer.cdnamesmessage has a value. I'm sure it's a logical problem. But want to act when the variable has a nil value to prevent getting a LUA error whenever rezzer.cdnamesmessage is empty.
Thanks!
-
Posted by jnwhiteh on Sat, 02 Apr 2011 22:24:52
Jim,
found another qustion. Within a function I want to check if a variable is nil (without any input) so I included a if then else - but I guess I have something wrong , because I always get true also if the variable has a value.
All you need to do is:
if value == nil then -- do something else -- do something else end
What you have is a bit too complicated, and definitely not the same.
So here's a example to show what I mean:
if tostring(rezzer.cdnamesmessage) == "nil" then msg = "All Druids have Rebirth >> Ready" SendChatMessage(msg, "RAID_WARNING") else msg = msgformat .. tostring(rezzer.cdnamesmessage) SendChatMessage(msg, "RAID_WARNING") end
I always get a nil is true, also when rezzer.cdnamesmessage has a value. I'm sure it's a logical problem. But want to act when the variable has a nil value to prevent getting a LUA error whenever rezzer.cdnamesmessage is empty.
Thanks!
-
Posted by jc on Sun, 03 Apr 2011 11:57:40
Hi Jim,
I found the problem and everything is working as it should. The thoughts was good - but there was a small typo in between my function so the value was always nil. Sometimes its a pain with this minor typos :)
Thanks.