Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open('back')
- turtleId = 0
- function ClearScreen()
- term.clear()
- term.setCursorPos(1,1)
- print("W = Forward, S = Backward")
- print("A = Left, D = Right")
- print("Q = Up, E = Down")
- print("Dig = Dig, DigUp = Dig Up, DigDown = Dig Down")
- print("Run (program) = Run Program")
- end
- function SendCommand(cmd)
- rednet.send(turtleId, cmd)
- ClearScreen()
- print(cmd)
- end
- ClearScreen()
- while true do
- input = read()
- if input == "w" then
- SendCommand("turtle.forward()")
- elseif input == "s" then
- SendCommand("turtle.backward()")
- elseif input == "a" then
- SendCommand("turtle.turnLeft()")
- elseif input == "d" then
- SendCommand("turtle.turnRight()")
- elseif input == "q" then
- SendCommand("turtle.up()")
- elseif input == "E" then
- SendCommand("turtle.down()")
- elseif input == "dig" then
- SendCommand("turtle.dig()")
- elseif input == "digUp" then
- SendCommand("turtle.digUp()")
- elseif input == "digDown" then
- SendCommand("turtle.digDown()")
- elseif string.find(input, "run")then
- SendCommand(string.sub(input, 5))
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement