| View previous topic :: View next topic |
| Author |
Message |
BloodyAngel Voice
Joined: 02 Jan 2007 Posts: 3
|
Posted: Tue Jan 02, 2007 5:09 pm Post subject: Need some help "Gameserver_Query" |
|
|
I am new and have a problem
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:
| Quote: |
proc 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/~janina/webspec/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
}
|
So the problem is, that the bot post it line by line
«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? |
|
| Back to top |
|
 |
r0t3n Owner
Joined: 31 May 2005 Posts: 507 Location: UK
|
Posted: Tue Jan 02, 2007 8:20 pm Post subject: |
|
|
Try changing:
| Code: | | putchan $chan "$bold Name: $bold2 $player; $honor" |
to
| Code: | | putchan $chan "$bold Name: $bold2 $player $honor" |
_________________ r0t3n @ #r0t3n @ Quakenet |
|
| Back to top |
|
 |
BloodyAngel Voice
Joined: 02 Jan 2007 Posts: 3
|
Posted: Wed Jan 03, 2007 7:48 am Post subject: |
|
|
thx for help
But this is what i tried before, and it was the same
He write it one below the other
Name: Blablabla
Honor: 34
Maybe it could be a fault of the html code?
| Quote: |
<td> </td>
<td align="left"><playername>FFC.ZWER</playername></td>
<td align="center"><playerhonor>76</playerhonor></td>
<td align="right"><playerkills>4</playerkills></td>
<td align="right"><playerkia>3</playerkia></td>
<td align="right"><playerscore>50</playerscore></td>
<td align="right"><playergoals>40</playergoals></td>
<td align="right"><playerleader></playerkills></td>
<td align="right"><playerroe>0</playerroe></td>
<td align="right"><playerping>22</playerping></td>
<td> </td>
|
Hmmm i try it with a hidde line  |
|
| Back to top |
|
 |
BloodyAngel Voice
Joined: 02 Jan 2007 Posts: 3
|
Posted: Thu Jan 04, 2007 9:50 am Post subject: |
|
|
Ok this problems are cleared...
but i got another one
hope anybody could help me
This ist the text of the "quellcode"
<!-- <serverinfo> <serverip> 213.19.130.126:1716 </serverip><servername>[Noway-Clan] -Viking Berserkers- </servername><mapname> SF Pipeline </mapname> <spieler> 20/20 </spieler> <runde> 55/7 </runde> <zeit> 6:42 </zeit> -->
But if i will get "zeit" (time) he dont write it correct.
He write it without ":" and without the first number like this:
«14:15:55» «+e`On][MusicBox» Zeit: 42 |
|
| Back to top |
|
 |
|