Nike622000

Invsee

Jun 12th, 2016
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.32 KB | None | 0 0
  1. os.loadAPI("ocs/apis/sensor")
  2. senI = sensor.wrap("right")
  3. monSide = "back"
  4. mon = peripheral.wrap(monSide)
  5. xMax,yMax = mon.getSize()
  6. Bcol = colors.white
  7. function Bdraw()
  8. for xPos = 1,xMax do
  9.     for yPos = 1,yMax do
  10.         mon.setCursorPos(xPos,yPos)
  11.         mon.setBackgroundColor(Bcol)
  12.         mon.write(" ")
  13. end
  14. end
  15. end
  16.  
  17. while true do
  18. event,side,xPos,yPos = os.pullEvent("monitor_touch")
  19. b=2
  20. d=2
  21. eu=0
  22. menge = 0
  23. Bdraw()
  24.  
  25. zieleinv = senI.getTargets()
  26.     for k,v in pairs(zieleinv) do
  27.             if v.Name == "Player"
  28.             and v.Position.X<0.5 and v.Position.X>-0.5
  29.             and v.Position.Y==-1.5
  30.             and v.Position.Z<-2.5 and v.Position.Z>-3.5
  31.             then
  32.                 mon.setBackgroundColor(colors.black)
  33.                 mon.setTextColor(colors.white)
  34.                 mon.setCursorPos(1,1)
  35.                 mon.write(k)
  36.                 details = senI.getTargetDetails(k)
  37.                     for i = 1,40 do
  38.                     item = details.Inventory[i].Name
  39.                     anzahl = details.Inventory[i].Size
  40.                     maxanzahl = details.Inventory[i].MaxStack
  41.                         if item == "empty" then
  42.                         else
  43.                         mon.setBackgroundColor(colors.white)
  44.                             if i < 37 then
  45.                             mon.setCursorPos(1,b)
  46.                             mon.setTextColor(colors.black)
  47.                             b = b+1
  48.                             end
  49.                             if i >= 37 then
  50.                             mon.setTextColor(colors.red)
  51.                             mon.setCursorPos(44,d)
  52.                             d = d+1
  53.                             end
  54.                         mon.write("Slot "..i.." "..item.." Anzahl: "..anzahl.."/"..maxanzahl)
  55.                         menge = menge + 100*anzahl/maxanzahl
  56.                         sleep(0.1)
  57.                         end
  58.  
  59.                     Gesamt = menge+1000
  60.                     eu100 = math.floor(5 * math.floor(Gesamt) * (math.floor(100) + 10)^0.7)
  61.                     eu1000 = math.floor(5 * math.floor(Gesamt) * (math.floor(1000) + 10)^0.7)
  62.                     for xPos = 1,xMax do
  63.                         for yPos = 38,yMax do
  64.                         mon.setBackgroundColor(colors.black)
  65.                         mon.setCursorPos(xPos,yPos)
  66.                         mon.write(" ")
  67.                         end
  68.                     end
  69.                     mon.setCursorPos(1,38)
  70.                     mon.setTextColor(colors.lime)
  71.                     mon.setBackgroundColor(colors.black)
  72.                     mon.write("Gewicht: "..Gesamt.." /5000")
  73.                     mon.setCursorPos(1,39)
  74.                     mon.setTextColor(colors.orange)
  75.                     mon.setBackgroundColor(colors.black)
  76.                     mon.write("EU fuer 100-Block teleport: "..eu100.." EU")
  77.                     mon.setCursorPos(1,40)
  78.                     mon.setTextColor(colors.red)
  79.                     mon.setBackgroundColor(colors.black)
  80.                     mon.write("EU fuer 1000-Block teleport: "..eu1000.." EU")
  81.                     end
  82.             end
  83.     end
  84. end
Add Comment
Please, Sign In to add comment