Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
lua_State *lua_open (int initialStackSize);
#include <stdio.h>#include <lua.h> int main(int argc, char* argv[ ]){?? lua_State* luaVM = lua_open(0); ?? if (NULL == luaVM)?? {??????printf("Error Initializing lua\n");??????return -1;?? } ?? return 0;}
extern "C"{?? ?}
#include <stdio.h>extern "C"{ #include <lua.h>} int main(int argc, char* argv[ ]){?? lua_State* luaVM = lua_open(0); ?? if (NULL == luaVM)?? {??????printf("Error Initializing lua\n");??????return -1;?? } ?? return 0;}
void lua_close (lua_State *openState);
#include <stdio.h>extern "C"{ #include <lua.h>} int main(int argc, char* argv[ ]){?? lua_State* luaVM = lua_open(0); ?? if (NULL == luaVM)?? {??????printf("Error Initializing lua\n");??????return -1;?? } ?? // Do stuff with lua code.?????? lua_close( luaVM ); ?? return 0;}
#include <stdio.h>extern "C"{ #include <lua.h>} int main(int argc, char* argv[ ]){?? lua_State* luaVM = lua_open(0); ?? if (NULL == luaVM)?? {??????printf("Error Initializing lua\n");??????return -1;?? } ?? // Do stuff with lua code.?????? char* strLuaInput = "a = 1 + 1;\n"; ?? lua_dostring(luaVM, strLuaInput); ?? lua_close(luaVM);?? ?? return 0;}
#include <stdio.h>extern "C"{ #include <lua.h>}?int main(int argc, char* argv[ ]){?? lua_State* luaVM = lua_open(0); ?? if (NULL == luaVM)?? {??????printf("Error Initializing lua\n");??????return -1;?? } ?? // Do stuff with lua code.?????? char* strLuaInput = "a = 1 + 1;\nprint( a);\n"; ?? lua_dostring(luaVM, strLuaInput); ?? lua_close(luaVM);?? ?? return 0;}
#include <stdio.h>extern "C"{ #include <lua.h> #include <lualib.h>} int main(int argc, char* argv[ ]){?? lua_State* luaVM = lua_open(0); ?? if (NULL == luaVM)?? {??????printf("Error Initializing lua\n");??????return -1;?? } ?? // initialize lua standard library functions??? lua_baselibopen(luaVM);?? lua_iolibopen(luaVM);?? lua_strlibopen(luaVM);?? lua_mathlibopen(luaVM);??? // Do stuff with lua code.?????? char* strLuaInput = "a = 1 + 1;\nprint( a);\n"; ?? lua_dostring(luaVM, strLuaInput); ?? lua_close(luaVM);?? ??? return 0;}
#include <stdio.h>
extern "C"
{
#include <lua.h>
#include <lualib.h>
}
rarkenin wrote:You don't write a mod in C++. This isn't an NPC mod. This is just some C++ that basically compiles a Lua interpreter. Sorry, but this is not a working mod. It is some oseless code probably copy-pasted, judging by the lost characters. You also included the same LUA file in the textures folder. Why would you make a texture a Lua file?!Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
lua_State *lua_open (int initialStackSize);
#include <stdio.h>#include <lua.h> int main(int argc, char* argv[ ]){?? lua_State* luaVM = lua_open(0); ?? if (NULL == luaVM)?? {??????printf("Error Initializing lua\n");??????return -1;?? } ?? return 0;}
extern "C"{?? ?}
#include <stdio.h>extern "C"{ #include <lua.h>} int main(int argc, char* argv[ ]){?? lua_State* luaVM = lua_open(0); ?? if (NULL == luaVM)?? {??????printf("Error Initializing lua\n");??????return -1;?? } ?? return 0;}
void lua_close (lua_State *openState);
#include <stdio.h>extern "C"{ #include <lua.h>} int main(int argc, char* argv[ ]){?? lua_State* luaVM = lua_open(0); ?? if (NULL == luaVM)?? {??????printf("Error Initializing lua\n");??????return -1;?? } ?? // Do stuff with lua code.?????? lua_close( luaVM ); ?? return 0;}
#include <stdio.h>extern "C"{ #include <lua.h>} int main(int argc, char* argv[ ]){?? lua_State* luaVM = lua_open(0); ?? if (NULL == luaVM)?? {??????printf("Error Initializing lua\n");??????return -1;?? } ?? // Do stuff with lua code.?????? char* strLuaInput = "a = 1 + 1;\n"; ?? lua_dostring(luaVM, strLuaInput); ?? lua_close(luaVM);?? ?? return 0;}
#include <stdio.h>extern "C"{ #include <lua.h>}?int main(int argc, char* argv[ ]){?? lua_State* luaVM = lua_open(0); ?? if (NULL == luaVM)?? {??????printf("Error Initializing lua\n");??????return -1;?? } ?? // Do stuff with lua code.?????? char* strLuaInput = "a = 1 + 1;\nprint( a);\n"; ?? lua_dostring(luaVM, strLuaInput); ?? lua_close(luaVM);?? ?? return 0;}
#include <stdio.h>extern "C"{ #include <lua.h> #include <lualib.h>} int main(int argc, char* argv[ ]){?? lua_State* luaVM = lua_open(0); ?? if (NULL == luaVM)?? {??????printf("Error Initializing lua\n");??????return -1;?? } ?? // initialize lua standard library functions??? lua_baselibopen(luaVM);?? lua_iolibopen(luaVM);?? lua_strlibopen(luaVM);?? lua_mathlibopen(luaVM);??? // Do stuff with lua code.?????? char* strLuaInput = "a = 1 + 1;\nprint( a);\n"; ?? lua_dostring(luaVM, strLuaInput); ?? lua_close(luaVM);?? ??? return 0;}
#include <stdio.h>
extern "C"
{
#include <lua.h>
#include <lualib.h>
}
chase programer wrote:rarkenin wrote:You don't write a mod in C++. This isn't an NPC mod. This is just some C++ that basically compiles a Lua interpreter. Sorry, but this is not a working mod. It is some oseless code probably copy-pasted, judging by the lost characters. You also included the same LUA file in the textures folder. Why would you make a texture a Lua file?!
SNIP
i used this http://www.gamedev.net/page/resources/_/technical/game-programming/an-introduction-to-lua-r1932
chase programer wrote:OK
Users browsing this forum: No registered users and 50 guests