Advertisement
mcfeuersturm

Turbine

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