ruby pastebin

Posted by coyo on Sun 11th Sep 16:18 (modification of post by view diff)
download | new post

  1. #!/env/ruby
  2.  
  3. #@file: buttsex.rb
  4. #@author: Alex Maurin
  5. #@desc: A simple PSYC connection handler in ruby.
  6.  
  7. require 'socket'
  8. host = 'psyced.org'
  9. port = 4404
  10. tag = rand(1000000-9999999)
  11. puts "connecting to: #{IPSocket::getaddress(host)}\n"
  12.  
  13. s = TCPSocket.open(host,port)
  14. s.puts(".\n.\n")
  15.  
  16. s.puts(":_nick rubybot")
  17. s.puts(":_source psyc://coyotama.pwnz.org/~rubybot")
  18. s.puts(":_target psyc://psyced.org/@welcome\n")
  19. s.puts(":_tag #{tag} \n")
  20. s.puts("_request_context_enter\n")
  21. s.puts(".\n")
  22.  
  23. tag = tag + 1
  24.  
  25. s.puts(":_nick rubybot")
  26. s.puts(":_source psyc://coyotama.pwnz.org/~rubybot")
  27. s.puts(":_target psyc://psyced.org/@welcome\n")
  28. s.puts(":_tag #{tag} \n")
  29. s.puts("_message Hello World\n")
  30. s.puts(".\n")
  31.  
  32. tag = tag + 1 # it's something to do with this, if you run ruby with -wc, it complains about it
  33.  
  34. #s.puts(":_target psyc://psyced.org/@welcome\n") # durp
  35. #s.puts(":_tag #{tag} \n")
  36. #s.puts("_request_context_leave\n")
  37. #s.puts(".\n")
  38.  
  39. #s.close
  40. puts 'connected...'

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with @@


I'm Human
Remember me



Captcha required for posting