Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function turnLeft()
- for c=1, x+3 do
- turtle.dig()
- turtle.forward()
- end
- turtle.turnLeft()
- for c=1, 3+x do
- turtle.dig()
- turtle.forward()
- end
- end
- function turnRight()
- for c=1, 3-x do
- turtle.dig()
- turtle.forward()
- end
- turtle.turnLeft()
- for c=1, 3-x do
- turtle.dig()
- turtle.forward()
- end
- end
- function forward()
- turtle.dig()
- turtle.forward()
- end
- function up()
- while true do
- if turtle.detectUp() then
- a, b = turtle.inspectUp()
- if not (b.name == "ComputerCraft:CC-Turtle") then
- turtle.digUp()
- break
- end
- else
- break
- end
- end
- turtle.up()
- end
- function down()
- while true do
- if turtle.detectDown() then
- a, b = turtle.inspectDown()
- if not (b.name == "ComputerCraft:CC-Turtle") then
- turtle.digDown()
- break
- end
- else
- break
- end
- end
- turtle.down()
- end
- if turtle then
- rednet.open("right")
- print("Awaiting identification")
- source, x = rednet.receive()
- source, y = rednet.receive()
- print("I am turtle (" .. tostring(x) .. ", " .. tostring(y) .. ")")
- turtle.select(1)
- turtle.suckUp(64)
- turtle.refuel(64)
- turtle.forward()
- turtle.forward()
- turtle.up()
- turtle.up()
- turtle.up()
- turtle.up()
- if not (x == 0) then
- if x > 0 then
- turtle.turnLeft()
- print("going left")
- else
- turtle.turnRight()
- print("going right")
- end
- for c=1, math.abs(x) do
- turtle.forward()
- print("weee")
- end
- if x > 0 then
- turtle.turnRight()
- print("return")
- else
- turtle.turnLeft()
- print("return")
- end
- end
- for c=0, 3-y do
- turtle.up()
- end
- turtle.up()
- while true do
- a, b = rednet.receive()
- if b == "forward" then
- forward()
- end
- if b == "right" then
- turnRight()
- end
- if b == "left" then
- turnLeft()
- end
- if b == "up" then
- up()
- end
- if b == "down" then
- down()
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement