Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Args = {...}
- wr = peripheral.wrap("right")
- function printUsage()
- print("Usage:")
- print("Quarry <N>")
- print("Will quarry N times forward.")
- end
- function pulse(freq,num)
- wr.setFreq(freq)
- for i=1,num do
- redstone.setOutput("right",true)
- os.sleep(0.8)
- redstone.setOutput("right",false)
- os.sleep(1)
- end
- end
- function quarry(num)
- for i=1,num do
- redstone.setOutput("back",true)
- os.sleep(2)
- redstone.setOutput("back",false)
- os.sleep(20)
- pulse(1337,1)
- end
- end
- if #Args ~= 1 then
- printUsage()
- else
- if tonumber(Args[1]) == 0 then
- printUsage()
- else
- quarry(tonumber(Args[1]))
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment