Thread Tools Display Modes
Prev Previous Post   Next Post Next
10-11-11, 11:44 PM   #1
llubtoille
A Defias Bandit
Join Date: Oct 2011
Posts: 2
Combat weapons check

Hiya

I've a good habit of taking off my weapons in a wipe, but a bad habit of not re-equipping them (on my priest).

So given my total lack of a experience with wow addons or programming of any form, I thought I'd try and make an addon to alert me.

Basically when I enter combat, I want it to check my wand slot, and if it's empty I want it to play a soundfile,
I've borrowed quite a bit from tentonhammer.com, however I've pretty much hit a dead end.

This is what I've got so far, are there any glaring errors anyone can spot?

Weapons.xml
<Script file="Weapons.lua"/>
<Frame name="WeaponCore">
<Scripts>
<OnLoad>WeaponLoad();</OnLoad>
<OnEvent>WeaponEvent();</OnEvent>
</Scripts>
</Frame>

Weapons.lua
function WeaponLoad()
this:RegisterEvent("PLAYER_REGEN_DISABLED");
end

function WeaponEvent()
if("HasWandEquipped")=nil then
PlaySound("Interface\\AddOns\\Weapons\\Weapons.mp3")
end

Thanks =D
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » Combat weapons check


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