Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function pulse (side, colour)
- print("pulse ", side, " - ", colour)
- rs.setBundledOutput(side, colour)
- sleep(0.25)
- rs.setBundledOutput(side, 0)
- end
- function checkItemComparator()
- local level = rs.getAnalogInput("left")
- print("dropper comp = ", level)
- return level
- end
- -- wait for a redstone signal from the
- -- dispenser/comparator
- while true do
- print("waiting on a redstone event...")
- os.pullEvent("redstone")
- print("got redstone event!")
- -- short pause to ensure all items get there
- sleep(1)
- if checkItemComparator() > 0 then
- local done = false
- -- loop till all items in the
- -- dropper are ejected
- while done == false do
- compLevel = checkItemComparator()
- if compLevel > 0 then
- -- white = vanilla dropper (items)
- pulse("top", colors.white)
- else
- done = true
- end
- end
- -- orange = openblocks dropper (livingrock)
- pulse("top", colors.orange)
- sleep(0.5)
- -- magenta = dispenser (wand of forest)
- pulse("top", colors.magenta)
- -- crafting has begun
- -- wait for strength 2 signal to finish
- -- runic altar's comparator outputs this
- local finished = 0
- for i = 0, 60 do
- local altar = rs.getAnalogInput("back")
- print("altar level = ", altar)
- if altar == 2 then
- pulse("top", colors.magenta)
- finished = 1
- break
- end
- sleep(1)
- end
- if finished == 0 then
- print("ERROR: crafting didn't finish after 60 seconds")
- end
- end -- if
- end -- while true
Advertisement
Add Comment
Please, Sign In to add comment