Thread Tools Display Modes
11-03-06, 07:51 PM   #1
Xavior
A Murloc Raider
Join Date: Nov 2006
Posts: 4
Obtaining chat commands from "/" entries

I am starting to make a mod to move your minimap, and I need some help.

How do I get a command from the chat window?
Like, /minimap unlock or something.

Also, how do I make other things in LUA to happen when certain events occur. The only one I found was <OnLoad>, but I want to be kind of just running, and whenever it gets a unlock command, it will unlock the minimap object and you can drag it with a mouse.

Can someone point me in the right direction?
  Reply With Quote
11-03-06, 07:59 PM   #2
JoshBorke
A Chromatic Dragonspawn
 
JoshBorke's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 185
http://www.wowwiki.com/Category:HOWTOs

specifically:
http://www.wowwiki.com/HOWTO:_Create_a_Slash_Command

In general:
http://www.wowwiki.com is your friend
  Reply With Quote
11-03-06, 08:11 PM   #3
Xavior
A Murloc Raider
Join Date: Nov 2006
Posts: 4
Alright, I will look at those, thanks.

EDIT:
My XML:
Code:
<Ui>
   <Script file="MinimapMover.lua" />
   <Frame name="MinimapMover">
      <Scripts>
         <OnLoad>
            MinimapMover_OnLoad();
         </OnLoad>
      </Scripts>
   </Frame>
</Ui>
My LUA:
Code:
function MinimapMover_Command(cmd)
   DEFAULT_CHAT_FRAME:AddMessage("Command: " .. cmd);
   message("ZOMG INVOKED");
end

function MinimapMover_OnLoad()
   SLASH_MINIMAPMOVER1 = "/minimapmover";
   SLASH_MINIMAPMOVER2 = "/mm";
   SlashCmdList["MINIMAPMOVER"] = MinimapMover_Command;
end
My TOC:
Code:
## Interface: 11200
## Title: Minimap Mover
## Author: Xavior of Sargeras
## Notes: This addon can lock and unlock the minimap position.
MinimapMover.xml
Yet, when I type /mm or /minimapmover nothing happens.

Please help?

Last edited by Xavior : 11-03-06 at 08:53 PM.
  Reply With Quote
11-03-06, 08:56 PM   #4
JoshBorke
A Chromatic Dragonspawn
 
JoshBorke's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 185
check logs/FrameXML.log for any errors about your mod
  Reply With Quote
11-03-06, 09:06 PM   #5
Xavior
A Murloc Raider
Join Date: Nov 2006
Posts: 4
It doesnt give me an error, it just says Type /help for commands or whatever, it's not registering it.

I'm not getting an error.
  Reply With Quote
11-03-06, 09:10 PM   #6
JoshBorke
A Chromatic Dragonspawn
 
JoshBorke's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 185
Originally Posted by Xavior
It doesnt give me an error, it just says Type /help for commands or whatever, it's not registering it.

I'm not getting an error.
not in game. there is a file in the WorldOfWarcraft/logs directory called FrameXML.log
  Reply With Quote
11-03-06, 09:20 PM   #7
Xavior
A Murloc Raider
Join Date: Nov 2006
Posts: 4
I'm not sure what I was looking for, but there was nothing aobut my mod in there.
  Reply With Quote
11-03-06, 09:53 PM   #8
JoshBorke
A Chromatic Dragonspawn
 
JoshBorke's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 185
is your mod enabled?

does your mod actually load? Put a DEFAULT_CHAT_FRAME:AddMessage("I loaded!") in the OnLoad
  Reply With Quote
11-04-06, 01:58 AM   #9
Saeris
A Murloc Raider
 
Saeris's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 6
The XML is missing the XSD file path. The <Ui> attribute has to have this format or something equivalent:

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/
..\..\FrameXML\UI.xsd">
__________________
  Reply With Quote
11-25-06, 08:34 AM   #10
OnmyojiOmn
A Defias Bandit
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 2
Originally Posted by Saeris
The XML is missing the XSD file path. The <Ui> attribute has to have this format or something equivalent:

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/
..\..\FrameXML\UI.xsd">
A schema declaration is only useful if you're using an XML editor that can validate your code for you. It isn't required.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Obtaining chat commands from "/" entries


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