Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --v1.1 by GraySloth 2013-Feb-23 for the MiscPeripheral mod with the Tank Upgrade, use to fill thaumic crucibles with water automatically
- --variables
- local w = peripheral.wrap("right")
- local dist = 1 --sets distance from water source
- --functions
- function clear()
- term.clear()
- term.setCursorPos(1,1)
- end
- function fuelCheck()
- if turtle.getFuelLevel() == "unlimited" then
- return true
- elseif turtle.getFuelLevel() < 2 then
- print("Searching for fuel hold ctrl+t to stop")
- while turtle.getFuelLevel() < 10 do
- for n=1,16 do
- if turtle.getFuelLevel() < 10 then
- turtle.select(n)
- turtle.refuel(1)
- end
- end
- end
- print("Refueled: "..turtle.getFuelLevel())
- end
- end
- --Main
- while true do
- if w.getLiquid() then
- w.drop()
- else
- fuelCheck()
- for i = 1, dist do
- turtle.back()
- end
- clear()
- print("Refilling")
- for i=1,10 do
- while not w.suckDown() do
- print("Refilled "..tostring(i).."/10")
- os.sleep(1.5)
- end
- end
- for i = 1, dist do
- turtle.forward()
- end
- end
- os.sleep(1)
- clear()
- print(textutils.formatTime(os.time(),true))
- print("Waiting to fill, Master.")
- end
Advertisement
Add Comment
Please, Sign In to add comment