DanyBv

ComputerCraft Move Turtle

Dec 5th, 2015
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.51 KB | None | 0 0
  1. while true do
  2.   local sEvent, param = os.pullEvent("key")
  3.   if sEvent == "key" then
  4.       if param == 28 then
  5.           print("Stopped moving")
  6.           break
  7.       elseif param == 17 then
  8.         turtle.up()
  9.       elseif param == 31 then
  10.         turtle.down()
  11.       elseif param == 200 then
  12.         turtle.forward()
  13.       elseif param == 203 then
  14.         turtle.turnLeft()
  15.       elseif param == 205 then
  16.         turtle.turnRight()
  17.       elseif param == 208 then
  18.         turtle.back()
  19.       end
  20.   end
  21. end
Advertisement
Add Comment
Please, Sign In to add comment