Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- me = peripheral.wrap("bottom")
- mon = peripheral.wrap("top")
- low = 64
- local meItems = {
- [1] = {"Iron Blocks","minecraft:iron_block","0"},
- [2] = {"Redstone Blocks","minecraft:redstone_block","0"},
- [3] = {"Gold Blocks","minecraft:gold_block","0"},
- [4] = {"Diamond Blocks","minecraft:diamond_block","0"},
- [5] = {"Osmium Blocks","Mekanism:BasicBlock","0"},
- [6] = {"Iron Ingots","minecraft:iron_ingot","0"},
- [7] = {"Redstone Dust","minecraft:redstone","0"},
- [8] = {"Gold Ingots","minecraft:gold_ingot","0"},
- [9] = {"Diamonds","minecraft:diamond","0"},
- [10] = {"Osmium Ingots","Mekanism:Ingot","1"},
- [11] = {"Iridium Ore","IC2:itemOreIridium","0"},
- [12] = {"Ender Pearls","minecraft:ender_pearl","0"},
- [13] = {"Enderium Ingot","ThermalFoundation:material","76"},
- [14] = {"Essentia","Thaumcraft:ItemCrystalEssence","0"}
- }
- function checkMe(checkName, name)
- melist = me.getAvailableItems()
- for a = 1, #melist do
- itemName = melist[a].fingerprint.id .. melist[a].fingerprint.dmg
- value = tostring(melist[a].size)
- if itemName == checkName then
- print("true")
- print(name)
- print("me=" ..itemName)
- print("var=" ..checkName)
- centerT(name, row+2, colors.black,colors.blue,"left")
- if tonumber(value) <= low then
- centerT(value, row+2, colors.black, colors.red,"right")
- else
- centerT(value, row+2, colors.black, colors.green,"right")
- end
- row=row+1
- end
- end
- end
- function checkTable()
- clearScreen()
- row = 1
- for i = 1, #meItems do
- checkName = meItems[i][2] .. meItems[i][3]
- name = meItems[i][1]
- checkMe(checkName, name)
- end
- end
- function clearScreen()
- mon.setBackgroundColor(colors.black)
- mon.clear()
- mon.setCursorPos(1,1)
- centerT(" Storage ", 1, colors.blue, colors.white, "head")
- end
- function centerT(text,line,txtback,txtcolor,pos)
- monX,monY = mon.getSize()
- mon.getBackgroundColor(txtback)
- mon.setTextColor(txtcolor)
- length = string.len(text)
- dif = math.floor(monX-length)
- x = math.floor(dif/2)
- if pos == "head" then
- mon.setCursorPos(x+1,line)
- mon.write(text)
- elseif pos == "left" then
- mon.setCursorPos(2,line)
- mon.write(text)
- elseif pos == "right" then
- mon.setCursorPos(monX-length, line)
- mon.write(text)
- end
- end
- while true do
- checkTable()
- sleep(30)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement