Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- side = "right"
- rednet.open(side)
- while true do
- print("Listening for a message...")
- local id, message = rednet.receive()
- -- print info about command and who sent it
- write("Recieved command: ")
- write(message)
- write(" From: ")
- print(id)
- -- quit if they want to quit
- if message == "quit" then
- break
- -- run if they type run
- elseif message == "mine" then
- print("Mining a column!")
- -- do the minging down
- local downCount = 0
- while downCount < 95 do
- if turtle.getFuelLevel() < 10 then
- turtle.refuel()
- end
- turtle.digDown()
- if turtle.down() then
- downCount = downCount + 1
- end
- end
- -- come back to the top
- local upCount = 0
- while upCount < 95 do
- if turtle.up() then
- upCount = upCount + 1
- end
- end
- -- move forward 4 blocks
- local count = 0
- while count ~= 2 do
- if turtle.forward() then
- count = count + 1
- end
- end
- -- invalid command otherwise
- else
- print("Invalid command!")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement