# vim:ts=4 set lb(ver) 0.9 set lb(pre) % set lb_dir /home/lazy/bot/scripts bind pub -|- $ms(pre)lb getscores proc getscores {nick uhost hand chan arg} { global lb_dir set search [lindex $arg 0] set count [lindex $arg 1] if {$search == ""} { putchan $chan "Usage: %lb \[#scores\]" } { if {$count > 5} { # putserv "NOTICE $nick :Fetching the top $count scores for $search...please wait" } { # putchan $chan "Fetching the top $count scores for $search...please wait" } set result [open [concat "|$lb_dir/leaderboard.pl $search $count"] r] } while {[gets $result line]>-1} { if {$count > 5} { putserv "NOTICE $nick :$line" } { putchan $chan "$line" } } catch {close $result} return 0 } putlog "*** MAME Leaderboard $lb(ver) loaded."