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.

LUA retval INT

Featured Replies

Hello everybody,

im new here and im trying to convert my LUA Fightclasses in the right way to make it work with the Bot Core.

function isFrencyStack5()
    luacode = "francymax = 0; for i=1,40 do local _,_,_,c,_,_,_,_,_,_,s = UnitAura('player',i); if s==19615 and c==5 then francymax = 1 break end end" 
   if  tonumber(WowLuaDoLocalizedString(luacode, 'francymax'))==1 then
       return true
   else
       return false
   end
end

How do you guys inject that string code and get a retval to get that function to work?

 

Greez  Galvanar

On 30.10.2017 at 9:44 PM, Galvanar said:

Hello everybody,

im new here and im trying to convert my LUA Fightclasses in the right way to make it work with the Bot Core.


function isFrencyStack5()
    luacode = "francymax = 0; for i=1,40 do local _,_,_,c,_,_,_,_,_,_,s = UnitAura('player',i); if s==19615 and c==5 then francymax = 1 break end end" 
   if  tonumber(WowLuaDoLocalizedString(luacode, 'francymax'))==1 then
       return true
   else
       return false
   end
end

How do you guys inject that string code and get a retval to get that function to work?

 

Greez  Galvanar

tonumber(WowLuaDoLocalizedString(luacode, 'francymax'))==1 then
To
Lua.DoString<int>(luacode, "francymax") == 1 then

Since you are just looking for a boolean you also could make it like this

function isFrencyStack5()
    luacode = "francymax = 0; for i=1,40 do local _,_,_,c,_,_,_,_,_,_,s = UnitAura('player',i); if s==19615 and c==5 then francymax = 1 break end end" 
    return Lua.DoString<int>(luacode, "francymax") == 1;
    // Or as bool since its 0 or 1
    return Lua.DoString<bool>(luacode, "francymax");
end


 

Edited by iMod

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.