Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Variables
- mon = peripheral.wrap("right")
- reactor = peripheral.wrap("back")
- fuelAmount = reactor.getFuelAmount()
- maxFuel = reactor.getFuelAmountMax()
- ELT = reactor.getEnergyProducedLastTick()
- fuelReactivity = reactor.getFuelReactivity()
- --functions
- function reset()
- mon.clear()
- mon.setCursorPos(1,1)
- end
- function gui()
- reset()
- mon.setCursorPos(1,1)
- if reactor.getActive == true then
- print("Reactor On")
- else
- print("Reactor Off")
- end
- print("Fuel:"..fuelAmount.."/"..maxFuel)
- print("RF/t:"..ELT)
- print("Reactivity:".. fuelReactivity.."%")
- mon.setCursorPos(1,11)
- print("Reactor ON/OFF")
- end
- --Main Program
- reset()
- gui()
- os.pullEvent()
- touch = {os.pullEvent()}
- event = touch[1]
- side = touch[2]
- xPos = touch[3]
- yPos = touch[4]
- mon.setCursorPos(1,12)
- print(event)
- print(side)
- print(xPos)
- print(yPos)
- while true do
- if event == monitor_touch and xPos >= 1 and xPos <= 14 and yPos == 11 then
- if reactor.getActive() == true then
- reactor.setActive(false)
- gui()
- elseif reactor.getActive() == false then
- reactor.setActive(true)
- gui()
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment