1 set steamid(version) "0.1" 2 3 bind pub - !steamid searchsteam:pub 4 5 6 proc searchsteam:pub {nick host hand chan arg} { 7 global steamid 8 if {[string match -nocase {} [lindex $arg 0]] && ![string match -nocase -help [lindex $arg 0]]} { 9 putserv "PRIVMSG $chan :Invalid search string." 10 } elseif {[string match -nocase -help [lindex $arg 0]]} { 11 putserv "PRIVMSG $chan :$steamid(trigger) ." 12 } elseif {![string match -nocase {} [lindex $arg 0]] && ![string match -nocase -help [lindex $arg 0]]} { 13 putlog "Sock Opened" 14 set query [string map {\x3A %3A \\ \\\\ \{ \\\{ \} \\\} \" \\\" \[ \\\[ \] \\\] \x2E x2E} [lindex $arg 0]] 15 catch {socket steamid.esportsea.com 80} sock 16 flush $sock 17 puts $sock "GET /index.php?action=search&type=single&key=steam_id&query=$query&output=xml&version=extended HTTP/1.1" 18 puts $sock "Host: steamid.esportsea.com" 19 puts $sock "Connection: Close" 20 puts $sock "User-Agent: Mozilla" 21 puts $sock "\n\r" 22 putlog "Sock Flushed" 23 putlog "[eof $sock]" 24 while {![eof $sock]} { 25 flush $sock 26 gets $sock line 27 putlog "Sock Get Flushed" 28 } 29 30 31 #while {![eof $sock]} { 32 # flush $sock 33 # gets $sock line 34 # #if {[string match -nocase "] 0]]} { 35 # # #set league_player_id($id) [lindex [string map { {} {}} $line] 0] 36 # #} 37 #} 38 if {[info exists sock]} { 39 close $sock 40 putlog "Sock Closed" 41 } 42 set searchresluts 0 43 if {$searchresluts == 0} { 44 putserv "PRIVMSG $chan :$searchresluts results found." 45 } 46 } 47 }