How do you make a combo of two emotes in lua in World of Warcraft work?
Asked Answered
R

6

7

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.

Rahm answered 21/6, 2009 at 23:3 Comment(5)
lol +1 for world of warcraft question turned into programming :pLockhart
WoW has a full API usable from lua, so yep, it can be programming related.Oakes
Do you get different results if you do each individually in WoW?Oakes
yes i do get different results if I seperate each emote. We were also to attached the sound to the emotes that were seperated. Ex: the / command would show up, then the sound would play.Rahm
what does Fart means in this context :D ?Fourfold
I
5

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.

Inexpensive answered 30/6, 2009 at 0:44 Comment(0)
C
3

This may be an intentional limitation of the API to prevent in game automation (botting).

Catenary answered 22/6, 2009 at 21:52 Comment(0)
F
3

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.

Firebrick answered 4/1, 2010 at 19:50 Comment(1)
I had the same idea, but emotes would go on a global work array with their time to execute (e.g. 1:32:20), and then event handler would a variety of common events, keydown, key up, buttons, mouse move etc, and then each event handler would check the work array for an emote to do, if that work item's time had come.Inexpensive
S
2

I would suggest you wait some time before doing the next emote. As far as I know, the server disconnects you if you spam too much. This might just trigger it sometimes.

Besides that, I guess maybe the client has a way of preventing it? In either case, I would suggest you add some sort of fraction-of-a-second delay between the emotes.

Cheers,
Amit Ron

Sumrall answered 22/6, 2009 at 21:30 Comment(0)
H
1

Could it be that the last two can't be done while sitting?

Hersch answered 3/9, 2009 at 3:35 Comment(0)
P
1

infact, integer i = 0, because defining integer 'count' and then using i is incorrect. :)

Paprika answered 26/1, 2010 at 23:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.