Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'socket'
- ################
- # Variables declaration: Settings
- ################
- Server = "irc.quakenet.org"
- Port = "6667"
- Nick = "EEDbot"
- User = "EEDbot claneed.free.fr irc.quakenet.org :EEDbot"
- # If the server is not irc.quakenet.org then set Authed to FALSE and ignore Qauth & Qpass
- Authed = TRUE
- # N.B. make sure to clear the Qpass variable before sending on this code!!!
- Qauth = "EEDbot"
- Qpass = "LFysvrYL9k"
- # The channel in which the bot functions
- Chan = "#test555"
- def main
- $Done = FALSE
- $Initialized = FALSE
- while (!$Done)
- #IRC protocol limits messages to 512 characters, ie 4096 bytes
- data = $conn.recv(4096).strip
- if (!$Initialized) then
- $conn.send("NICK #{Nick}",0)
- $conn.send("USER #{User}",0)
- puts ">>> Sending Nick and User info"
- $Initialized = TRUE
- end
- data.split("\n").each do |line|
- case line
- when /^PING :(.+)$/i
- puts "[Server Ping :#{$1}]"
- $conn.send("PONG #{$1}",0)a
- else
- puts line
- end
- end
- puts "--- initialized = #{$Initialized}" #temporarily print variablea
- STDOUT.flush
- end
- end
- $conn = TCPSocket.new(Server,Port)
- main
Add Comment
Please, Sign In to add comment