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