Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Program:
- -- mine
- -- Original program by Direwolf20
- -- Modified by Kzorith and even more by Liktorn
- -- Description:
- -- Operates the mining wells and Force Manipulator
- -- Hardware requirements:
- -- 1 Advanced Mining Turtle
- -- 1 Rednet cable
- function turnOff()
- rs.setBundledOutput("bottom",0)
- end
- function startTesseract()
- -- print what we are doing
- print("Mining for 8 seconds")
- -- set a redstone signal to activate the tesseract
- -- (mine is white)
- rs.setBundledOutput("bottom",colors.white)
- -- wait 8 seconds for the mining operation to complete
- sleep(8)
- -- turn off all redstone signals
- turnOff()
- end
- function move()
- --moving the platform
- -- print what we are doing
- print("Moving platform")
- -- wait 5 seconds
- sleep(5)
- -- set a redstone signal to activate the Force Manipulator
- -- (Move is orange)
- rs.setBundledOutput("bottom",colors.orange)
- -- make sure that the Force Manipulator have time to get the signal
- sleep(1)
- -- turn off all redstone signals
- turnOff()
- sleep(4)
- -- and move the turtle 1 forward
- turtle.forward()
- end
- function placeChest()
- print("Placing chest")
- turtle.select(1)
- turtle.place()
- sleep(0.5)
- end
- function breakChest()
- print("Breasking chest")
- --brakes the chest in front of it
- turtle.dig()
- end
- function checkCable()
- print("Checking for cable below")
- -- checks if the cable is under the turtle
- -- if not, the miner is stuck
- -- break the program
- if turtle.detectDown() then
- print("Cable below, continuing")
- placeChest()
- else
- while true do
- print("Error: No cable below. Miner stuck. Infinite loop")
- return
- end
- end
- end
- breakChest()
- startTesseract()
- -- move the platform
- move()
- checkCable()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement