
Ok i will write a script wich gets some informations about a gameserver.
The informations can be read via a webbrowser tool named "webspectatort"
here the script:
So the problem is, that the bot post it line by lineproc shrink { calc number string start bl} { return [expr [string first "$string" $bl $start] $calc $number] }
proc pub:serverinfo {nick uhost hand chan arg} {
global ip port
set temp [open "ip" r]
set ip [gets $temp]
close $temp
set temp [open "port" r]
set port [gets $temp]
close $temp
if {[catch {set sock [socket www.project-weltherrschaft.de 80] } sockerror]} {
putlog "error: $sockerror"
return 0 } else {
puts $sock "GET http://www.project-weltherrschaft.de/~j ... /index.php HTTP/1.0"
puts $sock "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9)"
puts $sock "Host: www.project-weltherrschaft.de"
puts $sock "Connection: close"
puts $sock ""
flush $sock
while {[eof $sock] != 1} {
set bl [gets $sock]
set player [string range $bl [shrink + 12 "<playername>" 0 $bl] [shrink - 1 "</playername>" 0 $bl]]
set honor [string range $bl [shrink + 13 "<playerhonor>" 0 $bl] [shrink - 1 "</playerhonor>" 0 $bl]]
set bold "\002\00315,1"
set bold2 "\002\0037,1"
putchan $chan "$bold Playerliste:"
putchan $chan "$bold Name: $bold2 $player; $honor"
}}
close $socks
}
«21:25:54» «+e`On][MusicBox» Playerliste:
«21:25:56» «+e`On][MusicBox» Name: Honor:
«21:25:58» «+e`On][MusicBox» Name: oldboys]Kampf_Sani Honor:
«21:26:00» «+e`On][MusicBox» Name: Honor: 47
«21:26:02» «+e`On][MusicBox» Name: theFAB.clobystar Honor:
«21:26:04» «+e`On][MusicBox» Name: Honor: 81
«21:26:06» «+e`On][MusicBox» Name: [-OMA-]H!t]-[M@n Honor:
«21:26:08» «+e`On][MusicBox» Name: Honor: 95
How can i script it, that he wrote it like this:
Name: oldboys]Kampf_Sani Honor: 85
And why is the first line empty?