How do you make a combo of two emotes in lua in World of Warcraft work?
function Button2_OnClick()
PlaySoundFile("Interface\\Addons\\Fart\\common_fart[1].wav");
DoEmote("moon");
DoEmote("sit");
DoEmote("dance");
DoEmote("beckon");
end
I am using Wow Addon Studio to make a fart application on Wow. I used this function, and only the sit motion showed, and beckon and moon only showed on the chat window. The dance emote didn't show up anywhere.
Lua (from the Portuguese word for moon) is the scripting language used by World of Warcraft for Interface Customization. Only a subset of version 5.1 of the official Lua specification is implemented, and should suit most addon maker's needs. More information about Lua can be found on the official Lua FAQ.
You can create your own emotes using the /e or /me slash commands, which will send a message to nearby players starting with your name and ending with the action you type (or anything else you might type). For example, if your name is Thrall, then entering: /e scrabbles in the dirt.
Research the programming environment: Lua - This is the programming language used by WoW for UI AddOns.
Blizzard has explicitly prohibited anything that can be used to make lua wait or pause because it is an essential ingredient to making a gold mining or grinding bot.
There isn't a native (i.e. lua only) way to have lua wait without using all the CPU. Outside of the WOW client, you'd use win.sleep or some other 3rd party API call that calls into the host application or operating systems threading functions.
It may be possible to simulate a wait by having code execute on a frequent event (such as text arriving at the chat window) and then in the event handler checking to see if enough time has passed to permit executing the next command in the sequence. This probably wouldn't be a very accurate timer and it would be rather complex as you'd have to create a data structure to hold the sequence of commands, the timings between each, the current command, etc. and so on.
This may be an intentional limitation of the API to prevent in game automation (botting).
What has worked for me is to have a global variable that is incremented through the loop. Such as
Integer count = 0;
function Button2_OnClick()
i++
switch
case(1)
PlaySoundFile("Interface\\Addons\\Fart\\common_fart[1].wav");
case(2)
DoEmote("moon");
case(3)
DoEmote("sit");
case(4)
DoEmote("dance");
case(5)
DoEmote("beckon");
default
i=0;
end
end
What you would have to do then is to click the button multiple times, but you would get the effect you're going for.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With