Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("ocs/apis/sensor")
- shell.run("clear")
- sen = sensor.wrap("bottom")
- targs = sen.getTargets()
- locale = "1,0,0"
- function tableSortSize(a,b)
- return(a.ItemSize > b.ItemSize)
- end
- function cbut(cx,cy,tcol,itemName, itemSize)
- if tcol == nil or tcol == "" then
- tcol = colors.white
- end
- mon.setTextColor(tcol)
- mon.setCursorPos(cx,cy)
- mon.clearLine(cy)
- mon.write(itemName .. ": " .. itemSize)
- mon.setTextColor(colors.white)
- end
- mon = peripheral.wrap("back")
- globX, globY = mon.getSize()
- function itemClaim(itemName1, itemSize1,posX,posY,color)
- table.insert(items,{ItemName = itemName1,ItemSize = itemSize1,locationX = posX, locationY = posY, colorID = color})
- end
- mon.clear()
- while true do
- items = {}
- mon.setCursorPos(globX/2-9,1)
- mon.clearLine(1)
- mon.write("Muzze77 ME Inventar")
- s = sen.getTargetDetails(locale)
- for v, k in pairs(s.Items) do
- if k.Name == "UU-Matter" then
- itemClaim(k.Name,k.Size,2,0,colors.pink)
- elseif k.Name == "Iron Ingot" then
- itemClaim(k.Name,k.Size,2,0,colors.gray)
- end
- end
- table.sort(items,tableSortSize)
- for itemK=1, #items do
- cbut(items[itemK].locationX, itemK, items[itemK].colorID, items[itemK].ItemName,items[itemK].ItemSize)
- end
- items = nil
- sleep(10)
- end
Add Comment
Please, Sign In to add comment