Talk:1.11.0 API changes (Iriel)
Jump to navigation
Jump to search
GetNumPartyMembers() and GetNumRaidMembers() seemed to have changed. Previously if you were not in a party or a raid it would return 0. I'm not sure what it returns now.
My previous "assist" script was (in pseudocode)
/script if(IsControlKeyDown())then MA=UnitName("target");if GetNumRaidMembers() then SendChatMessage(smsg,"RAID");elseif GetNumPartyMembers() then SendChatMessage(smsg,"PARTY");end elseif (MA~=nil)then AssistByName(MA);end
This now returns "You're not in a RAID" when I'm in a party, indicating that GetNumRaidMemebers is returning a TRUE value.
Modifying the script to
/script if(IsControlKeyDown())then MA=UnitName("target");if GetNumRaidMembers()>0 then SendChatMessage(m,"RAID");elseif GetNumPartyMembers()>0 then SendChatMessage(m,"PARTY");end elseif (MA~=nil)then AssistByName(MA);end
made it work.
-- Caeryn
- Weird. 0 has always been "true" in Lua. Only nil and false are "false". --Mikk 20:24, 3 July 2006 (EDT)
- I guess I should clarify. I am not sure that it returned 0, only that it returned a 'false' value that allowed the macro to work. I suppose it could have returned nil if I'm not in a raid/party and it could return 0 now, which evaluates to 'true'
-- Caeryn