Posted 10 November 2014 - 07:19 PM
Hello here..
i'm just "curious" if my coding is "right"
after looking through this and this, i got lost :P/> hehe
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??
i'm just "curious" if my coding is "right"
after looking through this and this, i got lost :P/> hehe
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
end
credits 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 on 10 November 2014 - 06:28 PM