Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tArgs = { ... }
- --variables
- local strSide = "bottom"
- local intCount = 0
- local fPulseLength = 0.1
- --predeclare
- local printUsage
- local rsPulse
- local clear
- --functions--
- function rsPulse(length)
- if length < 0.1 then
- print("Error: Pulse length must be 0.1 or greater")
- error()
- else
- redstone.setOutput(strSide, true)
- sleep(length)
- redstone.setOutput(strSide, false)
- sleep(length)
- end
- end
- function clear()
- term.clear()
- term.setCursorPos(1,1)
- end
- function printUsage()
- print( "Usage: craft <# crafted>" )
- return
- end
- local intCount = tonumber(tArgs[1])
- --start--
- if #tArgs ~= 1 then
- printUsage()
- return
- elseif intCount > 0 then
- while intCount > 0 do
- rsPulse(fPulseLength)
- intCount = intCount - 1
- clear()
- print("Crafting: "..intCount.." remaining.")
- end
- print("Crafting Complete.")
- return
- else
- print("Error.")
- printUsage()
- end
Add Comment
Please, Sign In to add comment