LivioBrunner

Nuclear Reactor Computer Craft

Nov 16th, 2013
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.63 KB | None | 0 0
  1. p = peripheral.wrap("bottom")
  2. term.clear()
  3. term.setCursorPos(1,1)
  4. slot = {2,4,10,12,14,17,19,21,23,28,30,32,37,39,41,47,49}
  5. function tablelength(T)
  6.   local count = 0
  7.   for _ in pairs(T) do count = count + 1 end
  8.   return count
  9. end
  10. function isSetted(slotnum)
  11.     local tableInfo = p.getStackInSlot(slotnum)
  12.     if tableInfo == nil then
  13.         return false
  14.     else
  15.         return true
  16.     end
  17. end
  18. function make(slotnum)
  19.     if isSetted(slotnum) == false then
  20.             turtle.select(1)
  21.         turtle.dropDown()
  22.         p.pullIntoSlot("down",1,1,slotnum)
  23.     end
  24.    sleep(1)
  25. end
  26. while true do
  27.     for i = 1,tablelength(slot) do
  28.         make(slot[i])
  29.     end
  30.     sleep(5)
  31. end
Advertisement
Add Comment
Please, Sign In to add comment