minimic2002

WOS Reactor

Jul 10th, 2024
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. local function RegTemp()
  2.  
  3. local Temp = GetPartFromPort(1,"Reactor")
  4. Temp = Temp:GetTemp()
  5. local Poly = GetPartFromPort(1,"Polysilicon")
  6.  
  7. if Temp > 1040 then
  8. local Poly = GetPartFromPort(1,"Polysilicon")
  9. Poly:Configure({["PolysiliconMode"] = 2})
  10. TriggerPort(1)
  11. wait(10)
  12. end
  13.  
  14. if Temp > 1015 then -- Activate
  15. Poly:Configure({["PolysiliconMode"] = 0})
  16. TriggerPort(1)
  17. --Poly:Trigger()
  18. end
  19.  
  20. if Temp < 1000 then -- Deactivate
  21. Poly:Configure({["PolysiliconMode"] = 1})
  22. TriggerPort(1)
  23. --Poly:Trigger()
  24. end
  25. end
  26.  
  27. local function RegFuel()
  28. local Temp = GetPartFromPort(1,"Reactor")
  29. local Dis = GetPartFromPort(2,"Dispenser")
  30. Temp = Temp:GetFuel()
  31. local TotalF = 0
  32. for i,v in pairs(Temp) do
  33. TotalF = TotalF + v
  34. end
  35. if TotalF <= 0.97 then
  36. local Poly = GetPartFromPort(1,"Polysilicon")
  37. Poly:Configure({["PolysiliconMode"] = 2})
  38. for i = 1,4 do
  39. TriggerPort(1)
  40. end
  41.  
  42. end
  43. if TotalF <=0 then
  44. for i = 1,4 do
  45. Dis:Dispense()
  46. end
  47. end
  48. end
  49.  
  50. while true do
  51. local s,e = pcall(function()
  52. task.spawn(function()
  53. RegTemp()
  54. RegFuel()
  55. end)
  56. end)
  57. if e then
  58. local Poly = GetPartFromPort(1,"Polysilicon")
  59. Poly:Configure({["PolysiliconMode"] = 2})
  60. TriggerPort(1)
  61. print(e)
  62. wait(5)
  63. end
  64. wait(0.05)
  65. end
Advertisement
Add Comment
Please, Sign In to add comment