Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local control = 111
- local objects = {"Turtle", "Dirt", "Sand", "Stone"}
- rednet.open("right")
- while true do
- id, msg = rednet.receive()
- if id == control then
- command = loadstring(msg)
- command()
- front = "Unknown"
- if turtle.detect() then
- for i = 1, #objects do
- turtle.select(i)
- if turtle.compare() then
- front = objects[i]
- break
- end
- end
- else
- front = "Air"
- end
- if front == "Turtle" then
- turtle.dig()
- end
- up = "Unknown"
- if turtle.detectUp() then
- for i = 1, #objects do
- turtle.select(i)
- if turtle.compareUp() then
- up = objects[i]
- break
- end
- end
- else
- up = "Unknown"
- end
- if up == "Turtle" then
- turtle.digUp()
- end
- down = "Unknown"
- if turtle.detectDown() then
- for i = 1, #objects do
- turtle.select(i)
- if turtle.compareDown() then
- down = objects[i]
- break
- end
- end
- else
- down = "Air"
- end
- if down == "Turtle" then
- turtle.digDown()
- end
- toSend = textutils.serialize({r, front, up, down})
- rednet.send(control, toSend)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement