Please be advised, that this was my tcl script that I wrote. But, like what I think your trying to do. It was to help protect the irc network that I am a part of. What this paragraph does is interpet any notice that the eggdrop receives, looking only for connect notices(both far and local). This specific script ignores any connect notices that occur from either services or statserv, which I beleive you will want to also. Once it was determined that a connect was occuring against the network, the script then takes the string as an array and strips out the ip. Which, then I did what I needed to do. Follows is the code for the raw NOTICE bind and paragraph that I use.
Code: Select all
#
# non_scannable_servers is the names of servers that you do not want netbopm to monitor. Examples would
# be services due to people not identifying their nick in time. Waste of time for netbopm to even
# look at anything from there, and statserv due to various bots that join to collect statistics.
#
set non_scannable_servers {
"Services.AwesomeChat.Net"
"Stats.AwesomeChat.Net"
}
#
# Variable for determining if a user has connected on the server that the eggdrop is on, or another
# server on the network.
#
set remote_connect "Client connecting at"
# Check_Raw_Notices: This event is used to capture the connects of users from the various
# servers. Once the bind occurs, then the server is checked to determine if there is
# an active bopm proxy bot monitoring it. If not, then a random bopm proxy bot is
# selected. And a manual scan command is issued to the bopm monitor channel for the
# ip of the connecting user to be checked.
#
bind raw - Notice Check_Raw_Notice
proc Check_Raw_Notice {from word text} {
global botnick
global bopm_channel
global active_bopm_bots
global active_bopm_servers
global non_scannable_servers
global ips_scanned
global remote_connect
global ban_time
global server
set string_text [join [list $text]]
set string_check1 [string match *problems* $string_text]
if {([string match *connecting* $string_text])
&& (!$string_check1)} {
if {[string match *$remote_connect* $string_text]} {
set enclosed_ip [string trimleft [lrange [split $text] 9 9] *(]
set da_server [split [lindex $text 7] :]
set connect_nick [lindex $string_text 8]
} else {
set enclosed_ip [string trimleft [lrange [split $text] 10 10] *(]
set da_server [split $server :]
set connect_server [lindex $da_server 0]
set connect_nick [lindex $string_text 9]
}
set connect_server [lindex $da_server 0]
set enclosed_ip [string trimright $enclosed_ip )*]
set list_ip [split $enclosed_ip @]
set daip [lindex $list_ip 1]
puthelp "PRIVMSG $bopm_channel :$connect_nick has connected oin $connect_server"
if {([llength $active_bopm_bots] == -1)} {
return 0
} else {
if {([llength $active_bopm_bots] == 0)} {
set danumber 0
} else {
set danumber [rand [llength $active_bopm_bots]]
}
}
set danick [lindex $active_bopm_bots $danumber]
if {(![string match *$connect_server* $active_bopm_servers])
&& (![string match *$connect_server* $non_scannable_servers*])} {
putloglev * $bopm_channel "---"
putloglev * $bopm_channel "$danick is scanning ip $daip on server $connect_server"
putloglev * $bopm_channel "---"
puthelp "PRIVMSG $bopm_channel :$danick scan $daip"
incr ips_scanned 1
}
}
return 0
}
Now, what they was saying is. If you read the documentation concerning the raw event. It very highly advise's of issuing a return code of 0. Very highly. Also, I know you probably didnt want to see all of this paragraph, but I wanted to show how I loaded the string from the notice into an array , pulled out the ip. What I think you are looking for is to extract the nick from a connect notice, so that you can do a ctcp version. With the case of Unreal, this is right before the location of the ip/host.
Errr, I hope this helps. By the way, again as I was saying. I think you are trying to do the same thing I am. Protect our network from bots. If you have any sugestions with regard to these sdbots. We get them too. So, Im all ears.
droolin