Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sign = peripheral.wrap("right")
- while true do
- if turtle.detect() then
- text1,text2,text3,text4 = sign.read()
- if text1 == "Left" or text1 == "left" or text1 == "LEFT" then
- turtle.turnLeft()
- turtle.forward()
- elseif text1 == "Right" or text1 == "right" or text1 == "RIGHT" then
- turtle.turnRight()
- turtle.forward()
- elseif text1 == "Stop" or text1 == "stop" or text1 == "STOP" then
- break
- elseif text1 == "Break" or text1 == "break" or text1 == "BREAK" then
- turtle.dig()
- turtle.forward()
- turtle.dig()
- turtle.back()
- turtle.place("Stop")
- elseif text1 == "Forward" or text1 == "forward" or text1 == "FORWARD" then
- turtle.dig()
- turtle.forward()
- elseif test1 == "Back" or text1 == "back" or text1 == "BACK" then
- turtle.back()
- elseif text1 == "Up" or text1 == "up" or text1 == "UP" then
- turtle.digUp()
- turtle.up()
- elseif text1 == "Down" or text1 == "down" or text1 == "DOWN" then
- turtle.digDown()
- turtle.down()
- elseif text1 == "Dance" or text1 == "dance" or text1 == "DANCE" then
- shell.run("dance")
- elseif text1 == "Craft" or text1 == "craft" or text1 == "CRAFT" then
- turtle.craft()
- elseif text1 == "Place" or text1 == "place" or text1 == "PLACE" then
- if text2 ~= nil then
- text2 = tonumber(text2)
- turtle.select(text2)
- end
- if text3 ~= nil and text4 == nil then
- turtle.dig()
- turtle.place(text3)
- elseif text3 == nil and text4 == nil then
- turtle.dig()
- turtle.place()
- elseif text3 ~= nil and text4 ~= nil then
- if text4 == "right" or text4 == "Right" or text4 == "RIGHT" then
- turtle.turnRight()
- turtle.place(text3)
- turtle.turnLeft()
- elseif text4 == "left" or text4 == "Left" or text4 == "LEFT" then
- turtle.turnLeft()
- turtle.place(text3)
- turtle.turnRight()
- elseif text4 == "up" or text4 == "Up" or text4 == "UP" then
- turtle.placeUp(text3)
- elseif text4 == "down" or text4 == "Down" or text4 == "DOWN" then
- turtle.placeDown(text3)
- end
- turtle.dig()
- elseif text3 == nil and text4 ~= nil then
- if text4 == "right" or text4 == "Right" or text4 == "RIGHT" then
- turtle.turnRight()
- turtle.place()
- turtle.turnLeft()
- elseif text4 == "left" or text4 == "Left" or text4 == "LEFT" then
- turtle.turnLeft()
- turtle.place()
- turtle.turnRight()
- elseif text4 == "up" or text4 == "Up" or text4 == "UP" then
- turtle.placeUp()
- elseif text4 == "down" or text4 == "Down" or text4 == "DOWN" then
- turtle.placeDown()
- end
- turtle.dig()
- end
- print(text1)
- else
- error(text1.." is an unrecognised Sign Command.")
- end
- else
- error("No sign found.")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement