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.

Search Info

Old posts that have not been replied to for several years.
Locked
B
Black|Man
Voice
Posts: 21
Joined: Fri Oct 25, 2002 8:49 am
Location: Denmark

Search Info

Post by Black|Man »

need help to add some line on this scrip when i write !find wolfplayer :(

1. The BOT will write this ---> Looking for 'wolfplayer', patience.

Code: Select all

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.
P
Photon
Op
Posts: 170
Joined: Wed Aug 28, 2002 8:00 am
Location: Liverpool, England

Post by Photon »

when do you want it to say this?

is exec_players a function? Need a bit more info pls...
B
Black|Man
Voice
Posts: 21
Joined: Fri Oct 25, 2002 8:49 am
Location: Denmark

Post by Black|Man »

what do you need more info about ?
P
Photon
Op
Posts: 170
Joined: Wed Aug 28, 2002 8:00 am
Location: Liverpool, England

Post by Photon »

Well ,was wondering how (for example) stat gets set up - is exec_players a function?

Basically stick your putquick before you do the exec qstat bit, I think is what you want to know...
Locked