MrBottie 4 Posted November 9, 2016 Share Posted November 9, 2016 Hey all, Just want to know if it's possible to implement the lua code below into C# fight class and if it's possible, I want to know how to do it. Basically, I want to know the calculated "Time To Die" of my target. Lua Example https://github.com/BadBoy-Ultimate-Raider/BadBoy/blob/39eb9363599d3679bef5500ee5644877f350b9ce/System/engines/ttdTable.lua Thx in advance Link to comment https://wrobot.eu/forums/topic/4379-how-to-implement-lua-functions-in-c/ Share on other sites More sharing options...
Brian 10 Posted November 9, 2016 Share Posted November 9, 2016 Lua.LuaDoString<string>("UnitIsDead('target')") Link to comment https://wrobot.eu/forums/topic/4379-how-to-implement-lua-functions-in-c/#findComment-20210 Share on other sites More sharing options...
MrBottie 4 Posted November 9, 2016 Author Share Posted November 9, 2016 52 minutes ago, Brian said: Lua.LuaDoString<string>("UnitIsDead('target')") I know you can do this to retrieve a bool or a string or whatever you want but it's a bit more complicated than that Link to comment https://wrobot.eu/forums/topic/4379-how-to-implement-lua-functions-in-c/#findComment-20211 Share on other sites More sharing options...
Brian 10 Posted November 9, 2016 Share Posted November 9, 2016 1 hour ago, MrBottie said: I know you can do this to retrieve a bool or a string or whatever you want but it's a bit more complicated than that If you want to retrieve multiple values; a,b,c,d,e,f,g = Lua.LuaDoString<string>("UnitIsDead('target')); a,b,c.. are the respective values in order Link to comment https://wrobot.eu/forums/topic/4379-how-to-implement-lua-functions-in-c/#findComment-20215 Share on other sites More sharing options...
Pasterke 98 Posted November 9, 2016 Share Posted November 9, 2016 4 hours ago, Brian said: If you want to retrieve multiple values; a,b,c,d,e,f,g = Lua.LuaDoString<string>("UnitIsDead('target')); a,b,c.. are the respective values in order That way it's not possible. Or you use an foreach loop or an switch construction. But a,b,... stands for what ? Link to comment https://wrobot.eu/forums/topic/4379-how-to-implement-lua-functions-in-c/#findComment-20220 Share on other sites More sharing options...
Brian 10 Posted November 9, 2016 Share Posted November 9, 2016 3 hours ago, Pasterke said: That way it's not possible. Or you use an foreach loop or an switch construction. But a,b,... stands for what ? string name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable, shouldConsolidate, spellId = Lua.LuaDoString<string>("BuffStatus('target','Hunter's Mark')"); Link to comment https://wrobot.eu/forums/topic/4379-how-to-implement-lua-functions-in-c/#findComment-20230 Share on other sites More sharing options...
Pasterke 98 Posted November 9, 2016 Share Posted November 9, 2016 58 minutes ago, Brian said: string name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable, shouldConsolidate, spellId = Lua.LuaDoString<string>("BuffStatus('target','Hunter's Mark')"); You can try : string[] result = Lua.LuaDoString<string>("local name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable, shouldConsolidate, spellId=what you want to check",0); then result[0] should contains name, result[1] rank etc ... Link to comment https://wrobot.eu/forums/topic/4379-how-to-implement-lua-functions-in-c/#findComment-20231 Share on other sites More sharing options...
Brian 10 Posted November 9, 2016 Share Posted November 9, 2016 1 hour ago, Pasterke said: You can try : string[] result = Lua.LuaDoString<string>("local name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable, shouldConsolidate, spellId=what you want to check",0); then result[0] should contains name, result[1] rank etc ... This is for OP, not for me :P, I use it just fine Link to comment https://wrobot.eu/forums/topic/4379-how-to-implement-lua-functions-in-c/#findComment-20234 Share on other sites More sharing options...
MrBottie 4 Posted November 10, 2016 Author Share Posted November 10, 2016 11 hours ago, Pasterke said: You can try : string[] result = Lua.LuaDoString<string>("local name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable, shouldConsolidate, spellId=what you want to check",0); then result[0] should contains name, result[1] rank etc ... I just want to know if it's possible to integrate the Time To Die LUA functions above in C# And if so... how? :) Link to comment https://wrobot.eu/forums/topic/4379-how-to-implement-lua-functions-in-c/#findComment-20338 Share on other sites More sharing options...
Droidz 2738 Posted November 29, 2016 Share Posted November 29, 2016 Hello, like this: bool isDead = Lua.LuaDoString<bool>("return UnitIsDead('target')"); string spellName = Lua.LuaDoString<string>("local name, rank, icon, castingTime, minRange, maxRange, spellID = GetSpellInfo(1); return name;"); // only in next wrobot version List<string> returnGetSpellInfo = Lua.LuaDoString<List<string>>("return GetSpellInfo(1);"); string spellName2 = returnGetSpellInfo[0]; Link to comment https://wrobot.eu/forums/topic/4379-how-to-implement-lua-functions-in-c/#findComment-21140 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