Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open( "top" )
- tArgs = { ... }
- function printUsage()
- print( "Usages:" )
- print( shell.getRunningProgram() .. " <id> <on:off>" )
- end
- if #tArgs ~= 2 then
- printUsage()
- else
- if tArgs[ 2 ] ~= "on" and tArgs[ 2 ] ~= "off" then
- error( "Valid answers are on or off.", 0 )
- else
- rednet.send( tonumber( tArgs[ 1 ] ), tArgs[ 2 ] )
- id, msg, dis = rednet.receive()
- if msg == "Reactor Success" then
- print( "The reactor has been turned " .. tArgs[ 2 ] .. "." )
- else
- print( "We have received no signal from the reactor, and as a result, the reactor has not been turned " .. tArgs[ 2 ] .. "." )
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement