Advertisement
smigger22

Reactor Client

Aug 1st, 2015
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. rednet.open( "top" )
  2. tArgs = { ... }
  3.  
  4. function printUsage()
  5. print( "Usages:" )
  6. print( shell.getRunningProgram() .. " <id> <on:off>" )
  7. end
  8.  
  9. if #tArgs ~= 2 then
  10. printUsage()
  11. else
  12. if tArgs[ 2 ] ~= "on" and tArgs[ 2 ] ~= "off" then
  13. error( "Valid answers are on or off.", 0 )
  14. else
  15. rednet.send( tonumber( tArgs[ 1 ] ), tArgs[ 2 ] )
  16. id, msg, dis = rednet.receive()
  17. if msg == "Reactor Success" then
  18. print( "The reactor has been turned " .. tArgs[ 2 ] .. "." )
  19. else
  20. print( "We have received no signal from the reactor, and as a result, the reactor has not been turned " .. tArgs[ 2 ] .. "." )
  21. end
  22. end
  23. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement