Index: code/branches/plehmannFS16/data/gui/scripts/testscript.lua
===================================================================
--- code/branches/plehmannFS16/data/gui/scripts/testscript.lua	(revision 11202)
+++ code/branches/plehmannFS16/data/gui/scripts/testscript.lua	(revision 11204)
@@ -23,7 +23,7 @@
 if ctrl ~= nil then
 
-  ctrl:printDebug()
-  ctrl:debugOut(5)
-  ctrl:stringOut(3, "hello")
+  ctrl:moveTo(1, 0, 0, 100, 200)
+  ctrl:moveTo(20, 0, 0, 100, 200)
+  ctrl:moveTo(40, 0, 100, 0, 200)
   --ctrl:eventScheduler("mal", xl,yl,zl, xl,yl,zl, 10)
   -- ctrl:eventScheduler("ral", xl, yl, zl, 3, 3000, 0, math.pi)
Index: code/branches/plehmannFS16/src/orxonox/controllers/ControllerDirector.h
===================================================================
--- code/branches/plehmannFS16/src/orxonox/controllers/ControllerDirector.h	(revision 11202)
+++ code/branches/plehmannFS16/src/orxonox/controllers/ControllerDirector.h	(revision 11204)
@@ -27,4 +27,10 @@
  */
 
+/*
+@todo:
+
+in the take control or preparationToTakeControl functions remove the former controller and store it somewhere so it can be put back later.
+
+*/
 #ifndef _ControllerDirector_H__
 #define _ControllerDirector_H__
Index: code/branches/plehmannFS16/src/orxonox/controllers/NewScriptController.cc
===================================================================
--- code/branches/plehmannFS16/src/orxonox/controllers/NewScriptController.cc	(revision 11202)
+++ code/branches/plehmannFS16/src/orxonox/controllers/NewScriptController.cc	(revision 11204)
@@ -46,4 +46,5 @@
 #include "scriptTasks/DebugTask.h"
 #include "scriptTasks/stringOutTask.h"
+#include "scriptTasks/MoveToTask.h"
 #include "scriptTasks/Task.h"
 #include "infos/PlayerInfo.h"
@@ -102,5 +103,5 @@
         this->setControllableEntity(this->entity_);
         this->entity_->mouseLook();
-        this->entity_->setVisible(false);
+        this->entity_->setVisible(true);
         
         // TODO take the human Controllers control  dont forget to give it back in the destructor
@@ -116,17 +117,4 @@
         // If this controller has no entity entry, do nothing 
         if( !(this->entity_) ) return;
-
-
-/*
-        if(taskQueue_.front()->getStartTime() <= scTime_)
-        {
-          activeTasks_.push_back(taskQueue_.front());
-          taskQueue_.pop();
-        }
-
-        for(Task* task : activeTasks_)
-        {
-          task->tick(dt);
-        }*/
 
         if(!this->taskList_.empty())
@@ -211,4 +199,43 @@
 
       task->initialize(startTime, output);
