Posted by coyo on Sun 11th Sep 16:18 (modification of post by view diff)
download | new post
- #!/env/ruby
- #@file: buttsex.rb
- #@author: Alex Maurin
- #@desc: A simple PSYC connection handler in ruby.
- require 'socket'
- host = 'psyced.org'
- port = 4404
- tag = rand(1000000-9999999)
- puts "connecting to: #{IPSocket::getaddress(host)}\n"
- s = TCPSocket.open(host,port)
- s.puts(".\n.\n")
- s.puts(":_nick rubybot")
- s.puts(":_source psyc://coyotama.pwnz.org/~rubybot")
- s.puts(":_target psyc://psyced.org/@welcome\n")
- s.puts(":_tag #{tag} \n")
- s.puts("_request_context_enter\n")
- s.puts(".\n")
- tag = tag + 1
- s.puts(":_nick rubybot")
- s.puts(":_source psyc://coyotama.pwnz.org/~rubybot")
- s.puts(":_target psyc://psyced.org/@welcome\n")
- s.puts(":_tag #{tag} \n")
- s.puts("_message Hello World\n")
- s.puts(".\n")
- tag = tag + 1 # it's something to do with this, if you run ruby with -wc, it complains about it
- #s.puts(":_target psyc://psyced.org/@welcome\n") # durp
- #s.puts(":_tag #{tag} \n")
- #s.puts("_request_context_leave\n")
- #s.puts(".\n")
- #s.close
- 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.