From 2619277baf17068c0aba6a0330fe2bba10208e4c Mon Sep 17 00:00:00 2001
From: Allanis <allanis@saracraft.net>
Date: Sun, 3 Feb 2013 14:10:13 +0000
Subject: [PATCH] [Change] Playing with Lua script a little.

---
 scripts/ai/test.lua | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/scripts/ai/test.lua b/scripts/ai/test.lua
index 4a9cbd3..f64f3e6 100644
--- a/scripts/ai/test.lua
+++ b/scripts/ai/test.lua
@@ -1,4 +1,21 @@
-function control(pilot)
-  accel(1)
+function follow()
+  face(1,1)
+end
+
+function goto()
+  v = gettarget()
+  face(v)
+
+  d = getdist(v)
+  if d < minbrakedist()*1.05 then
+    poptask()
+  else
+    accel(1)
+  end
+end
+
+function control()
+  pushtask(0, "follow");
+  --pushtask(0, "goto", createvect(1000, 0));
 end