DanyBv icon

ComputerCraft Move Turtle

DanyBv | PRO | 12/06/15 12:09:37 AM UTC | 0 ⭐ | 291 👁️ | Never ⏰ | []
Lua |

510 B

|

None

|

0 👍

/

0 👎

while true do
  local sEvent, param = os.pullEvent("key")
  if sEvent == "key" then
      if param == 28 then
          print("Stopped moving")
          break
      elseif param == 17 then
        turtle.up()
      elseif param == 31 then
        turtle.down()
      elseif param == 200 then
        turtle.forward()
      elseif param == 203 then
        turtle.turnLeft()
      elseif param == 205 then
        turtle.turnRight()
      elseif param == 208 then
        turtle.back()
      end
  end
end

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