Learning LUA
Im trying to get into the addon game so to speak.
For starters im skipping the interface design. It jsut takes more brain power than i have to devote right now to go through reams and ream and reams of code that si far to similar to html tables than I like. What I would like to do for a starter. To get my feet wet. Is take some macros I made up in game that i use alot and turn them into / commands via an addon. So lets take something real simple /say Stop laying down on the job %T /cast Ressurection(Rank 1) This obviously says the line then casts ressurection on my target. So what I'd like to do is turn something like this into a / command For example /rt and Poof it access the lua which in turns sends the message and then rezes my current target. Ive got some basic Idea. But Im wondering if anyone can provide a little lesson or a link to a tutorial that might detail how to go about this? Thank in advance |
http://www.wowwiki.com/Interface_Customization
Has a tutorial section where you should start because you really should create a xml file if only to hold a single frame. http://www.wowwiki.com/Category:HOWTOs Should show you how to add a slash command. HTH |
Just curious why would I want a frame if my first intention is only to put these macros into slash commands?
|
ah, it's my mistake (still a newb :]). You need the XML if you want to listen to events. But for just slash commands, you can dispense with the XML and go straight to LUA.
|
Well its not working
heres what I have so far myaddon.toc ## Interface: 1800 ## Title: My Addon ## Notes: Testing Slash Commands myaddon.xml myaddon.xml <Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ C:\Projects\WoW\Bin\Interface\FrameXML\UI.xsd"> <!-- Load Script file --> <Script file="myaddon.lua"/> <Frame name="myaddon"> <Scripts> <OnLoad> myaddon_OnLoad(); SLASH_MYADDON1 = "/myaddonmessage"; SLASH_MYADDON2 = "/mam"; SlashCmdList["MYADDON"] = myaddon_message(); </OnLoad> </Scripts> </Frame> </Ui> myaddon.lua function myaddon_OnLoad() message("My Addon Loaded!"); end function myaddon_message() message("Yay! It Works!"); end And problem is when i type /myaddonmessage or /mam I get the type /help for a list of commands message So its not loading or creating my slash command list. What I see is My Addon Loaded! Yay! It Works! as soon as I log in. so its like both events are firing and the list isnt being generated. Can someone advise? Please? |
Code:
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ C:\Projects\WoW\Bin\Interface\FrameXML\UI.xsd"> Code:
function myaddon_OnLoad() |
All times are GMT -6. The time now is 02:44 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI