Turbine Control On/Off Button
---------Code By Jackson_Pike
while true do
mon = peripheral.wrap("top")
turb = peripheral.wrap("BigReactors-Turbine_0")
monX, monY = mon.getSize()
poll = turb.getActive()
if poll == true then
local event, side, x, y = os.pullEvent("monitor_touch")
if x >= monX-3 and y == 1 then
turb.setActive(false)
end
else
local event, side, x, y = os.pullEvent("monitor_touch")
if x >= monX-2 and y == 1 then
turb.setActive(true)
end
end
sleep(0.1)
end
Comments