Advertisement
Guest User

startup

a guest
Jan 22nd, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.37 KB | None | 0 0
  1. interface = peripheral.wrap("front")
  2. furnace = peripheral.wrap("right")
  3. chest = peripheral.wrap("bottom")
  4.  
  5. os.startTimer(2)
  6.  
  7. while true do
  8.   os.pullEvent("timer")
  9.  
  10.   local alumentum = furnace.getStackInSlot(2)
  11.   if alumentum == nil or alumentum.qty < 31 then
  12.     print("getting Alumentum")
  13.     interface.pushItem("south", 9)
  14.     chest.pullItem("up", 1)
  15.   end
  16.  
  17.   local rsInput = rs.getBundledInput("left")
  18.   local item = furnace.getStackInSlot(1)
  19.    
  20.   if colors.test(rsInput, colors.red)
  21.     and (
  22.       item == nil
  23.       or (
  24.         (
  25.           item.ore_dict.blockAluminum == true
  26.           or item.ore_dict.blockAluminium == true
  27.         )
  28.         and item.max_size > (item.qty + 5)
  29.       )
  30.     )
  31.   then
  32.     print("burning Aluminium")
  33.     interface.pushItem("south", 1)
  34.     furnace.pullItem("west", 1)
  35.    
  36.     os.startTimer(200)
  37.   elseif (
  38.     colors.test(rsInput, colors.yellow)
  39.     or colors.test(rsInput, colors.blue)
  40.   ) and (
  41.     item == nil
  42.     or (
  43.       item.ore_dict.cropSugarcane == true
  44.       and item.max_size > (item.qty + 5)
  45.     )
  46.   )
  47.   then
  48.     print("burning sugarcane")
  49.     interface.pushItem("south", 2)
  50.     furnace.pullItem("west", 1)
  51.    
  52.     os.startTimer(6)
  53.   elseif
  54.     colors.test(rsInput, colors.white)
  55.     and (
  56.       item == nil
  57.       or (
  58.         item.ore_dict.ingotLead == true
  59.         and item.max_size > (item.qty + 5)
  60.       )
  61.     )
  62.   then
  63.     print("burning lead ingots")
  64.     interface.pushItem("south", 3)
  65.     furnace.pullItem("west", 1)
  66.    
  67.     os.startTimer(8)
  68.   elseif (
  69.     colors.test(rsInput, colors.black)
  70.     or colors.test(rsInput, colors.green)
  71.   ) and (
  72.     item == nil
  73.     or (
  74.       item.ore_dict.cobblestone == true
  75.       and item.max_size > (item.qty + 5)
  76.     )
  77.   )
  78.   then
  79.     print("burning cobblestone")
  80.     interface.pushItem("south", 4)
  81.     furnace.pullItem("west", 1)
  82.    
  83.     os.startTimer(4)
  84.   elseif colors.test(rsInput, colors.lightBlue)
  85.     and (
  86.       item == nil
  87.       or (
  88.         item.raw_name == "item.appliedenergistics2.itemmaterial.certusquartzcrystalcharged"
  89.         and item.max_size > (item.qty + 5)
  90.       )
  91.     )
  92.   then
  93.     print("burning Charged Certus Quartz")
  94.     interface.pushItem("south", 5)
  95.     furnace.pullItem("west", 1)
  96.    
  97.     os.startTimer(15)
  98.   else
  99.     print("nothing to do ... sleep a minute")
  100.     os.startTimer(60)
  101.   end
  102. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement