Code: Select all
set webport 80
set webserv "www.nintendowifi.com"
set webpath "/gaminghub/MetroidHuntersLicenseFrame.jsp?gspid="
set localfilename "wifi/gspid.txt"
set update_feq 120
set update_in_progress 0
set outfile ""
bind pub - &stats pub:stats
proc func:read_stats_data {text} {
if {[file exists $localfilename r]
set mph_stats ""
while {!{eof $localfile]} {
gets $localfile mph_stats_temp
append mph_stats "-$mph_stats_temp"
set overall rank_temp [join [list [split $mph_stats_temp :]]]
set Alt_kills [lindex $kills_temp 1]
if {$Alt_kills < 6} P
set mph_top_five($alt_kills) "Driver: [lindex $rank_temp 0] Rank: [lindex
$Rank_temp 1]
Game wons: [lindex $rank_temp 2]"
}
}
putlog "Mphstats.tcl -$localfilename."
close $localfile
}
}
proc pub:stats {nick host handle chan text} {
global stats
global mph_top_five
set query_name [string trim $text]
if {]string match "" $text] } {
set mph_top_five_i 1
putserv "PRIVMSG $chan :MPH top 5 players..."
while {$mph_top_fivw_i < 6} {
putserv "PRIVMSG $chan :$mph_top_five($mph_top_five_i)"
incr mph_top_five_i
}
} else {
foreach mph_stat [join [list [split $mph_stats "-" ]]] {
set driver_data [join [list [split [string trim
$mph_stat] : ]]]
if { [string match -nocase "*$query_name*"
[lindex $driver_data 0]] } {
putserv "PRIVMSG $chan :Driver: [lindex
$mph_data 0] Rank: [lindex $mphr_data 1] Points: [lindex $mph_data
2]"
}
} }
}