proc find {nick host hand chan arg} {
if {[llength $arg] < 1} then {
putquick "NOTICE $nick : You might wanna put in a search word to limit the list a bit"
return
}
set stat [exec_players]
set stat_arr [split $stat "\n"]
set i 0
set str $stat_arr
set found 0
# set str [lsort $stat_arr]
for {set i 0} {$i < [llength $str]} {incr i} {
set j [expr $i + 1]
# Loop through all the players and save them into a list
while {[string range [lindex $str $j] 0 6] == "Player:"} {
set player [string trimleft [lindex $str $j] "Player:"]
set playername [lindex [split $player " "] 2]
set server [join [lindex [split [lindex $str $i] ""] 1] " "]
if {[string first [string tolower $arg] [string tolower $playername]] != -1} then {
incr found
putquick "NOTICE $nick :$playername is on $server "
}
incr j
}
# Make sure we don't check through the players again
set i [expr $j - 1]
}
set info_str [get_number_of $found "player"]
putquick "NOTICE $nick :$info_str"
return 0
}
Last edited by Black|Man on Thu Dec 12, 2002 2:28 pm, edited 2 times in total.