Index: trunk/src/lib/util/executor/executor_lua.cc
===================================================================
--- trunk/src/lib/util/executor/executor_lua.cc	(revision 8055)
+++ trunk/src/lib/util/executor/executor_lua.cc	(revision 8057)
@@ -18,9 +18,17 @@
 #include "executor_lua.h"
 
-template<> bool fromLua<bool>(lua_state* state) { return lua_tonumber(state); };
-template<> int fromLua<int>(lua_state* state);
-template<> unsigned int fromLua<unsigned int>(lua_state* state);
-template<> float fromLua<float>(lua_state* state);
-template<> char fromLua<char>(lua_state* state);
-template<> const std::string& fromLua<const std::string&>(lua_state* state);
+template<> bool fromLua<bool>(lua_state* state, int index) { return lua_toboolean(state, index); };
+template<> int fromLua<int>(lua_state* state, int index) { return (int)lua_toumber(state, index); };
+template<> unsigned int fromLua<unsigned int>(lua_state* state, int index) { return (unsigned int)lua_tonumber(state, index); };
+template<> float fromLua<float>(lua_state* state, int index) { return (float)lua_tonumber(state, index); };
+template<> char fromLua<char>(lua_state* state, int index) { reutnr (char)lua_tonumber(state, index); };
+template<> const std::string& fromLua<const std::string&>(lua_state* state, int index) { return lua_tostring(state, index); };
 
+
+
+template<> void toLua<bool>(lua_state* state, bool value) { lua_pushboolean(state, (int) value); };
+template<> void toLua<int>(lua_state* state, int value)  { lua_pushnumber(state, (lua_Number) value); };
+template<> void toLua<unsigned int>(lua_state* state, unsigned int value){ lua_pushnumber(state, (lua_Number) value); };
+template<> void toLua<float>(lua_state* state, float value) { lua_pushnumber(state, (lua_Number) value); };
+template<> void toLua<char>(lua_state* state, char value) { lua_pushnumber(state, (lua_Number) value); };
+template<> void toLua<const std::string&>(lua_state* state, const std::string& value) {lua_pushstring (state, value.c_str()); }
Index: trunk/src/lib/util/executor/executor_lua.h
===================================================================
--- trunk/src/lib/util/executor/executor_lua.h	(revision 8055)
+++ trunk/src/lib/util/executor/executor_lua.h	(revision 8057)
@@ -14,11 +14,20 @@
 
 
-template<typename type> type fromLua(lua_state* state) { PRINTF(1)("NOT IMPLEMENTED\n"); };
-template<> bool fromLua<bool>(lua_state* state);
-template<> int fromLua<int>(lua_state* state);
-template<> unsigned int fromLua<unsigned int>(lua_state* state);
-template<> float fromLua<float>(lua_state* state);
-template<> char fromLua<char>(lua_state* state);
-template<> const std::string& fromLua<const std::string&>(lua_state* state);
+template<typename type> type fromLua(lua_state* state, int index) { PRINTF(1)("NOT IMPLEMENTED\n"); };
+template<> bool fromLua<bool>(lua_state* state, int index);
+template<> int fromLua<int>(lua_state* state, int index);
+template<> unsigned int fromLua<unsigned int>(lua_state* state, int index);
+template<> float fromLua<float>(lua_state* state, int index);
+template<> char fromLua<char>(lua_state* state, int index);
+template<> const std::string& fromLua<const std::string&>(lua_state* state, int index);
+
+
+template<typename type> void toLua(lua_state* state, type value) { PRINTF(1)("NOT IMPLEMENTED\n"); };
+template<> void toLua<bool>(lua_state* state, bool value);
+template<> void toLua<int>(lua_state* state, int value);
+template<> void toLua<unsigned int>(lua_state* state, unsigned int value);
+template<> void toLua<float>(lua_state* state, float value);
+template<> void toLua<char>(lua_state* state, char value);
+template<> void toLua<const std::string&>(lua_state* state, const std::string& value);
 
 // FORWARD DECLARATION
@@ -31,38 +40,38 @@
 template<class T> class ExecutorLua0 : public Executor
 {
-public:
-  /**
-   * @brief Constructor of a ExecutorXML
-   * @param function a Function to call
-   */
-  ExecutorLua0(void(T::*function)())
-      : Executor()
-  {
-    this->functionPointer = function;
-    this->functorType = Executor_Objective | Executor_NoLoadString;
-  }
+  public:
+    /**
+     * @brief Constructor of a ExecutorXML
+     * @param function a Function to call
+     */
+    ExecutorLua0(void(T::*function)())
+        : Executor()
+    {
+      this->functionPointer = function;
+      this->functorType = Executor_Objective | Executor_NoLoadString;
+    }
 
-  /**
-   * @brief executes the Command on BaseObject
-   * @param object the BaseObject to execute this Executor on
-   * @param loadString ignored in this case
-   */
-  virtual void operator()(BaseObject* object, const SubString& = SubString()) const
-  {
-    PRINTF(1)("no usefull executor\n");
-  }
+    /**
+     * @brief executes the Command on BaseObject
+     * @param object the BaseObject to execute this Executor on
+     * @param loadString ignored in this case
+     */
+    virtual void operator()(BaseObject* object, const SubString& = SubString()) const
+    {
+      PRINTF(1)("no usefull executor\n");
+    }
 
-  virtual void operator()(BaseObject* object, unsigned int count, void* values) const
-  {
-    (dynamic_cast<T*>(object)->*(functionPointer))();
-  }
+    virtual void operator()(BaseObject* object, unsigned int count, void* values) const
+    {
+      (dynamic_cast<T*>(object)->*(functionPointer))();
+    }
 
-  /**
-   * @returns a _new_ Copy of this Executor
-   */
-  virtual Executor* clone () const
-  {
-    return = new ExecutorLua0<T>(ExecutorLua0<T>(this->functionPointer));
-  }
+    /**
+     * @returns a _new_ Copy of this Executor
+     */
+    virtual Executor* clone () const
+    {
+      return = new ExecutorLua0<T>(ExecutorLua0<T>(this->functionPointer));
+    }
 };
 
@@ -76,10 +85,10 @@
 {
   public:
-  /**
-   * @brief Constructor of a ExecutorXML
-   * @param function a Function to call
-   */
+    /**
+     * @brief Constructor of a ExecutorXML
+     * @param function a Function to call
+     */
     ExecutorLua0(void(T::*function)(type0))
-  : Executor(ExecutorParamType<type0>())
+        : Executor(ExecutorParamType<type0>())
     {
       this->functionPointer = function;
@@ -87,9 +96,9 @@
     }
 
-  /**
-     * @brief executes the Command on BaseObject
-     * @param object the BaseObject to execute this Executor on
-     * @param loadString ignored in this case
-   */
+    /**
+       * @brief executes the Command on BaseObject
+       * @param object the BaseObject to execute this Executor on
+       * @param loadString ignored in this case
+     */
     virtual void operator()(BaseObject* object, const SubString& = SubString()) const
     {
@@ -100,12 +109,11 @@
     {
       lua_state* state = (lua_state*)values;
-      type0 value0 = lua_pop values
 
-      (dynamic_cast<T*>(object)->*(functionPointer))();
+      (dynamic_cast<T*>(object)->*(functionPointer))(fromLua<type0>(state, 1));
     }
 
-  /**
-     * @returns a _new_ Copy of this Executor
-   */
+    /**
+       * @returns a _new_ Copy of this Executor
+     */
     virtual Executor* clone () const
     {
@@ -115,3 +123,52 @@
 
 
+
+///////////
+//// 2 ////
+///////////
+//! Executes a Function with a lua_state* parameter.
+template<class T, typename type0, typename type1> class ExecutorLua1 : public Executor
+{
+  public:
+    /**
+     * @brief Constructor of a ExecutorXML
+     * @param function a Function to call
+     */
+    ExecutorLua0(void(T::*function)(type0, type1))
+        : Executor(ExecutorParamType<type0>(), ExecutorParamType<type1>())
+    {
+      this->functionPointer = function;
+      this->functorType = Executor_Objective | Executor_NoLoadString;
+    }
+
+    /**
+     * @brief executes the Command on BaseObject
+     * @param object the BaseObject to execute this Executor on
+     * @param loadString ignored in this case
+     */
+    virtual void operator()(BaseObject* object, const SubString& = SubString()) const
+    {
+      PRINTF(1)("no usefull executor\n");
+    }
+
+    virtual void operator()(BaseObject* object, unsigned int count, void* values) const
+    {
+      lua_state* state = (lua_state*)values;
+
+      (dynamic_cast<T*>(object)->*(functionPointer))(
+        fromLua<type0>(state, 1),
+        fromLua<type1>(state, 2) );
+    }
+
+    /**
+     * @returns a _new_ Copy of this Executor
+     */
+    virtual Executor* clone () const
+    {
+      return = new ExecutorLua0<T>(ExecutorLua0<T>(this->functionPointer));
+    }
+};
+
+
+
 #endif /* _EXECUTOR_SPECIALS_H */
