Skip to content

Instantly share code, notes, and snippets.

@Noxn
Created April 11, 2010 15:02
Show Gist options
  • Save Noxn/362798 to your computer and use it in GitHub Desktop.
Save Noxn/362798 to your computer and use it in GitHub Desktop.
#!/usr/bin/ruby
# Made by Noxn. Stoopid.
# Arguments: ./filebot server port channel(without #) file
require "socket"
class Hurr
def initialize(host, port, channel, file)
@host, @port, @channel, @file = host, port, channel, file
raise "File does not exist." unless File.exists?(@file)
puts "//File Exists"
connect
sleep 2
sendfile
end
def connect
@s = TCPSocket.open(@host, @port)
@s.puts "NICK "+NICK+"\r\n"
@s.puts "USER "+IDENT+" "+@host+" bla :"+REALNAME+"\r\n"
sleep 1.9
@s.puts "JOIN #"+@channel+"\r\n"
puts "//Connected to "+@host+" "+@port+" Channel: "+@channel
end
def sendfile
@s.puts "PRIVMSG #"+@channel+" ://Printing "+@file+"\r\n"
puts "//Printing"
sleep 0.5
File.open(@file).each { |line|
puts line
sleep 0.6
@s.puts "PRIVMSG #"+@channel+" :"+line+"\r\n"
}
sleep 0.5
@s.puts "PRIVMSG #"+@channel+" ://End\r\n"
puts "//End"
sleep 0.5
@s.puts "QUIT EOF\r\n"
puts "//File send"
puts "//Quit"
end
end
NICK, IDENT, REALNAME = "FileBot", "By-Noxn", "Hurr"
dumb = Hurr.new(ARGV[0], ARGV[1], ARGV[2], ARGV[3])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment