Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if peripheral.getType("right") == "modem" then
- rednet.open("right") print("Enabled the modem on the Right side")
- else
- rednet.open("left") print("Enabled the modem on the Left side")
- end
- local function placeWell()
- while turtle.detect() do
- turtle.select(4)
- turtle.dig()
- sleep(0.3)
- end
- turtle.select(1)
- turtle.place()
- end
- local function placeChest()
- while turtle.detectUp() do
- turtle.select(5)
- turtle.digUp()
- sleep(0.3)
- end
- turtle.up()
- turtle.select(2)
- turtle.placeDown()
- end
- local function placeEnergy()
- while turtle.detect() do
- turtle.select(6)
- turtle.dig()
- sleep(0.3)
- end
- turtle.select(3)
- turtle.place()
- end
- local function unload()
- for e = 4,8 do
- turtle.select(e)
- turtle.dropDown()
- end
- end
- local function workDone()
- turtle.select(3)
- turtle.dig()
- turtle.select(2)
- turtle.digDown()
- turtle.down()
- turtle.select(1)
- turtle.dig()
- turtle.forward()
- end
- while true do
- id,message = rednet.receive()
- if message == "start" then
- placeWell()
- placeChest()
- placeEnergy()
- end
- if message == "unload" then
- unload()
- end
- if message == "done" then
- workDone()
- end
- if message == "left" then
- turtle.turnLeft()
- end
- if message == "move" then
- while not turtle.forward() do
- sleep(0.1)
- end
- end
- if message == "back" then
- turtle.back()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement