Advertisement
dezindzer

Fusion tank comp

Feb 22nd, 2016
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.62 KB | None | 0 0
  1. -- INFO: For this to work, you need a Advanced Computer and a Advanced Nuclear Information Reader with liquid sensor location cards in it
  2.  
  3. -- peripheral
  4. nir = peripheral.wrap("back") --Nuclear Information Reader
  5. local mon = peripheral.wrap("top")  --Advanced Monitor
  6. term.redirect(mon)
  7. mon.setTextScale(1)
  8. mon.setCursorPos(20,1)
  9. mon.clear()
  10.  
  11. --- LOOP START--
  12. while true do  --Always loop
  13. term.setTextColor( colors.purple)
  14. mon.setCursorPos(10,1)
  15. print("|Casio 6001k|")
  16. term.setTextColor( colors.white)
  17. mon.setCursorPos(15,3)
  18. print("Buckets")
  19.  
  20. print("\n")
  21.  
  22. --Basic function
  23.  
  24. local x = 1
  25. while x < 10 do
  26.  
  27. mon.setCursorPos(6,4+x)
  28. id, state, title, data = nir.get(x)
  29. x= x+1
  30.  
  31. -- liquid search starts here
  32.  
  33.  
  34. -- 69
  35. if      data.liquidId == 21269 then
  36.     if  data.liquidMeta == 4 then
  37.         term.setTextColor( colors.gray)
  38.         print("Wolframium: "..(data.amount/1000))      
  39.     elseif data.liquidMeta == 5 then
  40.         term.setTextColor( colors.lightBlue)
  41.         print("Lithium: "..(data.amount/1000))
  42.     elseif data.liquidMeta == 7 then
  43.         term.setTextColor( colors.brown)
  44.         print("Silicon: "..(data.amount/1000))     
  45.     elseif data.liquidMeta == 10 then
  46.         term.setTextColor( colors.green)
  47.         print("Berylium: "..(data.amount/1000))    
  48.     elseif data.liquidMeta == 12 then
  49.         term.setTextColor( colors.cyan)
  50.         print("Sodium: "..(data.amount/1000))  
  51.     elseif data.liquidMeta == 16 then
  52.         term.setTextColor( colors.pink)
  53.         print("Mercury: "..(data.amount/1000))         
  54.     end
  55. -- 70
  56.  
  57. elseif data.liquidId == 21270 then  
  58.     if  data.liquidMeta == 0 then
  59.         term.setTextColor( colors.blue)
  60.         print("Hydrogen: "..(data.amount/1000))
  61.     elseif  data.liquidMeta == 1 then
  62.         term.setTextColor( colors.yellow)
  63.         print("Deuterium: "..(data.amount/1000))   
  64.     elseif data.liquidMeta == 2 then
  65.         term.setTextColor( colors.red)
  66.         print("Tritium: "..(data.amount/1000))
  67.     elseif data.liquidMeta == 3 then
  68.         term.setTextColor( colors.yellow)
  69.         print("Helium: "..(data.amount/1000))  
  70.     elseif  data.liquidMeta == 6 then
  71.         term.setTextColor( colors.yellow)
  72.         print("Helium-3: "..(data.amount/1000))
  73.     end
  74. -- 71
  75. elseif data.liquidId == 21271 then
  76.     if  data.liquidMeta == 3 then
  77.         term.setTextColor( colors.yellow)
  78.         print("Helium Plasma: "..(data.amount/1000))
  79.     elseif data.liquidMeta == 1 then
  80.         term.setTextColor( colors.yellow)
  81.         print("Deuterium: "..(data.amount/1000))
  82.     elseif data.liquidMeta == 2 then
  83.         term.setTextColor( colors.red)
  84.         print("Tritium: "..(data.amount/1000))
  85.     end
  86. elseif data.liquidId == 0 then
  87. term.setTextColor(colors.black)
  88. print("Tank empty")
  89. else
  90. print("No card info in slot "..x)
  91. end
  92.  
  93. end -- while x
  94.  
  95.   os.sleep(2)
  96. mon.clear()
  97. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement