Advertisement
mcfeuersturm

turbineaus

Feb 17th, 2019
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.01 KB | None | 0 0
  1. local mouseWidth = 0
  2. local mouseHeight = 0
  3. local m = peripheral.find("monitor")
  4. local react = peripheral.find("BigReactors-Reactor")
  5. local turb = peripheral.find("BigReactors-Turbine")
  6.  
  7. w,h=m.getSize()
  8.  
  9. status=1
  10. m.clear()
  11.  
  12.  
  13. function Status()
  14. repeat until Status1=100
  15. steam = turb.getFluidFlowRate()      
  16. speed = turb.getRotorSpeed()
  17. speed2 = math.ceil(speed, 0.1)
  18. energy = turb.getEnergyProducedLastTick()
  19. energy2 = math.ceil(energy, 0.1)
  20. estored = turb.getEnergyStored()/100
  21. fuelconsum = react.getFuelConsumedLastTick()
  22. fuelconsum2 = math.ceil(fuelconsum, 0.1)
  23. fuel = react.getFuelAmount()
  24.  
  25. m.setTextColour(colors.white)
  26. m.clear()
  27. m.setCursorPos(1,1)
  28. m.write("Dampf/t: ")
  29. m.write(steam)
  30. m.setCursorPos(1,2)
  31. m.write("Rotor  : ")
  32. m.write(speed2)
  33. m.setCursorPos(1,3)
  34. m.write("RF/T   : ")
  35. m.write(energy2)
  36. m.setCursorPos(1,4)
  37. m.write("KRF    : ")
  38. m.write(estored)
  39. m.setCursorPos(1,5)
  40. m.write("MB/t   : ")
  41. m.write(fuelconsum2)
  42. m.setCursorPos(1,6)
  43. m.write("Yellorium: ")  
  44. m.write(fuel)
  45. m.setCursorPos(21,1)
  46. m.setTextScale(1.5)
  47. m.setTextColour(colors.white)
  48. m.write("Status:")
  49. m.setCursorPos(21,2)
  50. m.setTextColour(colors.green)
  51. m.write("An")
  52. m.setCursorPos(21,3)
  53. m.setTextColour(colors.white)
  54. m.setBackgroundColour((colours.lime))
  55. m.setCursorPos(21,3)
  56. m.write(" An  ")
  57. m.setCursorPos(21,5)
  58. m.write(" Aus ")
  59. m.setBackgroundColour((colours.black))
  60. sleep(1)
  61. until status==100
  62. end
  63.  
  64. function cCP() --cCP = checkClickPosition
  65.   if mouseWidth > 21 and mouseWidth < 25 and mouseHeight == 3 then
  66.        react.setActive(true)
  67.        turb.setActive(true)
  68.       elseif mouseWidth > 21 and mouseWidth < 25 and mouseHeight == 5 then
  69.       react.setActive(false)
  70.       turb.setActive(false)
  71.     shell.run("Turbine")
  72.      end
  73. end
  74.  
  75. function touch()
  76. repeat
  77.   event,p1,p2,p3 = os.pullEvent("monitor_touch")
  78.  
  79.    if event=="monitor_touch" then      
  80.      mouseWidth = p2
  81.      mouseHeight = p3  
  82.      cCP()
  83.    end
  84.  
  85. until event=="char" and p1==("x")
  86. end
  87.  
  88. parallel.waitForAll(cCP,touch,Status)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement