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 

csstatus.tcl

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
snapcstrike
Voice


Joined: 15 Feb 2009
Posts: 9

PostPosted: Mon Mar 02, 2009 4:22 am    Post subject: csstatus.tcl Reply with quote

#########################################################################################################################################
#
# Чтв Маğ 9 16:34:00 2006
#
# ::: RUS :::
# v 1.0 by Frilak (frilak@gmail.com) irc://irc.alfa-com.ru/eggdrop - frilak
# - Вообщем скğипт статистики для игğы Counter Strike.!!!! НЕ ДЛЯ STEAM ВЕĞСИИ !!!! Для ğаботы неообходим модуль rcon:
# --- ftp://ftp.eggheads.org/pub/eggdrop/modules/1.6/ - веğсия для *nix
# --- http://eggdrop.org.ru/files/rconmod.zip - веğсия для windrop
# - Доступные команды (с ğусскими аналогами) - !cs (показывает кол-во игğоков и каğту) !players (показывает список игğоков + фğаги)
# - Для админов доступен пğосмотğ игğоков по ip. Для ıтого админ должен быть пğописан на боте + пğописан в списке админов (его хıндл)
# - Читайте каменты ниже.
# P.S Пишите свои замечания и пğедложения на мыло (ввеğху) либо обğащайтесь ко мне пğямо в IRC
# P.P.S Скğипт был спеğва написан для личного пользования Smile такчто сильно не стаğался.
# P.P.P.S Если скğипт не ğаботает веğоятно забыли пğо флаг csstatus Smile
#
# ::: TODO :::
# В следуşщей веğсии добавлş поддеğжку нескольких сеğвеğов ) ждите
#
# ======================================================================================================================================
#
# Thu Mar 9 16:34:00 2006
#
# ::: ENG :::
# v 1.0 by Frilak (frilak@gmail.com) irc://irc.alfa-com.ru/eggdrop - frilak
# - Just a simple script for monitoring Counter Strike Server.!!! NOT FOR STEAM SERVERS !!! For work requires module rcon:
# --- ftp://ftp.eggheads.org/pub/eggdrop/modules/1.6/ - version for *nix
# --- http://eggdrop.org.ru/files/rconmod.zip - version for windrop
# - Commands available - !cs (shows the number of players and the map) !players (shows the players list + their`s frags)
# - Admins are able to see players ip`s. To do so the admin should be in bot`s userlist + his handle should be in the admin list
# - Read comments below
# P.S Send your comments by e-mail (at the top of the page) or directly in IRC
# P.P.S Firstly script was written for private use Smile
# P.P.P.S If it doesn`t work may be you forgot the flag csstatus Smile
# P.P.P.P.S Sorry for my baaaaad english...
#
# ::: TODO :::
# In the next version script will work with more then one server ) wait
#
#
#########################################################################################################################################

unloadmodule rcon
if {[loadmodule rcon]!=""} {
die "This script requires rcon module"
die "Download it from ftp://ftp.eggheads.org/pub/eggdrop/modules/1.6/ - for *nix\n http://eggdrop.org.ru/files/rconmod.zip - for windrop"
}

set cs(version) "1.0"

################## -- İти паğаметğы вам необходимо изменить -- #######################
################## -- This variables should be changed -- ############################

# Язык ) | Language ) (rus|eng)
set cs(lang) "rus"

# Хост где находится CS сеğвеğ | Host where the server is located
set cs(rhost) "your.gameserver.ip.or.host"

# Поğт на котоğом он висит. По стандаğту - 27015 | It`s port. By default - 27015
set cs(rport) "27015"

# Паğоль rcon для ıтого сеğвеğа | It`s rcon password
set cs(rconpass) "yourserverrconpass"

# Объявляем флаг csstatus для ğаботы скğипта только на опğеделённых каналах | Reserving the flag csstatus to enable the script only at some chans
setudef flag csstatus

# Ставим бинды... | Adding binds...
bind pub - !cs cs_status
bind pub - !кс cs_status
bind pub - !сы cs_status
bind pub - !игğоки cs_players
bind pub - !плаеğс cs_players
bind pub - !players cs_players

# Список хıнлов котоğые смогут смотğеть IP игğоков по команде !players | The admins list. Add handles. They will see players IP`s
set cs(admins) "Frilak sanek etc"

####################### Do not change anything below this line if you don`t know what you`re doing #########################
####################### Не меняйте ничего ниже ıтой линии если не знаете что делаете #######################################

proc cs_status {nick uhost hand chan args} {
global cs
set hostname ""
set map ""
set pl ""
set max ""
set challenge ""

if {![channel get $chan csstatus]} { return }
set challenge [challengercon $cs(rhost) $cs(rport)]
if {$challenge=="-1"} {
if {$cs(lang)=="rus"} {
putquick "NOTICE $nick :Сеğвеğ недоступен"
} else {
putquick "NOTICE $nick :Server not responding"
}
return
}
set status [rcon $cs(rhost) $cs(rport) $challenge "$cs(rconpass)" status]
regsub -all -- {\ +} $status " " status
regsub -all -- {\# } $status "\#" status
foreach line [split $status "\n"] {
if {[regexp -nocase -- {hostname: (.*?)$} $line garb hostname]} { continue }
if {[regexp -nocase -- {map : (.*?) at.*$} $line garb map]} { continue }
if {[regexp -nocase -- {players : (.*?) active \((.*?) max\)$} $line garb pl max]} { continue }
}
if {$cs(lang)=="rus"} {
putquick "NOTICE $nick :$hostname"
putquick "NOTICE $nick :Каğта - \0038$map. \0031Игğоков \0033 $pl /\0036 $max"
} else {
putquick "NOTICE $nick :$hostname"
putquick "NOTICE $nick :Map - \0038$map. \0031Players \0033 $p /\0036 $max"
}
}
proc cs_players {nick uhost hand chan args} {
global cs
set hostname ""
set map ""
set pl ""
set max ""
set challenge ""
set players ""
set templayer ""

if {![channel get $chan csstatus]} { return }
set challenge [challengercon $cs(rhost) $cs(rport)]
if {$challenge=="-1"} {
if {$cs(lang)=="rus"} {
putquick "NOTICE $nick :Сеğвеğ недоступен"
} else {
putquick "NOTICE $nick :Server not responding"
}
return
}
foreach adm [split $cs(admins) " "] {
if {$hand==$adm} { set isadm 1
break
} else { set isadm 0 }
}
set status [rcon $cs(rhost) $cs(rport) $challenge "$cs(rconpass)" status]
regsub -all -- {\ +} $status " " status
regsub -all -- {\# } $status "\#" status
foreach line [split $status "\n"] {
if {[regexp -nocase -- {hostname: (.*?)$} $line garb hostname]} { continue }
if {[regexp -nocase -- {map : (.*?) at.*$} $line garb map]} { continue }
if {[regexp -nocase -- {players : (.*?) active \((.*?) max\)$} $line garb pl max]} { continue }
if {[regexp -nocase -- {\#[0-9]+ \"(.*?)\" [0-9]+ STEAM_ID_LAN ([0-9]+) [0-9]+:[0-9]+ [0-9]+ [0-9]+ (.*?):[0-9]+} $line garb tmplayer frags ip]} {
if {$frags>10} { set color "\0035" } else { set color "\0039" }
if {$isadm} {
lappend players "\00310\[\00312$ip \00310-- \00312< $tmplayer > $color-- $frags\00310\]"
continue
} else {
#putlog $tmplayer
lappend players "\00310\[\00312$tmplayer $color-- $frags\00310\]"
continue
}
}

}

if {$cs(lang)=="rus"} {
putquick "NOTICE $nick :Игğаşт:"
} else {
putquick "NOTICE $nick :Playing:"
}
foreach pla $players {
putquick "NOTICE $nick :$pla"
}
}

putlog "csstatus.tcl $cs(version) by Frilak (frilak@gmail.com) loaded"

----------------------------------------------------------------------------------------
Just a simple script for monitoring Counter Strike Server.!!! NOT FOR STEAM SERVERS !!! For work requires module rcon:
# --- ftp://ftp.eggheads.org/pub/eggdrop/modules/1.6/ - version for *nix
# --- http://eggdrop.org.ru/files/rconmod.zip - version for windrop

How to install the module rcon? help pls Sad
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 -> Script Support & Releases 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