Thread Tools Display Modes
Prev Previous Post   Next Post Next
06-04-07, 05:08 AM   #1
darkra
A Deviate Faerie Dragon
Join Date: Jun 2007
Posts: 11
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.
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » Helm Auto-Toggle Addon - Massive help needed


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