Zugbug

Turtle Move

Jun 29th, 2013
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.93 KB | None | 0 0
  1. function intro()
  2.   term.clear()
  3.   term.setCursorPos(1,1)
  4.   print "Welcome to Zugbug's"
  5.   print "Navigation Utility "
  6.   print "-------------------"
  7.   print "  Navigate with:   "
  8.   print "        W          "
  9.   print "      A S D        "
  10.   print "|SHIFT||SPACE|"
  11. end
  12.  
  13. function outro()
  14.   print("Program exiting")
  15. end
  16.  
  17. intro()
  18. while true do
  19.   local event, b = os.pullEvent("key")
  20.   if     b == 20  then outro() break
  21.   elseif b == 17 then turtle.forward()
  22.   elseif b == 30 then turtle.turnLeft()
  23.   elseif b == 31 then turtle.back()
  24.   elseif b == 32 then turtle.turnRight()
  25.   elseif b == 42 then turtle.down()
  26.   elseif b == 57 then turtle.up()
  27.   elseif b == 18 then turtle.dig()
  28.   elseif b == 19 then turtle.place()
  29.   elseif b == 16 then turtle.attack()
  30.   elseif b == 2  then turtle.select(1)
  31.   elseif b == 3  then turtle.select(2)
  32.   elseif b == 4  then turtle.select(3)
  33.   elseif b == 5  then turtle.select(4)
  34.   end
  35. end
Advertisement
Add Comment
Please, Sign In to add comment