Thread Tools Display Modes
Prev Previous Post   Next Post Next
08-14-16, 01:59 PM   #1
cokedrivers
A Rage Talon Dragon Guard
 
cokedrivers's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 325
Help with SetScript

I'm trying to make a clickable button for my data panel that allows the user to one click either a Repair Bot or Repair Mount.

I can not seem to get it to go threw all the options.

Here is the code I'm trying to wwork with:
Code:
	plugin:SetScript("OnMouseDown", function(self, btn)
		local RepairProfession = GetProfessions()
		if btn == "LeftButton" then
			if RepairProfession == "Engineering" then
				CastSpellByName("Field Repair Bot 74A") or CastSpellByName("Field Repair Bot 110G") or CastSpellByName("MOLL-E") or CastSpellByName("Scrapbot") or CastSpellByName("Jeeves")
			else
				CastSpellByName("Guild Page") or CastSpellByName("Guild Page") or CastSpellByName("Guild Herald") or CastSpellByName("•Argent Squire") or CastSpellByName("Argent Gruntling")
			else 
				print('|cff33ff99cData:|r |cffFF0000No Repair bots Available|r')
			end
		elseif btn == "MiddleButton" then
			ToggleCharacter("PaperDollFrame")
		elseif btn == "RightButton" then
			CastSpellByName("Traveler's Tundra Mammoth") or CastSpellByName("Grand Expedition Yak")
		end		
	end)
I was able to get the CastSpellByName("Traveler's Tundra Mount") to cast the mount spell so I know it works but I keep getting an error with the "or" in the formula.

Thanks for any help with this.
Coke
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » Help with SetScript


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