Advertisement
EliteGaming

Smeltery

Mar 23rd, 2015
329
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. redstoneSide = "top"
  2. peripheralName = "peripheral_0"
  3. searedTanks = 3
  4. tank = peripheral.wrap(peripheralName)
  5. loopCounter = 0
  6.        
  7.     function startupClear()
  8.         f = fs.open("startup", "w")
  9.         f.write("shell.run('smeltery')")
  10.         f.close()
  11.     end
  12.  
  13.     local function readCommand()
  14.             local command = read()
  15.             return command
  16.     end
  17.  
  18.     function looper(counter)
  19.         counter = math.floor(counter/9)
  20.         counter = math.floor(counter/searedTanks)
  21.         print("Starting to loop "..counter.." times")
  22.         for int=1,counter,1 do
  23.             inter = int + 1
  24.             rs.setOutput(redstoneSide, true)
  25.             sleep(1)
  26.             rs.setOutput(redstoneSide, false)
  27.             amount = 0
  28.             while amount < 1296 do
  29.             tableInfo = tank.getInfo()
  30.             contents = tableInfo.contents
  31.             currentAmount = contents.amount
  32.             amount = currentAmount
  33.             sleep(0.1)
  34.             end
  35.             print("[UPDATE] "..int.."/"..counter.." outputed.")
  36.             sleep(4)
  37.         end
  38.         toggle()
  39.     end
  40.  
  41.  
  42. function toggle()
  43.     term.clear()
  44.         term.setCursorPos(1, 1)
  45.         term.setTextColor(colors.cyan)
  46.     print("How many ingots do you want to excrete?")
  47.     write("> ")
  48.         local command = readCommand()
  49.     looper(command)
  50. end
  51.  
  52.  
  53.  
  54.  
  55. startupClear()
  56. toggle()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement