Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --pastebin get PYkQQmSx startup.lua
- monitor = peripheral.wrap("monitor_6")
- speedControllersWater = {peripheral.wrap("Create_RotationSpeedController_1"),
- peripheral.wrap("Create_RotationSpeedController_2"),
- peripheral.wrap("Create_RotationSpeedController_0"),
- peripheral.wrap("Create_RotationSpeedController_3"),
- peripheral.wrap("Create_RotationSpeedController_4"),
- peripheral.wrap("Create_RotationSpeedController_5")}
- speedControllersLava = {peripheral.wrap("Create_RotationSpeedController_9"),
- peripheral.wrap("Create_RotationSpeedController_10"),
- peripheral.wrap("Create_RotationSpeedController_11"),
- peripheral.wrap("Create_RotationSpeedController_12"),
- peripheral.wrap("Create_RotationSpeedController_13"),
- peripheral.wrap("Create_RotationSpeedController_14")}
- clutchOutput = "top"
- lavaOff = 0.000000001
- lavaLow = 24
- lavaOn = 128
- waterOff = 0.000000001
- waterLow = 32
- waterOn = 128
- monitor.setBackgroundColor(colors.black)
- monitor.clear()
- function loop()
- --loop
- monitor.setTextColor(colors.white)
- monitor.setBackgroundColor(colors.lightGray)
- monitor.setCursorPos(1,1)
- monitor.write("Engine: : 1 2 3 4 5 6")
- monitor.setCursorPos(1,2)
- monitor.setBackgroundColor(colors.lightBlue)
- monitor.write("WaterOff : | | | | | ")
- monitor.setCursorPos(1,3)
- monitor.write("WaterLow : | | | | | ")
- monitor.setCursorPos(1,4)
- monitor.write("WaterHigh : | | | | | ")
- monitor.setCursorPos(1,5)
- monitor.setBackgroundColor(colors.orange)
- monitor.write("LavaOff : | | | | | ")
- monitor.setCursorPos(1,6)
- monitor.write("LavaLow : | | | | | ")
- monitor.setCursorPos(1,7)
- monitor.write("LavaHigh : | | | | | ")
- monitor.setCursorPos(1,8)
- monitor.setBackgroundColor(colors.green)
- monitor.write("EnableOutput ")
- monitor.setCursorPos(1,9)
- monitor.setBackgroundColor(colors.red)
- monitor.write("DisableOutput ")
- end
- function generalUpdate()
- while true do
- loop()
- sleep(0.01)
- end
- end
- function respondMonitorTouched()
- while true do
- event, side, xPos, yPos = os.pullEvent("monitor_touch")
- if xPos >= 17 and xPos <= 28 then
- i_engine = math.floor((xPos-15)/2)
- print(i_engine)
- if yPos == 2 then
- speedControllersWater[i_engine].setTargetSpeed(waterOff)
- end
- if yPos == 3 then
- speedControllersWater[i_engine].setTargetSpeed(waterLow)
- end
- if yPos == 4 then
- speedControllersWater[i_engine].setTargetSpeed(waterOn)
- end
- if yPos == 5 then
- speedControllersLava[i_engine].setTargetSpeed(lavaOff)
- end
- if yPos == 6 then
- speedControllersLava[i_engine].setTargetSpeed(lavaLow)
- end
- if yPos == 7 then
- speedControllersLava[i_engine].setTargetSpeed(lavaOn)
- end
- end
- if yPos == 8 then
- redstone.setOutput(clutchOutput,true)
- end
- if yPos == 9 then
- redstone.setOutput(clutchOutput,false)
- end
- end
- end
- sleep(15)
- parallel.waitForAny(respondMonitorTouched,generalUpdate)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement