Changeset 8085 in orxonox.OLD for branches/script_engine/src/lib/script_engine/account.cc
- Timestamp:
- Jun 1, 2006, 5:07:28 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/script_engine/src/lib/script_engine/account.cc
r8080 r8085 91 91 { 92 92 Script script; 93 printf("-------------------------- top of the stack:%i\n",lua_gettop(script.getLuaState())); 93 94 94 95 // Register classes with the script … … 104 105 Lunar<Account>::insertObject(&script,&a,"a",false); 105 106 Lunar<Account>::insertObject(&script,b,"b",true); 106 107 107 printf("-------------------------- top of the stack:%i\n",lua_gettop(script.getLuaState())); 108 //Load a file 108 109 std::string file(argv[1]); 109 110 110 111 if(script.loadFile(file)) 111 112 printf("File %s succefully loaded\n", file.c_str()); 112 113 // script.executeFile();114 113 printf("-------------------------- top of the stack:%i\n",lua_gettop(script.getLuaState())); 114 //execute a function 115 printf("----------- main -----------\n"); 115 116 std::string main("main"); 116 117 if( script.selectFunction(main,3)) … … 131 132 int ret = script.getReturnedInt(); 132 133 printf("main returned %i\n",ret); 134 135 printf("-------------------------- top of the stack:%i\n",lua_gettop(script.getLuaState())); 136 //execute a 2nd function 137 printf("----------- test -----------\n"); 138 std::string test("test"); 139 if( script.selectFunction(test,0)) 140 printf("function %s selected\n",test.c_str()); 141 142 script.executeFunction(); 143 133 144 134 145 //if(argc>1) lua_dofile(script.getLuaState(), argv[1]); 146 printf("-------------------------- top of the stack:%i\n",lua_gettop(script.getLuaState())); 135 147 136 148 return 0;
Note: See TracChangeset
for help on using the changeset viewer.