View Single Post
Unread 11-13-12, 11:26 AM   #16
gmarco
A Flamescale Wyrmkin
 
gmarco's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 100
I am a really newbie and have read about lua 2 hours... sorry about this error.
I'll try to read about it but I didn't find it because it was working nicely (only when it tries to summon the same mount if you are mounted it simply dismount, but I'll have to check why :-)

Btw I have stripped it down in this way.

One file only and a lot less things :-)

--

Code:
-- freely inspired by MountMe
-- http://www.wowinterface.com/downloads/info19197-MountMe.html
 
 mounts = { 
   
   flying = {
      "Draco Del Crepuscolo",
      "Draco Rosso",
   },
   
   ground = {
      "Fiera della Luna Rapida",
      "Fiera della Nebbia Rapida",
      "Fiera della Notte Striata",
   },
   
   repair = {
      "Mammut del Viaggiatore della Tundra",
      "Yak della Grande Spedizione",
   },
   
   -- add your custom categories here
   
   
}
 
-- Do not edit past this line --
 
-- Create slash command
SLASH_MOUNTRNDCAT1 = "/mntrndcat";
SLASH_MOUNTRNDCAT2 = "/mrc";
SlashCmdList["MOUNTRNDCAT"] = function(category) 

	if (category == "" ) then 
	
		print ("MountRandomCategory v.0.2")
		print ("Usage: /mrc category\n")
	
	else
		
		if(IsMounted()) then
			Dismount();
		end
	
		number = random(1, #mounts[category])
		print ("casting ... " .. mounts[category][number])
		CastSpellByName(mounts[category][number])
		
	end
	
end
gmarco is offline   Reply With Quote