Skip to content
View in the app

A better way to browse. Learn more.

WRobot

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How can I run Lua.LuaString a set amount of times?

Featured Replies

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" });

 

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;");

 

  • 2 months later...
  • 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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.