Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local dispSide = "left" -- Auto Placer side
- local barrelSide = "top"
- local isBarrel = false -- Barrel placed?
- local updateDelay = 2 -- Time before next check
- ----
- function placeOne()
- rs.setOutput(dispSide, true)
- sleep(1)
- rs.setOutput(dispSide, false)
- end
- ----
- function barrStats()
- t = peripheral.wrap(tankSide)
- if t ~= nil then
- value = 0 max = 0
- ti = t.getTankInfo(tankSide)
- if isBarrel then
- for i,j in pairs(ti) do
- for name,data in pairs(j) do
- if name=="capacity" then
- max = data
- elseif name=="amount"
- then value = data
- end
- end
- end
- end
- s = "Barrel: "..value.."/"..max..
- if value = max
- return true
- else
- return false
- end
- end
- ----
- turtleCollect()
- end
- function main()
- while true do
- if ~isBarrel then
- placeOne()
- isBarrel = true
- end
- if barrStats() then
- if turtleCollect() then
- isBarrel = false
- end
- else
- print("Not Full!")
- end
- sleep(updateDelay)
- end
- end
- main()
- ----
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement