Helm Auto-Toggle Addon - Massive help needed
My knowledge of LUA is totally lacking, all i know is some stuff ive read at the WoWwiki tutorials page :S I'm 1st year programming student so i have some idea about programming, but without knowing the language....
This addon is supposed to check if the player is in combat, if yes to show helm graphic, and if not to hide it.
----.LUA file---
function HelmInCombatFrame_OnLoad()
this:RegisterEvent("PLAYER_ENTERING_WORLD");
this:SetScript("PLAYER_ENTERING_WORLD",HelmInCombat);
end
function HelmInCombat()
this:RegisterEvent("PLAYER_REGEN_DISABLED");
this:RegisterEvent("PLAYER_REGEN_ENABLED");
if(event=="PLAYER_REGEN_DISABLED") then
if(event=="PLAYER_REGEN_DISABLED") then
ShowHelm();
elseif(event=="PLAYER_REGEN_ENABLED") then
ShowHelm('false');
end
end
---
---.TOC file---
## Interface: 20100
## Title: HelmInCombat
## Notes: Enables your helm graphic when you enter combat.
## Author: DarkRa
## OptionalDeps:
## Dependencies:
HelmInCombat.lua
---
My main questions:
1) Syntax/logic. Is it correct? do i need to change something?
2) XML file. Do I need to create one? What should I put in it?
Last edited by darkra : 06-04-07 at 05:52 AM.
|