| View previous topic :: View next topic |
| Author |
Message |
deadite66 Halfop
Joined: 30 May 2005 Posts: 74 Location: Great Yarmouth, UK
|
Posted: Sat Jul 09, 2005 10:44 pm Post subject: qstat map change notify |
|
|
hi, looking for a script that could run qstat, extract the map name then paste it in a irc chat room when the map changes
qstat output example below
| Code: | ./qstat -ut2s 217.77.176.198:7777
ADDRESS PLAYERS MAP RESPONSE TIME NAME
217.77.176.198:7777 0/32 ONS-Dinora-32p- 61 / 0 ONSOnslaughtGame Titan Internet 32-man Server - Custom Links, Maps + ECE |
perhaps run qstat every 30 seconds then announce when the map changes.
only dealing with UT2004 onslaught maps so every map starts with ONS-
many thanks in advance. |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Sun Jul 10, 2005 12:21 am Post subject: |
|
|
this isn't quake, ut, cs, doom etc. forum
if you need an eggdrop script that interfaces those games/systems/servers/whatever, provide detailed interface protocol specifications and hope for the best (i.e. someone with nothing better to do to bother and write it for you)
or hope someone will have exactly what you want, chanses of which are slim to none |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Sun Jul 10, 2005 12:38 am Post subject: |
|
|
oh wait... you just want to capture some external program's output (I usually get slightly annoyed upon mentioning anything quake, cs, etc.)
here you go:
| Code: |
bind time - * qstat ;# runs every minute
proc qstat {m h d mo y} {
if ![catch {set res [exec /path/to/qstat -ut2s 217.77.176.198:7777]}] {
foreach line [split $res \n] {
puthelp "privmsg #channel :$line"
}
}
}
|
|
|
| Back to top |
|
 |
deadite66 Halfop
Joined: 30 May 2005 Posts: 74 Location: Great Yarmouth, UK
|
Posted: Sun Jul 10, 2005 1:41 am Post subject: |
|
|
hi thanks for the reply
is it possible to just have the map map name so in the channel it shows something like
eggdropbot: map has changed to ONS-Dinora-32p-
also the script prints the qstat output every minute as some rounds can last over an hour could it be changed to only print the map name when the map changes to a different one?
cheers. |
|
| Back to top |
|
 |
deadite66 Halfop
Joined: 30 May 2005 Posts: 74 Location: Great Yarmouth, UK
|
Posted: Sun Jul 10, 2005 3:39 pm Post subject: |
|
|
| so close demond :'( any chance off add those bits? |
|
| Back to top |
|
 |
deadite66 Halfop
Joined: 30 May 2005 Posts: 74 Location: Great Yarmouth, UK
|
Posted: Tue Jul 12, 2005 2:09 am Post subject: |
|
|
if it maked it any easier you can output to xml or add delimiters
| Quote: |
./qstat -ut2s 217.77.176.198:7777 -xml
or
./qstat -ut2s 217.77.176.198:7777 -raw [delimiter]
<?xml version="1.0" encoding="iso-8859-1"?>
<qstat>
<server type="UT2S" address="217.77.176.198" status="UP">
<hostname>217.77.176.198</hostname>
<name>Titan Internet 32-man Server - Custom Links, Maps + ECE</name>
<gametype>ONSOnslaughtGame</gametype>
<map>ONS-DryIce-ECE-32p</map>
<numplayers>0</numplayers>
<maxplayers>32</maxplayers>
<ping>64</ping>
<retries>0</retries>
</server>
</qstat>
|
|
|
| Back to top |
|
 |
metroid Owner
Joined: 16 Jun 2004 Posts: 771
|
Posted: Tue Jul 12, 2005 3:52 am Post subject: |
|
|
I suggest you use something else like the rcon module then, i'm sure that can detect map changes upon change. Having to do it with a timer is probably messy unless you make variables to even see if the map has changed.
Also, there is a script called Qstat4Eggdrop in the TCL Archive. You can use that script to query servers and get the stats/players. |
|
| Back to top |
|
 |
deadite66 Halfop
Joined: 30 May 2005 Posts: 74 Location: Great Yarmouth, UK
|
Posted: Tue Jul 12, 2005 4:11 pm Post subject: |
|
|
i wanted qstat as it'd likely to be updated when new game come out and i was hoping to reuse the script if i could.
but i'm willing to accept any way of doing it atm  |
|
| Back to top |
|
 |
deadite66 Halfop
Joined: 30 May 2005 Posts: 74 Location: Great Yarmouth, UK
|
Posted: Sat Jul 16, 2005 3:18 am Post subject: |
|
|
| hmm |
|
| Back to top |
|
 |
deadite66 Halfop
Joined: 30 May 2005 Posts: 74 Location: Great Yarmouth, UK
|
Posted: Sun Jul 17, 2005 1:49 am Post subject: |
|
|
is tcl a poor language?
even with my very basic understanding of (er) basic i managed this.
--------------------------------------------------------------------------------------
WHILE INKEY="" #loop until you hit a key
RUN "/usr/local/bin/qstat -ut2s 217.77.176.198:7777 -xml -of /home/lee/documents/qstat.output" #run qstat & output to a file
OPEN "/home/lee/documents/qstat.output" FOR INPUT as #1 #open the file
FOR a=1 to 6 : LINEINPUT #1, blank$ : NEXT a #skip the first 6 lines
LINEINPUT #1, mapline$ #read the map line
qstat$=MID(mapline$,8,LEN(mapline$)-13) #cut out the map name
IF qstat$<>map$ THEN map$=qstat$ : PRINT map$;" is starting on titan 32p Onslaught" #print the map name and extra text
CLOSE #1 #close the file
PAUSE 60 #wait for a minute
WEND
-------------------------------------------------------------------------------
yet seemingly no one on the net (at least the parts where i've asked this question) can answer it.
odd isn't it :/ |
|
| Back to top |
|
 |
deadite66 Halfop
Joined: 30 May 2005 Posts: 74 Location: Great Yarmouth, UK
|
Posted: Sun Jul 17, 2005 2:29 am Post subject: |
|
|
| while i've got something that 1/2 working do you think it's possible to add something to telnet to the bot and use the say command? |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Sun Jul 17, 2005 3:12 am Post subject: |
|
|
au contraire, Tcl is a rich language
it's just that apparently nobody is interested in implementing the thing you need in Tcl
congratulations though for helping yourself in Basic  |
|
| Back to top |
|
 |
deadite66 Halfop
Joined: 30 May 2005 Posts: 74 Location: Great Yarmouth, UK
|
Posted: Sun Jul 17, 2005 3:18 am Post subject: |
|
|
| not quite helping myself as i've no way to get the bot to say it |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Sun Jul 17, 2005 3:36 am Post subject: |
|
|
| now that's a great occasion for you to learn some Tcl; apparently you already have some programming skills, so it wouldn't be that hard to give Tcl a try; there is hardly any use of Basic these days, but Tcl will enrich your programming experience and possibly help you with your school projects (or who knows, maybe even help you to get a job if you need one) |
|
| Back to top |
|
 |
deadite66 Halfop
Joined: 30 May 2005 Posts: 74 Location: Great Yarmouth, UK
|
Posted: Sun Jul 17, 2005 2:41 pm Post subject: |
|
|
well i've found a way to use the .say command from a script so it looks like i can use a modified version of my basic program  |
|
| Back to top |
|
 |
|