twbp 0 Posted November 26, 2018 Share Posted November 26, 2018 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 https://wrobot.eu/forums/topic/10433-how-to-runmacrolua-on-a-loop-for-a-certain-amount-of-times/ Share on other sites More sharing options...
Droidz 2738 Posted November 26, 2018 Share Posted November 26, 2018 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 https://wrobot.eu/forums/topic/10433-how-to-runmacrolua-on-a-loop-for-a-certain-amount-of-times/#findComment-49552 Share on other sites More sharing options...
twbp 0 Posted November 26, 2018 Author Share Posted November 26, 2018 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 https://wrobot.eu/forums/topic/10433-how-to-runmacrolua-on-a-loop-for-a-certain-amount-of-times/#findComment-49553 Share on other sites More sharing options...
Droidz 2738 Posted November 26, 2018 Share Posted November 26, 2018 yes you can Link to comment https://wrobot.eu/forums/topic/10433-how-to-runmacrolua-on-a-loop-for-a-certain-amount-of-times/#findComment-49554 Share on other sites More sharing options...
twbp 0 Posted November 26, 2018 Author Share Posted November 26, 2018 Thanks for the help Droidz!!! Link to comment https://wrobot.eu/forums/topic/10433-how-to-runmacrolua-on-a-loop-for-a-certain-amount-of-times/#findComment-49556 Share on other sites More sharing options...
twbp 0 Posted November 26, 2018 Author Share Posted November 26, 2018 for (int i = 0; i < 100; i++) { 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"); 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 https://wrobot.eu/forums/topic/10433-how-to-runmacrolua-on-a-loop-for-a-certain-amount-of-times/#findComment-49557 Share on other sites More sharing options...
Marsbar 228 Posted November 26, 2018 Share Posted November 26, 2018 (edited) 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 November 26, 2018 by Marsbar Link to comment https://wrobot.eu/forums/topic/10433-how-to-runmacrolua-on-a-loop-for-a-certain-amount-of-times/#findComment-49558 Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now