Advertisement
NanoBob

ender chest loop

Jun 22nd, 2014
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. chest=peripheral.wrap("left")
  2. colors={
  3. 1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768
  4. }
  5. args={ ... }
  6. if args[1]==nil then
  7.     args={1,1,1}
  8. end
  9.  
  10. function checkContents()
  11.     repeat
  12.         content=0
  13.         for i=1,27 do
  14.             slotContent=chest.getStackInSlot(i)
  15.             if slotContent==nil then
  16.                 content=content
  17.             else
  18.                 content=content+1
  19.             end
  20.         end
  21.         if content>0 then
  22.             sleep(1)
  23.         end
  24.     until content<=0
  25.     return content
  26. end
  27.  
  28. function colorCycle()
  29.     colorL,colorM,colorR=chest.getColors()
  30.     for i=0+tonumber(args[1]),16 do
  31.         colorL=colors[i]
  32.         for i=0+tonumber(args[2]),16 do
  33.             colorM=colors[i]
  34.             for i=0+tonumber(args[3]),16 do
  35.                 colorR=colors[i]
  36.                 chest.setColours(colorL,colorM,colorR)
  37.                 checkContents()
  38.             end
  39.         end
  40.     end
  41. end
  42.  
  43. colorCycle()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement