Jump to content

How to runmacrolua on a loop for a certain amount of times.


twbp

Recommended Posts

Trying to click a button for a certain amount of times in a quester profile,

i currently have

 <QuestsSorted Action="RunMacroLua" NameClass= ("/click MyButtonNameGoesHere")

But i want to loop it for 100 times.

Link to comment
Share on other sites

Hello,

Run C# code:

        for (int i = 0; i < 100; i++)
        {
            wManager.Wow.Helpers.Lua.RunMacroText("/click MyButtonNameGoesHere");
            Thread.Sleep(100); // wait 100 ms before next run, you can remove or edit this line.
        }

 

Link to comment
Share on other sites

Could i do something like this?




for (int i = 0; i < 100; i++)
        {
            wManager.Wow.Helpers.Lua.RunMacroText("/click MyButtonNameGoesHere1");
            wManager.Wow.Helpers.Lua.RunMacroText("/click MyButtonNameGoesHere2");
            Thread.Sleep(100); // wait 100 ms before next run, you can remove or edit this line.
        }
Link to comment
Share on other sites

for (int i = 0; i < 100; i++)
        {
            wManager.Wow.Helpers.Lua.RunMacroText("/run if atbmi==nil then atbmi=1 end atbni=GetInboxNumItems() if atbmi&gt;atbni then atbmi=1 end atbit=GetInboxInvoiceInfo(atbmi) if atbit==&quot;seller_temp_invoice&quot; then GetInboxText(atbmi); DeleteInboxItem(atbmi) else atbmi=atbmi+1 end");
            wManager.Wow.Helpers.Lua.RunMacroText("/run if atbmi==nil then atbmi=1 end atbni=GetInboxNumItems() if atbmi>atbni then atbmi=1 end atbit=GetInboxInvoiceInfo(atbmi) if atbit=="seller_temp_invoice" then GetInboxText(atbmi); DeleteInboxItem(atbmi) else atbmi=atbmi+1 end");
            Thread.Sleep(100); 
        }

 

Ok so i got the one you helped me with, now im trying to add this in, but i realize now it is in the RunMacroLua section, ive tried changing wManager.Wow.Helpers.Lua.RunMacroText to

wManager.Wow.Helpers.Lua.RunMacroLua. Unfortunately it doesnt work, i looked in Visual Studio and all i can find is wManager.Wow.Class.QuestAction.RunMacroLua, but it keeps giving me a error that it cannot find it, is there another way i can use this RunMacroLua with the loop?

Link to comment
Share on other sites

https://marsbars.gitlab.io/unoffical-wrobot-api-docs/api/wManager.Wow.Helpers.Lua.html#wManager_Wow_Helpers_Lua_LuaDoString_System_String_System_Boolean_

Using your code:

for (int i = 0; i < 100; i++)
        {
            wManager.Wow.Helpers.Lua.LuaDoString("if atbmi==nil then atbmi=1 end atbni=GetInboxNumItems() if atbmi>atbni then atbmi=1 end atbit=GetInboxInvoiceInfo(atbmi) if atbit==\"seller_temp_invoice\" then GetInboxText(atbmi); DeleteInboxItem(atbmi) else atbmi=atbmi+1 end");
            wManager.Wow.Helpers.Lua.LuaDoString("if atbmi==nil then atbmi=1 end atbni=GetInboxNumItems() if atbmi>atbni then atbmi=1 end atbit=GetInboxInvoiceInfo(atbmi) if atbit==\"seller_temp_invoice\" then GetInboxText(atbmi); DeleteInboxItem(atbmi) else atbmi=atbmi+1 end");
            Thread.Sleep(100); 
        }

 

Edited by Marsbar
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...