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.

C# Lua to Multiple Variables

Featured Replies

So, I know you can do this

string name = Lua.LuaDoString<string>("name = UnitAura('player', 'BUFF_NAME'); return name; ");
string rank = Lua.LuaDoString<string>("name,rank = UnitAura('player', 'BUFF_NAME'); return rank; ");
string icon = Lua.LuaDoString<string>("name,rank,icon = UnitAura('player', 'BUFF_NAME'); return icon; ");
  //etc.. for all

Is there a better way to return all the different properties of UnitAura into c# variables?

If i see this example from Droidz (http://wrobot.eu/forums/topic/2493-luascript-in-is-complete-condition/), it's not possible

        int shipmentCapacity = wManager.Wow.Helpers.Lua.LuaDoString<int>("local name, texture, shipmentCapacity, shipmentsTotal, creationTime, duration, timeLeftString, itemName, itemIcon, itemQuality, itemID = C_Garrison.GetLandingPageShipmentInfo(); return shipmentCapacity;");
        int shipmentsTotal = wManager.Wow.Helpers.Lua.LuaDoString<int>("local name, texture, shipmentCapacity, shipmentsTotal, creationTime, duration, timeLeftString, itemName, itemIcon, itemQuality, itemID = C_Garrison.GetLandingPageShipmentInfo(); return shipmentsTotal;");
        return shipmentsTotal >= shipmentCapacity;

I tried to return in a structure or in a Tuple, but that is not possible too

Hello, like this:

        var r = Lua.LuaDoString<List<string>>(
            string.Format(@"local name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, canStealOrPurge, shouldConsolidate, spellId, canApplyAura, isBossDebuff, isCastByPlayer = UnitAura('player', 'BUFF_NAME');
                            return name .. '{0}' .. rank .. '{0}' .. icon;", Lua.ListSeparator));

        if (r != null && r.Count == 3)
        {
            var name = r[0];
            var rank = r[1];
            var icon = r[2];
        }

 

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.