Advertisement
thatparadox

EnderChestCracker

Jul 14th, 2014
1,296
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.79 KB | None | 0 0
  1. for a,b in pairs(rs.getSides()) do
  2.     if peripheral.getType(b) == "ender_chest" then
  3.         chest = peripheral.wrap(b)
  4.         print("Found chest on "..b.." side")
  5.         break
  6.     end
  7. end
  8.  
  9.  
  10. while true do
  11.     for i = 0, 15 do
  12.         b1 = 2^i
  13.         for k = 0, 15 do
  14.             b2 = 2^k
  15.             for v = 0, 15 do
  16.                 b3 = 2^v
  17.                 chest.setColors(b1,b2,b3)
  18.                 os.startTimer(0.3)
  19.                 event, param1 = os.pullEvent()
  20.                 if event == "redstone" then
  21.                     write("Items found in: ")
  22.                     term.setBackgroundColor(b1)
  23.                     write(" ")
  24.                     term.setBackgroundColor(b2)
  25.                     write(" ")
  26.                     term.setBackgroundColor(b3)
  27.                     print(" ")
  28.                     term.setBackgroundColor(colors.black)
  29.                     event, param1 = os.pullEvent()
  30.                     if event == "timer" then
  31.                         event = os.pullEvent()
  32.                     end
  33.                 end
  34.             end
  35.         end
  36.     end
  37. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement