Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --
- --Wuffelz Inventory V1
- --written in 02/2025 by Kay Michaelsen
- --
- --vardef
- --
- monitor1 = peripheral.wrap("monitor_0")
- monitor2 = peripheral.wrap("monitor_2")
- --monitor3 = peripheral.wrap("monitor_7")
- --monitor4 = peripheral.wrap("monitor_56")
- rss = peripheral.wrap("meBridge_0")
- --
- obergrenze = 30000
- aSeeds = 0
- aPro = 0
- myst = "mysticalagriculture:"
- imm = "immersiveengineering:"
- automat = true
- dPage = 1
- dMax = 0
- gefunden = {}
- agefunden = 0
- pName = {}
- pDN = {}
- pLine = {}
- pStat = {}
- pByte = {}
- pFound = {}
- pStored = {}
- pSide = {}
- pMax = {}
- aPro = 30
- dMax = 1
- function UserCommand( xpos, ypos)
- local bunt = {}
- print("UC" ,xpos ,ypos)
- if ypos == 23 then
- if (xpos>42) and (xpos<54) then
- if automat == true then
- automat = false
- else
- automat = true
- end
- end
- elseif ypos == 1 then
- if (xpos<6) then
- --prev page
- if dPage > 1 then
- dPage = dPage -1
- end
- elseif (xpos>52) then
- if dPage < dMax then
- dPage = dPage +1
- end
- end
- end
- dMax = math.floor(agefunden / 20) +1
- end
- function CheckInferiumReihe(lesen)
- such = {}
- such.name = "refined"
- rs = rss.listItems()
- if not(rs == nil) then
- for slot, item in pairs(rs) do
- if not(string.find(item.name,such.name) == nil) then
- agefunden = agefunden + 1
- gefunden.name[agefunden] = item.name
- gefunden.menge[agefunden] = item.amount
- end
- end
- end
- end
- function MonAufbau(moni)
- if not(moni == nil) then
- moni.setTextScale(0.5)
- moni.setBackgroundColor(colors.black)
- moni.clear()
- moni.setBackgroundColor(colors.green)
- moni.setTextColor(colors.black)
- moni.setCursorPos(16,1)
- moni.write(" *** Wuffelz Inventory *** ")
- moni.setCursorPos(2,1)
- if dPage > 1 then
- moni.setBackgroundColor(colors.orange)
- else
- moni.setBackgroundColor(colors.black)
- moni.setTextColor(colors.orange)
- end
- moni.write(" << ")
- moni.setCursorPos(7,1)
- moni.setBackgroundColor(colors.black)
- moni.setTextColor(colors.orange)
- moni.write(string.format("%1d", dPage))
- moni.setCursorPos(53,1)
- if dPage < dMax then
- moni.setBackgroundColor(colors.orange)
- moni.setTextColor(colors.black)
- else
- moni.setBackgroundColor(colors.black)
- moni.setTextColor(colors.orange)
- end
- moni.write(" >> ")
- for i = 0,20 do
- moni.setBackgroundColor(colors.black)
- moni.setTextColor(colors.blue)
- moni.setCursorPos(1, i + 2)
- pr = i + ((dPage - 1) * 20)
- if pr <= agefunden then
- moni.write(gefunden.name[pr])
- moni.setCursorPos(50, i + 2)
- moni.write(string.format("%6d", gefunden.menge[pr]))
- end
- end
- moni.setBackgroundColor(colors.black)
- moni.setTextColor(colors.blue)
- moni.setCursorPos(5,23)
- end
- end
- while true do
- CheckInferiumReihe(lesen)
- MonAufbau(monitor1)
- MonAufbau(monitor2)
- --MonAufbau(monitor3)
- --MonAufbau(monitor4)
- event, button, x, y = os.pullEventRaw()
- if event == "terminate" then
- break
- elseif event == "redstone" then
- --neuer Durchlauf
- elseif (event == "monitor_touch") and (button == "monitor_0") then
- UserCommand( x, y)
- elseif (event == "monitor_touch") and (button == "monitor_2") then
- UserCommand( x, y)
- else
- print(event, button, x, y)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment