| View previous topic :: View next topic |
| Author |
Message |
rUMENcho Voice
Joined: 18 Dec 2011 Posts: 4
|
Posted: Sun Dec 18, 2011 11:34 am Post subject: Message to users who connect to my server |
|
|
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  |
|
| Back to top |
|
 |
Johannes13 Halfop
Joined: 10 Oct 2010 Posts: 46
|
Posted: Tue Jan 31, 2012 2:46 pm Post subject: |
|
|
It is simple:
1st: Your bot need to get all user connected messages. This is usually done by OPERing the bot.
2nd: You need the raw line that the server sends out to all opers (or peoples who should see such a thing).
Now you can use [bind raw] and extraxt the nick from that message with regexp. After you have the nick just send him a NOTICE. Sure, a PRIVMSG would work as well, but this would be annoying. |
|
| Back to top |
|
 |
Regex Voice
Joined: 19 Mar 2011 Posts: 19
|
Posted: Mon Feb 13, 2012 11:15 am Post subject: |
|
|
Of course, this script may use..
If your connection message like that;
*** Notice -- Client connecting on port 6667: CLubber (mirc@85.97.---.--) [clients]
You may, send a message who connects your server.
| Code: |
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."
}
}
|
Your bot must be OPER. Otherwise it doesn't work. |
|
| Back to top |
|
 |
Get_A_Fix Master

Joined: 07 May 2005 Posts: 206 Location: New Zealand
|
Posted: Fri Feb 24, 2012 12:24 pm Post subject: |
|
|
Alternatively
| Code: |
# 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."
|
Easily modified to suit. _________________ We explore.. and you call us criminals. We seek after knowledge.. and you call us criminals. We exist without skin color, without nationality, without religious bias.. and you call us criminals. |
|
| Back to top |
|
 |
|