Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Args = {...}
- wr = peripheral.wrap("right")
- h = 5
- idletime = 10
- function pulse(freq,t)
- wr.setFreq(freq)
- redstone.setOutput("right",true)
- os.sleep(t)
- redstone.setOutput("right",false)
- os.sleep(0.2)
- end
- function mine()
- pulse(549,0.5)
- end
- function boreDown()
- pulse(551,1.2)
- end
- function boreUp()
- pulse(552,1.2)
- end
- function goFor()
- pulse(553,1.2)
- end
- function goBack()
- pulse(554,1.2)
- end
- function cycle()
- mine()
- os.sleep(0.5)
- for i=1,h do
- boreDown()
- os.sleep(0.5)
- mine()
- os.sleep(1.5)
- mine()
- os.sleep(1.5)
- mine()
- os.sleep(0.5)
- end
- for i=1,h do
- boreUp()
- os.sleep(5)
- end
- goFor()
- os.sleep(idletime)
- end
- while true do
- os.sleep(0.5)
- if #Args == 0 then
- if rs.getInput("top") then
- cycle()
- os.sleep(0.5)
- end
- else
- if Args[1] == "goback" then
- goBack()
- break
- elseif Args[1] == "gofor" then
- goFor()
- break
- elseif Args[1] == "boreup" then
- boreUp()
- break
- elseif Args[1] == "boredown" then
- boreDown()
- break
- elseif Args[1] == "mine" then
- mine()
- break
- elseif Args[1] == "cycle" then
- cycle()
- break
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment