--[[ Coal dropper for Botania mana generation. version 2.0 by ThaWade. Use with checkMana program found > http://pastebin.com/Jgyf9zYE Default setup is: Redstone Input:Back, Item Container:Front ]] local dropCount = 49--change this to the number of Endoflames you're using. local sleepTime = 44-- sleep time between each coal drop. local inputSignal = "back"--The redstone input side. local grabCount = 0 function clearTerm() term.clear() term.setCursorPos(1,1) end function grabItems() local dropSlotCount = turtle.getItemCount(1) local maxCount = 64 print("Grabbing Items from external inventory") turtle.select(1) local grabCount = maxCount - dropSlotCount if turtle.suck(grabCount) == true then print("Done grabbing items") elseif turtle.suck(grabCount) == false then print("Nothing to grab items from") end end function dropCoal() turtle.select(1) print("Dropping coal...") if dropCount > 32 then turtle.dropDown(dropCount) grabItems() turtle.dropDown(dropCount) elseif dropCount <= 32 then turtle.dropDown(dropCount) end print("Done dropping coal...") print("Sleeping " ..sleepTime.. " seconds.") sleep(sleepTime) end clearTerm() while true do clearTerm() if turtle.getItemCount(1) >= dropCount then if redstone.getInput(inputSignal) == true then print("Redstone signal present...") dropCoal() elseif redstone.getInput(inputSignal) == false then print("Redstone signal NOT present...") print("Sleeping 60 seconds") sleep(60) end elseif turtle.getItemCount(1) < dropCount then z = turtle.getItemCount(2) if z > 0 then turtle.select(2) turtle.transferTo(1) end if z == 0 then grabItems() end end end