i'm just "curious" if my coding is "right"
after looking through this and this, i got lost
while true do local e = os.pullEvent( "redstone" ) --# wait for a redstone event, look it up on the wiki! if redstone.getInput( "left" ) then shell.run( "myprogram" ) end endcredits to engineer for writing this in this post.
could i implement that piece of code into a function and use it to change a word on my monitor and change the state of my reactor??
local function active()
while true do
local e = os.pullEvent( "redstone" )
if redstone.getInput( "left" ) then
mon.SetCursorPos(1,7)
mon.clearLine
if rea.setActive == false then
rea.setActive(true)
mon.write("Reactor is: ON")
else
rea.setActive(false)
mon.write("Reactor is: OFF")
end
end
end
end
Edited by Dustmuz, 10 November 2014 - 07:28 PM.












