Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function RCT()
- while true do
- local scrap, msg = rednet.receive()
- if msg == "RCF" then
- if turtle.detect() == false then
- turtle.forward()
- end
- elseif msg == "RCMF" then
- if turtle.detect() then
- turtle.dig()
- end
- elseif msg == "RCGF" then
- if turtle.detect() then
- turtle.dig()
- end
- turtle.forward()
- elseif msg == "RCPF" then
- if turtle.detect() == false then
- turtle.place()
- end
- elseif msg == "RCAF" then
- turtle.attack()
- elseif msg == "RCB" then
- turtle.back()
- elseif msg == "RCL" then
- turtle.turnLeft()
- elseif msg == "RCR" then
- turtle.turnRight()
- elseif msg == "RCU" then
- if turtle.detectUp() == false then
- turtle.up()
- end
- elseif msg == "RCMU" then
- if turtle.detectUp() then
- turtle.digUp()
- end
- elseif msg == "RCGU" then
- if turtle.detectUp() then
- turtle.digUp()
- end
- turtle.up()
- elseif msg == "RCPU" then
- if turtle.detectUp() ==false then
- turtle.placeUp()
- end
- elseif msg == "RCAU" then
- turtle.attackUp()
- elseif msg == "RCD" then
- if turtle.detectDown() == false then
- turtle.down()
- end
- elseif msg == "RCMD" then
- if turtle.detectDown() then
- turtle.digDown()
- end
- elseif msg == "RCGD" then
- if turtle.detectDown() then
- turtle.digDown()
- end
- turtle.down()
- elseif msg == "RCPD" then
- if turtle.detectDown() == false then
- turtle.placeDown()
- end
- elseif msg == "RCAD" then
- turtle.attackDown()
- elseif msg == "RC1" then
- turtle.select(1)
- elseif msg == "RC2" then
- turtle.select(2)
- elseif msg == "RC3" then
- turtle.select(3)
- elseif msg == "RC4" then
- turtle.select(4)
- elseif msg == "RC5" then
- turtle.select(5)
- elseif msg == "RC6" then
- turtle.select(6)
- elseif msg == "RC7" then
- turtle.select(7)
- elseif msg == "RC8" then
- turtle.select(8)
- elseif msg == "RCRF" then
- if turtle.getItemCount(16) == 0 then
- rednet.broadcast("RFNF")
- sleep(0)
- else
- if turtle.getFuelLevel() > 64 then
- sleep(0)
- rednet.broadcast("RFF")
- else
- turtle.select(16)
- if turtle.refuel(0) == false then
- sleep(0)
- rednet.broadcast("RFNV")
- else
- turtle.select(16)
- turtle.refuel(1)
- rednet.broadcast("RFS")
- end
- turtle.select(1)
- end
- end
- end
- end
- end
- rednet.open("right")
- term.clear()
- term.setCursorPos(1,1)
- print[[Remote Controlled Turtle Initiated!
- - This turtle is being controlled from a remote location
- Program by 44shades44]]
- RCT()
Add Comment
Please, Sign In to add comment