WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Why are my slash commands not working? (https://www.wowinterface.com/forums/showthread.php?t=5078)

vadindot 06-12-06 09:47 AM

Why are my slash commands not working?
 
I've been working on the following mod for use in Warsong. The functions themselves work fine if I use "/script". Also, if I paste this code into LuaSlinger the slash commands will work, but only if I load the script TWICE. Can anyone see what my mistake is?

Code:

function EBS_OnLoad()
        SLASH_IncTun1 = "/inct";
        SlashCmdList["IncTun"] = EBS_Incoming_Tunnel;
        SLASH_IncRoof1 = "/incr";
        SlashCmdList["IncRoof"] = EBS_Incoming_Roof;
        SLASH_IncLed1 = "/incl";
        SlashCmdList["IncLed"] = EBS_Incoming_Ledge;
        SLASH_IncRamp1 = "/incp";
        SlashCmdList["IncRamp"] = EBS_Incoming_Ramp;
end


function EBS_Incoming_Tunnel()
    SendChatMessage("INCOMING TUNNEL", "RAID");
end

function EBS_Incoming_Roof()
    SendChatMessage("INCOMING they are on our ROOF", "RAID");
end

function EBS_Incoming_Ledge()
    SendChatMessage("INCOMING SECOND FLOOR/ Ledge above Flag Room", "RAID");
end

function EBS_Incoming_Ramp()
    SendChatMessage("INCOMING coming up RAMP", "RAID");
end


Gello 06-12-06 10:23 AM

The OnLoad bit would require seeing the xml.

Were you to do this:

SLASH_IncTun1 = "/inct";
SlashCmdList["IncTun"] = EBS_Incoming_Tunnel;

function EBS_Incoming_Tunnel()
SendChatMessage("INCOMING TUNNEL", "RAID");
end

/inct would do nothing (until you ran it twice) because EBS_Incoming_Tunnel is nil at the time of evaluation.

Do this instead:

function EBS_Incoming_Tunnel()
SendChatMessage("INCOMING TUNNEL", "RAID");
end

SLASH_IncTun1 = "/inct";
SlashCmdList["IncTun"] = EBS_Incoming_Tunnel;

If you really have an OnLoad running then your xml is likely bad, causing the frame to not load and the slash commands to not load.

EmGooser 06-12-06 05:04 PM

Looks like your onload is not running. You can use "poor man's debug" and put a DEFAULT_CHAT_FRAME:AddMessage("It fired") and see if it fires in your on load event. Also try opening up the xml in IE and it can at least check for XML errors... but XSD though unless you have teh xsd on your local box and have the xsd path pointing to it.

vadindot 06-13-06 06:55 AM

thanks for your input, I had already given a shot at the "poor man's debug" and it didn't work, I haven't tried moving the commands as Gello suggested... I guess I have to wait until maintenance is over :(

my XML file is about 20k, I am also designing a frame with buttons for the warning commands... what would be the normal procedure for showing a larger file? should i go ahead and paste it here? upload it somewhere?

as long as I am asking the noob questions here's a couple of others...
1. is there a way to test addons without going into one of Blizzard's realms?
2. even in the game is it possible to simulate certain conditions, such as going into a battleground? obviously I wouldn't be doing my team any favors if I joined a battleground and spent all my time testing
3. is mana a wave or a particle?

vadindot 06-14-06 07:37 AM

woo-hoo!

thanks Gello, your suggestion was dead on, my slash commands work now!

I still want to get to the bottom of the On_load problem, but I'm going to fiddle with what I've got working now :)

thanks again


All times are GMT -6. The time now is 10:15 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI