Thread Tools Display Modes
06-12-06, 09:47 AM   #1
vadindot
A Defias Bandit
Join Date: Jun 2006
Posts: 3
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
  Reply With Quote
06-12-06, 10:23 AM   #2
Gello
A Molten Giant
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 521
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.
  Reply With Quote
06-12-06, 05:04 PM   #3
EmGooser
A Murloc Raider
Join Date: Jun 2006
Posts: 4
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.
  Reply With Quote
06-13-06, 06:55 AM   #4
vadindot
A Defias Bandit
Join Date: Jun 2006
Posts: 3
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?
  Reply With Quote
06-14-06, 07:37 AM   #5
vadindot
A Defias Bandit
Join Date: Jun 2006
Posts: 3
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
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Why are my slash commands not working?

Thread Tools
Display Modes

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