egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Need some help "Gameserver_Query"

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
BloodyAngel
Voice


Joined: 02 Jan 2007
Posts: 3

PostPosted: Tue Jan 02, 2007 5:09 pm    Post subject: Need some help "Gameserver_Query" Reply with quote

I am new and have a problem Razz

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
View user's profile Send private message
r0t3n
Owner


Joined: 31 May 2005
Posts: 507
Location: UK

PostPosted: Tue Jan 02, 2007 8:20 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
BloodyAngel
Voice


Joined: 02 Jan 2007
Posts: 3

PostPosted: Wed Jan 03, 2007 7:48 am    Post subject: Reply with quote

thx for help Smile

But this is what i tried before, and it was the same Sad

He write it one below the other

Name: Blablabla
Honor: 34

Maybe it could be a fault of the html code?

Quote:

<td>&nbsp;</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>&nbsp;</td>


Hmmm i try it with a hidde line Smile
Back to top
View user's profile Send private message
BloodyAngel
Voice


Joined: 02 Jan 2007
Posts: 3

PostPosted: Thu Jan 04, 2007 9:50 am    Post subject: Reply with quote

Ok this problems are cleared...

but i got another one Razz

hope anybody could help me Wink

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber