#!/usr/bin/expect log_user 0 spawn bnbot bnetdhostname expect { Username: { send "botuser\r" } } expect { Password: { send "botpasswd\r" } } for {set i 1} {$i<11} {incr i} { send "/ladderinfo $i SEXP\r" expect { -re "1018 INFO \"Brood War active\\s+(\\d+)\:\\s+(\[\\w.\]+)\\s+(\\d+)/(\\d+)/(\\d+)\\s+rating\\s+(\\d+)\"" { set rank $expect_out(1,string) set user $expect_out(2,string) set wins $expect_out(3,string) set loss $expect_out(4,string) set draw $expect_out(5,string) set rate $expect_out(6,string) send_user "