Advertisement
Guest User

inventory

a guest
Nov 26th, 2013
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.30 KB | None | 0 0
  1. function man_ovr()
  2.   manual=redstone.getInput("front")
  3.   if manual then
  4.     cell.setEnergySend(100)
  5.    else
  6.      cell.setEnergySend(0)
  7.    end
  8. end
  9.  
  10. function readSlots()
  11. for i=0,sz-1, 1 do
  12.  
  13. end
  14.  
  15. -------------------------------------------------
  16. mon=peripheral.wrap("top")
  17. i=0
  18. cell=peripheral.wrap("left")
  19. note=peripheral.wrap("right")
  20.  
  21.  
  22. while true do
  23.  
  24.   for i=1,60, 1 do
  25.   man_ovr()
  26.   term.clear()
  27.   term.setCursorPos(1,1)
  28.   p=peripheral.wrap("bottom")
  29.   n=p.getInvName()
  30.   sz=p.getSizeInventory()
  31.   tbl={}
  32.   for i=0, sz-1, 1 do
  33.       tbl[i+1]=p.getStackInSlot(i)
  34.       term.setCursorPos(1,1)
  35.       pct= math.floor((i+1) / 27 * 100)
  36.       print(pct.. "% complete")
  37. --  mon.addText(3,30,tostring(pct), 0xFFFFFF)
  38.  
  39.     end
  40.     if tbl then
  41.       slots=#tbl
  42.       mon.clear()
  43.       mon.addText(3,25,tostring(slots).." slots full",0xFFFFFF)
  44.       --note.triggerNote()
  45.       --note.triggerNote()
  46.       --mon.addText(3,20,tostring(60-
  47.       if slots>10 then
  48.         cell = peripheral.wrap("left")
  49.         cell.setEnergySend(100)
  50.         print( cell)
  51.         term.setCursorPos(1,2)
  52.         mon.clear()
  53.         --mon.addText(3,15, tostring(slots),0xFFFFFF)
  54.         mon.addText(3,25, "Emptying Ender Chest", 0xFFFFFF)
  55.         mon.addText(3,45,"Playing Alert",0x669933)
  56.           for itr=1,3,1 do
  57.             note.triggerNote()
  58.           end
  59.         print("Emptying Chest")
  60.         sleep(3)
  61.         cell.setEnergySend(0)
  62.       else
  63.         term.setCursorPos(1,2)
  64.         print("Chest not full")
  65.         print(#tbl.. " slots full")
  66.         cell.setEnergySend(0)
  67.       end
  68.  
  69.     print ("------------------------")
  70.  
  71.     --print(m)
  72.  
  73.     i=i+1
  74.     print(i)
  75.     mon=peripheral.wrap("top")
  76.     --mon.clear()
  77.     mon.addText(3,35, tostring(60-i).." cycles till ME starts up",0xFFFFFF)
  78.     full=slots/27
  79.     --mon.addGradientBox(3,100,10,tostring(full), 0xFFFFFF, 0.5, 0x000000,0.5,2)
  80.    
  81.     sleep(1)
  82.  end
  83. end
  84. cell.setEnergySend(100)
  85. mon.addText(3, 45, "redstone: ON",0x993333)
  86. --manual=redston.getInput("front")
  87. --if manual then
  88. --cell.setEnergySend(100)
  89. --else
  90. --cell.setEnergySend(0)
  91. --end
  92. sleep(2)
  93.  
  94. cell.setEnergySend(0)
  95. mon.addText(3, 45, "redstone: OFF", 0x669933)
  96. end
  97.  
  98. while not cell do
  99. mon.addText(3, 55, "No Cell found", 0x003333)
  100. sleep(1)
  101. end
  102.  
  103. --end
  104. --end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement