Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Botania mana pool checker. version 1.0 by ThaWade.
- Use with dropCoal program found > http://pastebin.com/cwak5D9S
- --You could add for example a leftInput, rightOutput and control two turtles with one computer.
- ]]
- local inputSide = "front"--side the computer is getting redstone signal from comparator.
- local outputSide = "back"--side the computer is outputing to the turtle.
- local recheckTime = 60--time the turtle waits between rechecks once it determines a redstone state.
- local timesRan = 0--just for my personal amusement. Can be removed along with lines 29 and 30. If you don't like it.
- function clearTerm()
- term.clear()
- term.setCursorPos(1,1)
- end
- function checkManaPool()
- if redstone.getAnalogInput(inputSide) < 15 then
- print("Mana pool not full. Turning ON Redstone signal.")
- redstone.setOutput(outputSide,true)--turn on redstone signal
- elseif redstone.getAnalogInput(inputSide) == 15 then--elseif mana pool is full then
- print("Mana pool full. Turning OFF Redstone signal.")
- redstone.setOutput(outputSide,false)
- end
- end
- while true do
- clearTerm()
- checkManaPool()
- timesRan = timesRan + 1
- print("Times ran: " ..timesRan)
- print("Sleeping... recheck in " ..recheckTime.. " seconds.")
- sleep(recheckTime)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement