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 

qstat map change notify
Goto page 1, 2, 3  Next
 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive
View previous topic :: View next topic  
Author Message
deadite66
Halfop


Joined: 30 May 2005
Posts: 74
Location: Great Yarmouth, UK

PostPosted: Sat Jul 09, 2005 10:44 pm    Post subject: qstat map change notify Reply with quote

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
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Sun Jul 10, 2005 12:21 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Sun Jul 10, 2005 12:38 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
deadite66
Halfop


Joined: 30 May 2005
Posts: 74
Location: Great Yarmouth, UK

PostPosted: Sun Jul 10, 2005 1:41 am    Post subject: Reply with quote

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


Joined: 30 May 2005
Posts: 74
Location: Great Yarmouth, UK

PostPosted: Sun Jul 10, 2005 3:39 pm    Post subject: Reply with quote

so close demond :'( any chance off add those bits?
Back to top
View user's profile Send private message
deadite66
Halfop


Joined: 30 May 2005
Posts: 74
Location: Great Yarmouth, UK

PostPosted: Tue Jul 12, 2005 2:09 am    Post subject: Reply with quote

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


Joined: 16 Jun 2004
Posts: 771

PostPosted: Tue Jul 12, 2005 3:52 am    Post subject: Reply with quote

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


Joined: 30 May 2005
Posts: 74
Location: Great Yarmouth, UK

PostPosted: Tue Jul 12, 2005 4:11 pm    Post subject: Reply with quote

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 Sad
Back to top
View user's profile Send private message
deadite66
Halfop


Joined: 30 May 2005
Posts: 74
Location: Great Yarmouth, UK

PostPosted: Sat Jul 16, 2005 3:18 am    Post subject: Reply with quote

hmm
Back to top
View user's profile Send private message
deadite66
Halfop


Joined: 30 May 2005
Posts: 74
Location: Great Yarmouth, UK

PostPosted: Sun Jul 17, 2005 1:49 am    Post subject: Reply with quote

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


Joined: 30 May 2005
Posts: 74
Location: Great Yarmouth, UK

PostPosted: Sun Jul 17, 2005 2:29 am    Post subject: Reply with quote

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
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Sun Jul 17, 2005 3:12 am    Post subject: Reply with quote

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 Smile
Back to top
View user's profile Send private message Visit poster's website
deadite66
Halfop


Joined: 30 May 2005
Posts: 74
Location: Great Yarmouth, UK

PostPosted: Sun Jul 17, 2005 3:18 am    Post subject: Reply with quote

not quite helping myself as i've no way to get the bot to say it
Back to top
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Sun Jul 17, 2005 3:36 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
deadite66
Halfop


Joined: 30 May 2005
Posts: 74
Location: Great Yarmouth, UK

PostPosted: Sun Jul 17, 2005 2:41 pm    Post subject: Reply with quote

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 Smile
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive All times are GMT - 4 Hours
Goto page 1, 2, 3  Next
Page 1 of 3

 
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