Andy73

testai.lua (pc)

May 11th, 2014
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.53 KB | None | 0 0
  1. local tickNumber=0
  2. while true do
  3.     tickNumber=tickNumber+1
  4.    
  5.     print("AI:Tick--------------#"..tickNumber)
  6.     refuel(test)
  7.     local res=test:go(world)
  8.    
  9.     if res=="out of fuel" then printError("Out of fuel") break end
  10.     if res==true then
  11.         print("AI:Updating position to")
  12.         print(serialize(test.pos))
  13.         printError("Updated fuel level:"..test.fuel)
  14.     elseif res=="can't reach destination" then
  15.         test:turnLeft()
  16.         print("AI:Updating rotation to")
  17.         print(test.rot)
  18.     else
  19.         printError("unknown")
  20.         break
  21.     end
  22.     updateUI()
  23. end
Advertisement
Add Comment
Please, Sign In to add comment