eytixis

IC2ReactorProjectRegister

Feb 11th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.82 KB | None | 0 0
  1. slots = {}
  2.  
  3.  
  4. function interface()
  5.     termClear()
  6.     term.write("ID of prototype reactor: ")
  7.     prototype = read()
  8.     prototype = "nuclear_reactor_"..prototype
  9.     reactor = peripheral.wrap(prototype)
  10. end
  11.    
  12. function termClear()
  13.     term.clear()
  14.     term.setCursorPos(1,1)
  15. end
  16.  
  17. function readReactor()
  18.     for i =1,54 do
  19.         if not (reactor.getStackInSlot(i) == null) then
  20.             if reactor.getStackInSlot(i).raw_name == "ic2.reactoruraniumdual" then
  21.                 slots[i] = "dual"
  22.             elseif reactor.getStackInSlot(i).raw_name == "ic2.reactoruraniumsimple" then
  23.                 slots[i] = "simple"
  24.             else
  25.                 slots[i] = "ignore"
  26.             end
  27.         else
  28.             slots[i] = "ignore"
  29.         end
  30.     end
  31. end
  32.  
  33. function writeFile()
  34.     file = fs.open("layout", "w")
  35.     file.write(textutils.serialize(slots))
  36.     file.close()
  37. end
  38.  
  39. interface()
  40. readReactor()
  41. writeFile()
  42. print("done")
Add Comment
Please, Sign In to add comment