January 25, 20179 yr 18 minutes ago, Zan said: How can i run Lua.LuaDoString 5 times rather than have 5 lines in my code? i'm not sure and did not test it but try Lua.LuaDoString(new List<string>() { "FirstCommand", "Second command", "ThirdCommand" });
January 25, 20179 yr Hello, iMod method is good, but you can also use @ http://net-informations.com/q/faq/multilines.html (method 1) like: int numberPetAlive = Lua.LuaDoString<int>(@" local aliveCount = 0; for p=1, 3 do local petID, ability1ID, ability2ID, ability3ID, locked = C_PetJournal.GetPetLoadOutInfo(p); if petID then local health, maxHealth, _ = C_PetJournal.GetPetStats(petID); if health > 0 then aliveCount = aliveCount + 1; end end end return aliveCount;");
April 25, 20178 yr Author I found an easy way that could be used universally with c#: private static void RepeatAction(int repeatCount, Action action) { for (int i = 0; i < repeatCount; i++) action(); } Then in the profile: RepeatAction(5, () => { // Action to repeat 5 times. });
Create an account or sign in to comment