+
+      bool inserted = false;
+
+      if(taskList_.empty())
+      {
+        taskList_.push_front(task);
+        inserted = true;
+      }
+
+      else
+      {
+        for (std::list<Task*>::iterator it = taskList_.begin(); it != taskList_.end(); it++) // insert sorted by starttime
+        {
+          orxout() << "stringOutTask" << endl;
+
+          if(task->getStartTime() < (*it)->getStartTime() )
+          {
+            taskList_.insert(it, task);
+            inserted = true;
+            break;
+          }
+        }
+      }
+
+      if (!inserted)
+      {
+        taskList_.push_back(task);
+      }
+
+    }
+
+    void NewScriptController::moveTo(float startTime, float x, float y, float z, float velocity)
+    {
+
+      MoveToTask* task = new MoveToTask(context_);
+
+      Vector3 destination = Vector3(x,y,z);
+
+      task->initialize(startTime, player_, destination, velocity);
 
       bool inserted = false;
Index: code/branches/plehmannFS16/src/orxonox/controllers/NewScriptController.h
===================================================================
--- code/branches/plehmannFS16/src/orxonox/controllers/NewScriptController.h	(revision 11202)
+++ code/branches/plehmannFS16/src/orxonox/controllers/NewScriptController.h	(revision 11204)
@@ -25,4 +25,6 @@
  *      ...
  *
+ *
+ *
  */
 
@@ -32,4 +34,5 @@
 #include "scriptTasks/DebugTask.h"
 #include "scriptTasks/stringOutTask.h"
+#include "scriptTasks/MoveToTask.h"
 #include "scriptTasks/Task.h"
 #include "OrxonoxPrereqs.h"                 /* die ganzen tolua, kopiert aus Dock.h*/
@@ -42,5 +45,25 @@
 {  // tolua_export
 
+    /**
+    @brief
 
+    A scriptController to carry out tasks on an entity.
+    The tasks are provided as a lua script.
+    The commands which are exported to lua have to create the specified task, initialze it and add it to the TaskList.
+
+    Important add the export comment after functions that need to be accessed from the lua script.
+
+    @todo
+
+    take away the human controller and put it back into place when this controller is deleted.
+    This is probably better done in the controller director class.
+
+    remove the startTimes of the tasks so that the lua script is just carried out one task after the other.
+    to avoid problems when to tasks are carried out simultainiously.
+
+    also the velocity while the controller is taking control is kept and hinders the tasks.
+
+    the moveToTask does not work right.
+    */
 
     class _OrxonoxExport NewScriptController // tolua_export 
@@ -61,4 +84,6 @@
 
             void stringOut(float startTime, std::string output);// tolua_export
+
+            void moveTo(float startTime, float x, float y, float z, float velocity);// tolua_export
 
             static NewScriptController* getNewScriptController();// tolua_export 
Index: code/branches/plehmannFS16/src/orxonox/controllers/scriptTasks/CMakeLists.txt
===================================================================
--- code/branches/plehmannFS16/src/orxonox/controllers/scriptTasks/CMakeLists.txt	(revision 11202)
+++ code/branches/plehmannFS16/src/orxonox/controllers/scriptTasks/CMakeLists.txt	(revision 11204)
@@ -3,3 +3,4 @@
   DebugTask.cc
   stringOutTask.cc
+  MoveToTask.cc
 )
Index: code/branches/plehmannFS16/src/orxonox/controllers/scriptTasks/MoveToTask.cc
===================================================================
--- code/branches/plehmannFS16/src/orxonox/controllers/scriptTasks/MoveToTask.cc	(revision 11202)
+++ code/branches/plehmannFS16/src/orxonox/controllers/scriptTasks/MoveToTask.cc	(revision 11204)
@@ -23,5 +23,5 @@
  *      Paul Lehmann
  *   Co-authors:
- *      ...
+ *      ..
  *
  */
@@ -45,10 +45,13 @@
     void MoveToTask::initialize(float startTime, PlayerInfo* player, Vector3 destination, float velocity)
     {
-        this->starTime_ = startTime;
+        this->startTime_ = startTime;
         this->player_ = player;
         this->entity_ = this->player_->getControllableEntity();
         this->destination_ = destination;
         this->velocity_ = velocity;
-        this->entity->setVelocity( Vector3(0,0,0) )
+        this->entity_->setVelocity( Vector3(0,0,0) );
+        // unit vector in the direction of travel
+        this->direction_ = (destination - this->entity_->getPosition() )/( (destination - this->entity_->getPosition() ).length() );
+
     }
 
@@ -56,13 +59,21 @@
     {
 
-        float dl = this->velocity_ * dt;
+        /* Look at the specified position */
+        this->entity_->lookAt(this->destination_);  
 
-        
-        /* Set the position to the correct place in the trajectory */
-        this->entity_->setPosition( (1-dl)*startpos + dl * this->currentEvent.v1);
+        this->entity_->setPosition(this->entity_->getPosition() + velocity_ * dt * direction_);
 
-        /* Look at the specified position */
-        this->entity_->lookAt(this->currentEvent.v2);
+        //this->entity_->setVelocity( Vector3(0,0,0) );
 
+        orxout() << (this->entity_->getPosition() - destination_ ).length() << endl;
+
+        if ((this->entity_->getPosition() - destination_ ).length() > 30)
+        {
+            return true;
+        }
+        else
+        {
+            return false;
+        }
     }
 
Index: code/branches/plehmannFS16/src/orxonox/controllers/scriptTasks/MoveToTask.h
===================================================================
--- code/branches/plehmannFS16/src/orxonox/controllers/scriptTasks/MoveToTask.h	(revision 11202)
+++ code/branches/plehmannFS16/src/orxonox/controllers/scriptTasks/MoveToTask.h	(revision 11204)
@@ -43,5 +43,5 @@
             virtual ~MoveToTask(){}
 
-            void initialize(float startTime, PlayerInfo* player, vector3 destination);
+            void initialize(float startTime, PlayerInfo* player, Vector3 destination, float velocity);
 
             virtual bool update(float dt) override;
@@ -60,6 +60,9 @@
             ControllableEntity* entity_;
 
-            vector3 destination_;
+            Vector3 direction_;
 
+            Vector3 destination_;
+
+            // velocitz in m/s
             float velocity_;
 
