This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Test gameports

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
d
demetrius_reis
Halfop
Posts: 42
Joined: Tue Aug 10, 2010 9:54 am

Test gameports

Post by demetrius_reis »

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!
Post Reply