Guest User

cycle

a guest
Mar 20th, 2014
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.79 KB | None | 0 0
  1. print "Cyclic Assembler Schematic Swapper v1.0"
  2.  
  3. function tprint(t, indent)
  4.   if not indent then indent = 0 end
  5.   if type(t) == "table" then
  6.     for k,v in pairs(t) do
  7.       if type(v)=="table" then
  8.           print(string.rep(" ",indent),k," | ",v)
  9.         tprint(v, indent+1)
  10.       else
  11.         print(string.rep(" ",indent),k," | ",v)
  12.       end
  13.     end
  14.   else
  15.     print(type(t), t)
  16.   end
  17. end
  18.  
  19. ass = peripheral.wrap("bottom")
  20.  
  21. methods = ass.listMethods()
  22. --tprint(methods)
  23.  
  24. schematics = 0
  25. stacks = ass.getAllStacks()
  26. for k,v in pairs(stacks) do
  27.   if v.id == 20262 then
  28.     schematics = schematics + 1
  29.   end
  30. end
  31. --tprint(stacks)
  32. print(schematics," schematics")
  33.  
  34. while true do
  35.   for i=4,(2+schematics) do
  36.     sleep(math.ceil(60/schematics))
  37.     ass.swapStacks(1,i)
  38.   end
  39. end
Advertisement
Add Comment
Please, Sign In to add comment