BioPrince

EnderCrack

Oct 28th, 2014
290
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.21 KB | None | 0 0
  1. local take = false
  2. local x = 0
  3.  
  4. for a,b in pairs(rs.getSides()) do
  5.     if peripheral.getType(b) == "ender_chest" then
  6.         chest = peripheral.wrap(b)
  7.                 print("Found chest on "..b.." side")
  8.         break
  9.     end
  10. end
  11.  
  12.  
  13.   term.setTextColor(colors.blue)
  14.   for i = 0, 15 do
  15.     b1 = 2^i
  16.     for k = 0, 15 do
  17.       b2 = 2^k
  18.         for v = 0, 15 do
  19.         b3 = 2^v
  20.         chest.setColors(b1,b2,b3)
  21.        
  22.         --Take the Items
  23.         if take then
  24.           for slot, qty in pairs(chest.getAllStacks()) do
  25.             if chest.pushItem("down", slot) >= 1 then
  26.               items = true
  27.             end
  28.           end
  29.         else
  30.           --Log the Combinations to take later
  31.           os.sleep(0.1)    
  32.           if rs.getBundledInput("back") > 0 then
  33.             items = true
  34.           end
  35.       end
  36.    
  37.         if items then
  38.           write("Items found in: ")
  39.           term.setBackgroundColor(b1)
  40.           write(" ")
  41.           term.setBackgroundColor(b2)
  42.           write(" ")
  43.           term.setBackgroundColor(b3)
  44.           print(" ")
  45.           term.setBackgroundColor(colors.black)
  46.           items = false
  47.         end
  48.       end
  49.     end
  50.   end
  51. chest.setColours(1,1,1)
Add Comment
Please, Sign In to add comment