Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- me = peripheral.wrap("back")
- mon = peripheral.wrap("top")
- local mxcw = 20
- bottle = {}
- bottle["clear"] = {}
- bottle["clear"].amout = 0
- bottle["clear"].name = "toughasnails:purified_water_bottle"
- bottle["empty"] = {}
- bottle["empty"].amout = 0
- bottle["empty"].name = "minecraft:glass_bottle"
- bottle["water"] = {}
- bottle["water"].amout = 0
- bottle["water"].name = "minecraft:potion"
- while true do
- items = me.listItems()
- for i, item in ipairs(items) do
- if string.match(item.name, bottle["clear"].name) then
- bottle["clear"].amout = item.amount
- end
- if string.match(item.name, bottle["water"].name) then
- bottle["water"].amout = item.amount
- end
- if string.match(item.name, bottle["empty"].name) then
- bottle["empty"].amout = item.amount
- end
- end
- print("Water: " .. bottle["water"].amout)
- print("Clear: " .. bottle["clear"].amout)
- print("Emtpy: " .. bottle["empty"].amout)
- if bottle["clear"].amout < mxcw then
- local cwnd = mxcw - bottle["clear"].amout
- if bottle["water"].amout > 0 then
- x = me.export(bottle["water"].name ,0 ,cwnd ,"south")
- print(x .. " water bottle exported from ME for clear")
- elseif bottle["empty"].amout > 0 then
- x = me.export(bottle["empty"].name,0,cwnd,"north")
- print(x .."empty bottle exported from ME for refill and clear")
- end
- end
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement