Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Coal dropper for Botania mana generation. version 1.0 by ThaWade.
- Use with checkMana program found > http://pastebin.com/Jgyf9zYE
- ]]
- local count = 9 --change this to the number of Endoflames you're using.
- local sleepTime = 41-- sleep time between each coal drop.
- local inputSignal = "back"--The redstone input side.
- local firstSlot, lastSlot = 1,16
- function clearTerm()
- term.clear()
- term.setCursorPos(1,1)
- end
- function dropCoal()
- print("Dropping coal...")
- turtle.select(1)
- turtle.dropDown(count)
- sleep(sleepTime)
- end
- function grabItems()
- print("Grabbing items from external inventory.")
- for g = 1,16 do
- turtle.suck()
- end
- print("Done grabing items.")
- end
- function moveItems()--simply moves items from slots 2 - 16 and places them in slot 1
- print("Moving items...")
- for i = 2, 16 do
- turtle.select(i)
- turtle.transferTo(1)
- end
- print("Done moving items.")
- end
- function getCount()--makes sure there are enough items in slot one to drop.
- if turtle. getItemCount(firstSlot,lastSlot) < count then
- grabItems()
- elseif turtle.getItemCount(1) < count then --if item count in slot 1 is less than amount configured to drop then
- print("Not enough items in slot 1")
- moveItems()-- we move items from slots 2 - 16 into slot one.
- elseif turtle.getItemCount(1) >= count then--if item count in slot 1 is equal or greater than amount configured to then
- print("Enough items in slot 1. Continuing work...")
- dropCoal()--we proceed with droping the coal.
- end
- end
- function ifRedstoneSignal()
- print("Checking redstone signal state...")
- if redstone.getInput(inputSignal) == true then
- print("Redstone signal present...")
- getCount()
- else
- print("Redstone signal NOT present...")
- print("Sleeping 60 seconds")
- sleep(60)
- end
- end
- clearTerm()
- while true do
- ifRedstoneSignal()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement