CS Server Query
Posted by Fubar
Saturday, July 02, 2005
Description: New Source query system
For the new query system for source
alias csquery {
sockudp -k cs $1 $2 ÿÿÿÿTSource Engine Query
}
on *:udpread:cs:{
sockread -n &test
breplace &test 0 254
var %temp.cs $bvar(&test,1,$bvar(&test,0)).text
set %cs.server $gettok(%temp.cs,3,254)
set %cs.map $gettok(%temp.cs,4,254)
set %cs.game $gettok(%temp.cs,6,254)
set %cs.players $asc($left($gettok(%temp.cs,7,254),1)) $+ / $+ $asc($mid($gettok(%temp.cs,7,254),2,1))
set %cs.type $mid($gettok(%temp.cs,7,254),4,1)
set %cs.os $mid($gettok(%temp.cs,7,254),5,1)
if ($right($gettok(%temp.cs,7,254),1) == 1) {
set %cs.pass yes
}
msg %cs.chan [^B]Server[^B]: %cs.server -- [^B]Map[^B]: %cs.map -- [^B]Game[^B]: %cs.game -- [^B]Players[^B]: %cs.players -- [^B]Type[^B]: $iif(%cs.type == d,Dedicated,Listen) -- [^B]OS[^B]: $iif(%cs.os == l,Linux,Windows) $iif(%cs.pass,-- Password Protected)
unset %cs.*
}
on *:TEXT:.serverquery*:#: {
if ($longip($2)) {
if ($len($3) == 5) {
set %cs.chan $chan
msg $chan CS Server query on [^B] $+ $2 $+ : $+ $3 $+ [^B] --
csquery $2 $3
}
else {
msg $chan Invalid Port
}
}
else {
msg $chan Invalid IP
}
}For the new query system for source