Index: branches/script_engine/src/lib/script_engine/example.cc
===================================================================
--- branches/script_engine/src/lib/script_engine/example.cc	(revision 8214)
+++ branches/script_engine/src/lib/script_engine/example.cc	(revision 8231)
@@ -6,4 +6,7 @@
 #include "script.h"
 
+// create classdummys for the scripts
+CREATE_SCRIPTABLE_CLASS(Account, CL_ACCOUNT)
+CREATE_SCRIPTABLE_CLASS(Object, CL_TEST_OBJECT)
 
     class Account : public BaseObject {
@@ -81,61 +84,63 @@
     int main(int argc, char *argv[])
     {
-      Script script;
-      printf("-------------------------- top of the stack:%i\n",lua_gettop(script.getLuaState()));
+      std::string file("lunartest2.lua");
+     // Script script;
+      Script* script = ScriptManager::getInstance()->getScriptByFile(file);
+      printf("-------------------------- top of the stack:%i\n",lua_gettop(script->getLuaState()));
 
       // Register classes with the script
-      Lunar<Account>::Register(&script);
-      Lunar<Object>::Register(&script);
+      // Lunar<Account>::Register(&script);
+      //Lunar<Object>::Register(&script);
 
-      Object* obj= new Object();
-      Account a;
-      Account *b = new Account(30);
+      //Object* obj= new Object();
+      //Account a;
+      //Account *b = new Account(30);
 
       // Add instances to the script
-      Lunar<Object>::insertObject(&script,obj,"Obj",true);
-      Lunar<Account>::insertObject(&script,&a,"a",false);
-      Lunar<Account>::insertObject(&script,b,"b",true);
-       printf("-------------------------- top of the stack:%i\n",lua_gettop(script.getLuaState()));
+      //Lunar<Object>::insertObject(&script,obj,"Obj",true);
+      //Lunar<Account>::insertObject(&script,&a,"a",false);
+      //Lunar<Account>::insertObject(&script,b,"b",true);
+       //printf("-------------------------- top of the stack:%i\n",lua_gettop(script.getLuaState()));
 
       //Load a file
-      std::string file(argv[1]);
+      //std::string file("lunartest2.lua");
 
-      if(script.loadFile(file))
-        printf("File %s succefully loaded\n", file.c_str());
-      printf("-------------------------- top of the stack:%i\n",lua_gettop(script.getLuaState()));
+      //if(script.loadFile(file))
+        //printf("File %s succefully loaded\n", file.c_str());
+      //printf("-------------------------- top of the stack:%i\n",lua_gettop(script.getLuaState()));
 
       //execute a function
       printf("----------- main -----------\n");
       std::string main("main");
-      if( script.selectFunction(main,3))
+      if( script->selectFunction(main,3))
        printf("function %s selected\n",main.c_str());
 
-      script.pushParam(3.14159,main);
-      script.executeFunction();
+      script->pushParam(3.14159,main);
+      script->executeFunction();
 
-      float retf = script.getReturnedFloat();
+      float retf = script->getReturnedFloat();
       printf("main returned %f\n",retf);
 
 
-      if(script.getReturnedBool())
+      if(script->getReturnedBool())
        printf("main returned true\n");
       else
        printf("main returned false\n");
 
-      int ret = script.getReturnedInt();
+      int ret = script->getReturnedInt();
       printf("main returned %i\n",ret);
 
-      printf("-------------------------- top of the stack:%i\n",lua_gettop(script.getLuaState()));
+      //printf("-------------------------- top of the stack:%i\n",lua_gettop(script.getLuaState()));
       //execute a 2nd function
       printf("----------- test -----------\n");
       std::string test("test");
-      if( script.selectFunction(test,0))
+      if( script->selectFunction(test,0))
        printf("function %s selected\n",test.c_str());
 
-      script.executeFunction();
+      script->executeFunction();
 
 
       //if(argc>1) lua_dofile(script.getLuaState(), argv[1]);
-      printf("-------------------------- top of the stack:%i\n",lua_gettop(script.getLuaState()));
+      printf("-------------------------- top of the stack:%i\n",lua_gettop(script->getLuaState()));
 
       return 0;
Index: branches/script_engine/src/lib/script_engine/script.cc
===================================================================
--- branches/script_engine/src/lib/script_engine/script.cc	(revision 8214)
+++ branches/script_engine/src/lib/script_engine/script.cc	(revision 8231)
@@ -12,5 +12,5 @@
 {
   this->setClassID(CL_SCRIPT, "Script");
-  
+
   returnCount = argumentCount = 0;
 
@@ -23,5 +23,5 @@
   luaopen_math(luaState);
   luaopen_debug(luaState);
-  
+
   if (root != NULL)
     this->loadParams(root);
@@ -39,5 +39,5 @@
 {
   BaseObject::loadParams(root);
-  
+
   LOAD_PARAM_START_CYCLE(root, object);
   {
@@ -89,5 +89,5 @@
  }
 
- 
+
  void Script::addObject(const std::string& className, const std::string& objectName)
  {
@@ -96,10 +96,10 @@
    if (scriptClass != NULL)
    {
+     tmpObj.type = className;
      if( !classIsRegistered(className) )
      {
      static_cast<ScriptClass*>(scriptClass)->registerClass(this);
-     tmpObj.type = className;
-     }
-     
+     }
+
      BaseObject* object = ClassList::getObject(objectName, className);
      if (object != NULL && !objectIsAdded(objectName))
@@ -112,10 +112,11 @@
  }
 
- 
- 
- 
+
+
+
  bool Script::executeFile()
  {
-   if(currentFile.length() != 0)
+   printf("WARNING: script.executeFile is not implemented yet");
+   /*if(currentFile.length() != 0)
    {
     int error = lua_pcall(luaState, 0, 0, 0);
@@ -127,5 +128,5 @@
        return false;
       }
-   }
+ }*/
    return false;
  }
@@ -299,5 +300,5 @@
  }
 
- 
+
  bool Script::classIsRegistered(const std::string& type)
  {
@@ -311,7 +312,7 @@
    return false;
  }
- 
- 
- 
+
+
+
  bool Script::objectIsAdded(const std::string& name)
  {
@@ -324,5 +325,5 @@
    }
    return false;
- 
- 
- }
+
+
+ }
