Advertisement
Terrah

nwnx_lua_nw

Sep 13th, 2015
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. //Runs a lua chunk
  2. string ExecuteLuaString( object oObjSelf, string sLua );
  3.  
  4. //Run a lua function
  5. string ExecuteLuaFunction( object oObjSelf, string sFunc, string sParam );
  6.  
  7. //Return the object that was previously set in luascript
  8. //Index 0 target 1
  9. //Index 1 target 2
  10. //Index 3 target set by lua SetObject
  11. object LuaGetObject(int index);
  12.  
  13. object LuaGetObject(int index){
  14.  
  15. return GetLocalObject(OBJECT_SELF,"NWNX!LUA!"+IntToString(index));
  16. }
  17.  
  18. string ExecuteLuaFunction( object oObjSelf, string sFunc, string sParam ){
  19.  
  20. SetLocalString( oObjSelf, "NWNX!LUA!"+sFunc, sParam+"| " );
  21. string sLua = GetLocalString( oObjSelf, "NWNX!LUA!"+sFunc );
  22. DeleteLocalString( oObjSelf, "NWNX!LUA!"+sFunc );
  23. return sLua;
  24. }
  25.  
  26. string ExecuteLuaString( object oObjSelf, string sLua ){
  27.  
  28. SetLocalString( oObjSelf, "NWNX!LUA!sexec", sLua+"| " );
  29. sLua = GetLocalString( oObjSelf, "NWNX!LUA!sexec" );
  30. DeleteLocalString( oObjSelf, "NWNX!LUA!sexec" );
  31. return sLua;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement