Code: Select all
# results format
set nickchan "nick/#chan"
# channel
set scanchan "#agemania"
# inform ports
set port "2300 47624"
bind join - * scan
bind join - !scan
set ver "v1.0"
proc scan {nick uhost hand chan} {
global botnick nickchan port scanchan
set scanport [lindex [split $uhost @] 1]
set scanportfound ""
if {([lsearch -exact [string tolower $scanchan] [string tolower $chan]] != -1)} {
catch {socket $scanport $port} sport
if {([string range $sport 0 3] == "sock") && ([lindex $sport 1] == "")} {
close $sport
lappend scanportfound "1"
}
if {$scanportfound == ""} {
set scanportfound "0"
}
if {[string match $scanportfound [string tolower 1]]} {
putserv "PRIVMSG $nickchan :Nick <$nick> Host <$scanport> Port <$port> Chan <$chan>"
return
}
}
}
This script is based on testing whether the user who entered the channel is suspect anyway, then automatically evaluates eggdrop its doors as discrimidas. But I would like to modify in order to assess whether the specific ports show that the user is ready to play.
example: !scan <ip address>
Thus eggdrop replies doors are liberated to play, otherwise it answers no.
Can anyone help finalize?
Thank you!