Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("ocs/apis/sensor")
- senI = sensor.wrap("right")
- monSide = "back"
- mon = peripheral.wrap(monSide)
- xMax,yMax = mon.getSize()
- Bcol = colors.white
- function Bdraw()
- for xPos = 1,xMax do
- for yPos = 1,yMax do
- mon.setCursorPos(xPos,yPos)
- mon.setBackgroundColor(Bcol)
- mon.write(" ")
- end
- end
- end
- while true do
- event,side,xPos,yPos = os.pullEvent("monitor_touch")
- b=2
- d=2
- eu=0
- menge = 0
- Bdraw()
- zieleinv = senI.getTargets()
- for k,v in pairs(zieleinv) do
- if v.Name == "Player"
- and v.Position.X<0.5 and v.Position.X>-0.5
- and v.Position.Y==-1.5
- and v.Position.Z<-2.5 and v.Position.Z>-3.5
- then
- mon.setBackgroundColor(colors.black)
- mon.setTextColor(colors.white)
- mon.setCursorPos(1,1)
- mon.write(k)
- details = senI.getTargetDetails(k)
- for i = 1,40 do
- item = details.Inventory[i].Name
- anzahl = details.Inventory[i].Size
- maxanzahl = details.Inventory[i].MaxStack
- if item == "empty" then
- else
- mon.setBackgroundColor(colors.white)
- if i < 37 then
- mon.setCursorPos(1,b)
- mon.setTextColor(colors.black)
- b = b+1
- end
- if i >= 37 then
- mon.setTextColor(colors.red)
- mon.setCursorPos(44,d)
- d = d+1
- end
- mon.write("Slot "..i.." "..item.." Anzahl: "..anzahl.."/"..maxanzahl)
- menge = menge + 100*anzahl/maxanzahl
- sleep(0.1)
- end
- Gesamt = menge+1000
- eu100 = math.floor(5 * math.floor(Gesamt) * (math.floor(100) + 10)^0.7)
- eu1000 = math.floor(5 * math.floor(Gesamt) * (math.floor(1000) + 10)^0.7)
- for xPos = 1,xMax do
- for yPos = 38,yMax do
- mon.setBackgroundColor(colors.black)
- mon.setCursorPos(xPos,yPos)
- mon.write(" ")
- end
- end
- mon.setCursorPos(1,38)
- mon.setTextColor(colors.lime)
- mon.setBackgroundColor(colors.black)
- mon.write("Gewicht: "..Gesamt.." /5000")
- mon.setCursorPos(1,39)
- mon.setTextColor(colors.orange)
- mon.setBackgroundColor(colors.black)
- mon.write("EU fuer 100-Block teleport: "..eu100.." EU")
- mon.setCursorPos(1,40)
- mon.setTextColor(colors.red)
- mon.setBackgroundColor(colors.black)
- mon.write("EU fuer 1000-Block teleport: "..eu1000.." EU")
- end
- end
- end
- end
Add Comment
Please, Sign In to add comment