Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mon = peripheral.wrap("monitor_0")
- me = peripheral.wrap("back")
- while true do
- --meCI = me.getAvailableItems()
- --local tableID = {"IC2:itemIngot",3,1000,"Refined Iron"}
- local tableS = fs.open("crafttab","r")
- local tableIDs = tableS.readAll();
- tableS.close();
- local tableID = textutils.unserialise(tableIDs)
- local ic = 25
- local im = 35
- local icr = 45
- mon.clear()
- mon.setTextScale(0.5)
- mon.setTextColor(colors.yellow)
- mon.setCursorPos(2,1)
- mon.write("Nazev")
- mon.setCursorPos(ic,1)
- mon.write("Skladem")
- mon.setCursorPos(im,1)
- mon.write("Minimum")
- mon.setCursorPos(icr,1)
- mon.write("Vyrobit")
- mon.setTextColor(colors.white)
- for x=1, #tableID do
- meCI = me.getAvailableItems()
- --print(#tableID) -- pocet itemu k hlidani
- print(tableID[x].jmeno)
- mon.setCursorPos(2,x+1)
- mon.write(tableID[x].jmeno)
- --print(tableID[x].itemid)
- for k=1, #meCI do
- if (meCI[k].is_craftable == true) then
- item = meCI[k].fingerprint
- --print(item.id)
- if item.id == tableID[x].itemid and item.dmg == tableID[x].itemdmg then
- itemcount = math.floor(meCI[k].size)
- itemmin = math.floor(tableID[x].minsklad)
- itemcraft = itemmin - itemcount
- mon.setCursorPos(ic,x+1)
- if itemcraft > 0 then
- mon.write(itemcount)
- mon.setCursorPos(im,x+1)
- mon.write(itemmin)
- mon.setCursorPos(icr,x+1)
- mon.write(math.floor(itemcraft))
- print("Stav itemu je pod minimem")
- print("Bude vyrobeno "..itemcraft.." itemu")
- --me.requestCrafting(item,itemcraft,"CPU5")
- else
- print("Stav produktu je OK")
- mon.write(itemcount)
- mon.setCursorPos(im,x+1)
- mon.write(itemmin)
- end
- print("------------------------------")
- end
- end
- end
- end
- sleep(600)
- term.clear()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement