Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while true do
- peripherals = peripheral.getNames()
- voidtable = {}
- jartable = {}
- os.loadAPI("button")
- for i = 1, #peripherals do
- if peripheral.getType(peripherals[i]) == "tilejarvoid" then
- table.insert(voidtable, peripheral.wrap(peripherals[i]))
- end
- end
- for i = 1, #peripherals do
- if peripheral.getType(peripherals[i]) == "tilejar" then
- table.insert(jartable, peripheral.wrap(peripherals[i]))
- end
- end
- mjar = peripheral.wrap("top")
- mjar.setTextScale(0.5)
- mvoid = peripheral.wrap("top")
- mvoid.setTextScale(0.5)
- mjar.setTextColor(colors.blue)
- pos = 1
- mjar.clear()
- mvoid.clear()
- for i = 1, #jartable do
- mjar.setCursorPos(1, pos)
- jaramount = jartable[i].getEssentiaAmount("")
- if jaramount<=20 then mjar.setTextColor(colors.red) end
- if jaramount<40 and jaramount>20 then mjar.setTextColor(colors.yellow) end
- if jaramount>=40 then mjar.setTextColor(colors.green) end
- mjar.write(jartable[i].getSuctionType(""):gsub("%a", string.upper, 1))
- mjar.setCursorPos(20, pos)
- mjar.write(string.sub(jaramount, string.len(jaramount) - 1))
- pos = pos + 1
- end
- pos = 1
- for i = 1, #voidtable do
- mvoid.setCursorPos(55, pos)
- voidamount = voidtable[i].getEssentiaAmount("")
- if voidamount<=20 then mjar.setTextColor(colors.red) end
- if voidamount<40 and voidamount>20 then mjar.setTextColor(colors.yellow) end
- if voidamount>=40 then mjar.setTextColor(colors.green) end
- mvoid.write(voidtable[i].getSuctionType(""):gsub("%a", string.upper, 1))
- mvoid.setCursorPos(75, pos)
- mvoid.write(string.sub(voidamount, string.len(voidamount) - 1))
- pos = pos + 1
- end
- sleep(15)
- end
Advertisement
Add Comment
Please, Sign In to add comment