Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dbcol = colors.black
- dtcol = colors.lime
- machines = peripheral.getNames()
- tanks = {}
- for v, k in pairs(machines) do
- if string.find(k,"monitor") ~= nil then
- mon = peripheral.wrap(k)
- end
- if string.find(k,"tank") ~= nil then
- table.insert(tanks,k)
- end
- end
- print(#tanks .. " Tanks are loaded")
- if mon == nil then
- error("No Monitor attached")
- end
- if tanks == nil then
- error("No tanks attached")
- end
- function mbut(cx,cy,text,bcol,tcol)
- if bcol == nil then
- bcol = dbcol
- end
- if tcol == nil then
- tcol = dtcol
- end
- mon.setCursorPos(cx,cy)
- mon.setBackgroundColor(bcol)
- mon.setTextColor(tcol)
- mon.write(text)
- mon.setBackgroundColor(dbcol)
- mon.setTextColor(dtcol)
- end
- x = 2
- y = 2
- for v, k in pairs(tanks) do
- tank = peripheral.wrap(k)
- stats = tank.getMetadata(1)["tanks"][1]
- amount = stats.amount
- capacity = stats.maxAmount
- end
Advertisement
Add Comment
Please, Sign In to add comment