Hi,
I have an IRC server (ratbox 3.0) and i want to make one oper bot who will send a message to everyone who connect to my server.
Can anybody help me with this tcl?
Thanks
Code: Select all
bind raw * notice connection
proc connection {from keyword arg} {
global botnick
if {[string match -nocase "*Client connecting on port*" $arg]} {
set nick [lindex $arg 9]
set port [string range [lindex [split [lindex $arg 8] ":"] 0] 0 end]
set ident [string range [lindex [split [lindex $arg 10] "@"] 0] 1 end]
set host [string range [lindex [split [lindex $arg 10] "@"] 1] 0 end-1]
putquick "PRIVMSG $nick Hi $nick!"
putquick "PRIVMSG $nick -"
putquick "PRIVMSG $nick Your Ident: $ident"
putquick "PRIVMSG $nick Your IP: $host"
putquick "PRIVMSG $nick Your Port: $port"
putquick "PRIVMSG $nick -"
putquick "PRIVMSG $nick Welcome to our server, irc.server.com"
putquick "PRIVMSG $nick If you have any ircd/services question you may join #help channel."
putquick "PRIVMSG $nick If you have any nick/server/ban question you may join #operhelp channel."
}
}
Code: Select all
# Server Notice catch - Notices to users on connect.
# Edit the lines below to reflect what notice to send. If you add more, or remove some, don't forget to add/remove from the global arguments, under proc.
set line1 "this is the first line to send to the connecting user."
set line2 "this is the second line."
set line3 "if you need a third, then this too."
# set a list of exempt nicknames, or leave "" for none.
set nonotice {
"nick1"
"nick2"
"nick3"
}
# ------ CODE BELOW ------
bind raw - NOTICE server:notices
proc server:notices {from keyword arg} {
global nonotice line1 line2 line3
if {[string match -nocase "*Client connecting on*" $arg]} {
set nick [lindex [split $arg] 9]
foreach nonick $nonotice {
if {[string equal -nocase $nonick $nick]} {return}
putquick "NOTICE $nick :$line1"
putquick "NOTICE $nick :$line2"
putquick "NOTICE $nick :$line3"
}
}
if {[string match -nocase "*Client connecting at*" $arg]} {
set nick [lindex [split $arg] 8]
foreach nonick $nonotice {
if {[string equal -nocase $nonick $nick]} {return}
putquick "NOTICE $nick :$line1"
putquick "NOTICE $nick :$line2"
putquick "NOTICE $nick :$line3"
}
}
}
putlog "Connection Messenger loaded."