How do you make a combo of two emotes in lua in Wo

2019-04-07 07:52发布

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.

6条回答
该账号已被封号
2楼-- · 2019-04-07 07:55

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

查看更多
甜甜的少女心
3楼-- · 2019-04-07 07:57

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.

查看更多
我只想做你的唯一
4楼-- · 2019-04-07 07:59

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

查看更多
不美不萌又怎样
5楼-- · 2019-04-07 08:05

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

查看更多
Emotional °昔
6楼-- · 2019-04-07 08:11

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

查看更多
我命由我不由天
7楼-- · 2019-04-07 08:12

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.

查看更多
登录 后发表回答