This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Query a CS:S Server and say it to channel in specified time

Help for those learning Tcl or writing their own scripts.
Post Reply
d
dAmN123
Voice
Posts: 2
Joined: Mon Apr 24, 2006 3:23 pm

Query a CS:S Server and say it to channel in specified time

Post by dAmN123 »

Code: Select all

set channel "#css.worldwide"

set time 20

set text {

"84.254.76.25:27015 #css.worldwide"
"There are currently $player players on $map"
"css.worldwide is powered by Linemax.de"
}

 

if {[string compare [string index $time 0] "!"] == 0} { set timer [string range $time 1 end] } { set timer [expr $time * 60] }

if {[lsearch -glob [utimers] "* go *"] == -1} { utimer $timer go }

 

proc go {} {

global channel time text timer

foreach chan $channel {

putserv "MODE $chan +m-c"

foreach line $text { putserv "PRIVMSG $chan :$line" }

putserv "MODE $chan -m+c"

}

if {[lsearch -glob [utimers] "* go *"] == -1} { utimer $timer go }

}
Now my Description:
Every 20 Minutes the Eggdrop have to set mode -c+m than he should wrote the text and $player stand e.g. for 10/14 and $map e.g. de_dust2

Now i don`t know how to go on i hope you can help me
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

do you have a webpage with that infos or will the script be forced to trigger a direct query to the cs:s server? afaik that was a UDP/IP connection, if I am not mistaken which would require to call an extern IP app/script to fetch it. I am pretty sure there is some PERL script lurking around for that purpose. you will then have to fileevent (async exec with open |) and when its finished you can print your line (or print server down, if query failed :D).
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
d
dAmN123
Voice
Posts: 2
Joined: Mon Apr 24, 2006 3:23 pm

Post by dAmN123 »

hmm i have a website but not a script for query a gameserver and i`m not as good in tcl. can you give me the code?
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

If you have a website, easiest would be to use package http to query it. The FAQ Parsing webpages made easy is a nice example.
As mentioned above, as far as I know, CS:S servers uses UDP only and neither TCL nor Eggdrop supports UDP (though I think it wouldnt be that hard to rewrite CONNECT to something like CONNECTUDP, but its totally unneccesarrily effort).
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
k
kanibus
Halfop
Posts: 44
Joined: Tue May 03, 2005 7:22 am

Post by kanibus »

there is a really nice rcon module written for the hl1 engine @ www.limit.org but im not sure if it will work for source servers as well
Post Reply