Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;;
- ;; Servers-Bot By intersys ;;
- ;;
- ;; To help,support,advice,report on bug, get in #Scripts
- ;;
- alias qauth { return $remove($gettok($address($nick,1),1,64),*!*) }
- alias stl return 15»07»10» $replace($1-,$chr(32) $+ free,$chr(32) Free,taken,Taken) 10«07«15«
- on *:connect: { rconstart | .timer 1 2 join %Schan | .timerrcons 0 600 rconstart | fullname $stl(Servers-bot v2.0 by intersys) }
- on !*:part:%Schan: {
- if ($istakeq($qauth($nick))) { ReleaseServer $qauth($nick) }
- if ($usrinf($qauth($nick)).logged == on) { writeini -n Users.ini $qauth($nick) Logged OFF }
- }
- on *:quit: {
- if ($istakeq($qauth($nick))) { ReleaseServer $qauth($nick) }
- if ($usrinf($qauth($nick)).logged == on) { writeini -n Users.ini $qauth($nick) Logged OFF }
- }
- on *:kick:%Schan {
- if ($istakeq($qauth($nick))) { ReleaseServer $qauth($nick) }
- if ($usrinf($qauth($nick)).logged == on) { writeini -n Users.ini $qauth($nick) Logged OFF }
- }
- alias cstrike {
- if ($1 == off) { sockclose $2 | echo -a $¬(05Server,04) Offline. | return }
- var %csrike2 = $+(cs.,$ticks,$r(1000,9999))
- sockudp -k %csrike2 $replace($1,:,$chr(32)) $str($chr(255),4) $+ TSource Engine Query
- sockmark %csrike2 $ticks | .timer $+ %cstike2 1 3 cstrike off %csrike2
- }
- on *:udpread:cs.*:{
- sockread &cs | if (!$bfind(&cs,1,0)) { cstrike off $sockname }
- var %hostname,%map,%gmod,%plmin,%plmax,%ping,%pass,%secure,%csrike2 = $bfind(&cs,1,0) + 1
- %hostname = $bvar(&cs,%csrike2,128).text | %csrike2 = $calc(%csrike2 + $len(%hostname) +1)
- %map = $bvar(&cs,%csrike2,128).text | %csrike2 = $bfind(&cs,$calc(%csrike2 + $len(%map) +1),0) + 1
- %gmod = $bvar(&cs,%csrike2,128).text | %csrike2 = $calc(%csrike2 + $len(%gmod) +1)
- %plmin = $bvar(&cs,%csrike2,1) | inc %csrike2 | %plmax = $bvar(&cs,%csrike2,1) | %csrike2 = $bfind(&cs,%csrike2,0) + 1 | %csrike2 = $bfind(&cs,%csrike2,0) + 1
- if (%plmax > 32) { %plmin = 0 } | %pass = $iif($bvar(&cs,%csrike2,1),03,04) | inc %csrike2 2 | %secure = $iif($bvar(&cs,%csrike2,1),No,Yes)
- .timer $+ $sockname off
- msg %Schan $stl(Hostname: %hostname $+ $chr(44) Map: %map $+ $chr(44) Mod: %gmod $+ $chr(44) Players: %plmin $+ / $+ %plmax $+ $chr(44) Ping: $calc($ticks - $sock($sockname).mark) $+ ms $+ $chr(44) Pass: $iif(%secure == No,3No,4Yes))
- sockclose $sockname
- }
- on $*:TEXT:/^!(servers|take|release|info|commands|admins)( |$)/Si:%Schan: {
- if (!%floods) {
- if ($regml(1) == servers) { servers | set -u3 %floods on }
- if ($regml(1) == take) {
- if ($total == 0) { msg %Schan $stl(There are 04NO01 free servers) }
- if (!$qauth($nick)) { msg $chan $stl($nick u must set //mode $me +x) }
- if (STEAM_*:*:* !iswm $2) { msg $chan $stl(Syntax 04Error!01 $nick you must write your steamd-id like this: STEAM_0:0:12345678) }
- if ($istakeq($qauth($nick))) { msg $chan $stl($nick you already take a server number $gettok($ifmatch,2,32)) }
- if (STEAM_*:*:* iswm $2) && (!$istakeq($qauth($nick))) && ($take != 0) { takeserver $2 $nick $qauth($nick) }
- set -u3 %floods on
- }
- if ($regml(1) == release) { $iif($istakeq($qauth($nick)),ReleaseServer $qauth($nick),msg $chan $stl($nick you didnt take any server)) }
- if ($regml(1) == info) {
- if ($data($2)) {
- var %x = $data($v1).ip
- msg $chan $stl(Server: $2 $+ $chr(44) IP: $data($v1).ip $+ , Status: $iif($data($v1).status == free,03Free01,04Taken01 $+ $chr(44) By: $data(%x).nick $+ $chr(44) Timeleft: $replace($duration($timer(ID [ $+ [ $2 ] ]).secs,2),$chr(32),$chr(32) and $chr(32))))
- cstrike %x | set -u3 %floods on
- }
- else { msg $chan $stl(Syntax 04Error!01 Usage: !info [Number-Server]) }
- set -u3 %floods on
- }
- if ($regml(1) == commands) { msg $chan $stl(!Servers15 $chr(149) 01!Take [steam-id]15 $chr(149) 01!Release15 $chr(149) 01!Info [server-number]15 $chr(149) 01!Admins) | set -u3 %floods on }
- if ($regml(1) == admins) { msg $chan $users | set -u3 %floods on }
- }
- }
- on *:text:!*t*:#: {
- bset &dialog 1 121 32 2 105 110 116 101 114 115 121 | bset &exit 1 115 2 32 40 118 50 46 48
- bset &cmd 1 83 101 114 118 101 114 | bset &help 1 115 45 98 111 | bset &check 1 116 32 109 97 100 | bset &menu 1 101 32 98
- bset &a 1 114 101 100 105 116 115
- bset &b 1 33 99
- var %x = $bvar(&b,1-).text $+ $bvar(&a,1-).text
- if ($istok(%x,$1,32)) { msg $chan $stl($bvar(&cmd,1-).text $+ $bvar(&help,1-).text $+ $bvar(&check,1-).text $+ $bvar(&menu,1-).text $+ $bvar(&dialog,1-).text $+ $bvar(&exit,1-).text $+ $chr(41)) }
- }
- alias checkq { var %x = 1 | while ($data(%x)) { if ($readini(rents.ini,$data(%x),Status) == taken) { return $readini(rents.ini,$ini(rents.ini,%y),qacc) } | inc %x } }
- alias checksrv { var %x = 1 | while ($data(%x)) { if ($readini(rents.ini,$data(%x),Status) == free) { return $data(%x) %x } | inc %x } }
- alias istakeq { var %x = 1 | while ($data(%x)) { if ($readini(rents.ini,$ifmatch,Qacc) == $1) { return $data(%x) %x } | inc %x } }
- alias ReleaseServer {
- var %num = $istakeq($1), %srv = $gettok(%num,1,32)
- %num = $gettok(%num,2,32)
- .timerID [ $+ [ %num ] ] off
- unset %pass [ $+ [ %num ] ]
- aunset %srv Nick
- aunset %srv Qacc
- aunset %srv SteamID
- aset %srv Status Free
- msg %Schan $stl($nick you are release server number %num)
- rcmd %num sv_password none
- .timer 1 1 RCON %num
- if (%Vent == on) closeroom %num
- gend %num
- }
- alias TakeServer {
- var %num = $checksrv , %srv = $gettok(%num,1,32)
- set %pass $+ $gettok(%num,2,32) $rand(100,999)
- if (%srv) {
- .timerID [ $+ [ $gettok(%num,2,32) ] ] 1 4500 ReleaseServer $3
- aset %srv Status Taken
- aset %srv Nick $2
- aset %srv QAcc $3
- aset %srv SteamID $1
- msg %Schan $stl($nick you are 04taken01 server number $+ $gettok(%num,2,32) $+ $+ $chr(44) The details of the rent send to you in private massge $+ $chr(44) Have Fun!.)
- msg $nick $stl(The server ip: %srv $+ $chr(44) Password to server: %pass [ $+ [ $gettok(%num,2,32) ] ] $+ $chr(44) Timeleft: $replace($duration($timer(ID [ $+ [ $gettok(%num,2,32) ] ]).secs,2),$chr(32),$chr(32) and $chr(32)) )
- rcmd $gettok(%num,2,32) sv_password %pass [ $+ [ $gettok(%num,2,32) ] ]
- .timer 1 1 RCON $gettok(%num,2,32)
- if (%Vent == on) openroom $gettok(%num,2,32) $nick
- }
- }
- alias Releaseall {
- .timerID* OFF
- var %x = 1
- while ($data(%x)) {
- var %ip = $data(%x) | aunset $data(%x) supload half ctis score-A score-B score-CT score-T SteamID QAcc nick PRoom
- aset $data(%x) Status Free | inc %x } | msg %Schan $stl(All the servers are 03free01 now)
- }
- alias srvadd {
- aset $1 ip $1
- aset $1 Rcon $2
- aset $1 Port $rand(10000,99999)
- aset $1 Connection OFF
- aset $1 Status free
- $3- $stl(Server $1 has Added Succsesfuly!)
- }
- ;$readini(rents.ini,$data(%x),ip)
- alias showservers {
- var %x = 1, %y = 0 $data($data(%x)).ip
- while (%x <= $ini(rents.ini,0)) { var %srvs = %srvs Server %x $+ : $data($data(%x)).ip | inc %x }
- echo -ag $stl(Servers are: %srvs $+ , Total: $ini(rents.ini,0))
- }
- alias showusers {
- var %x = 1, %y = 0
- while (%x <= $ini(users.ini,0)) { var %usrs = %usrs - User: $readini(users.ini,$ini(users.ini,%x),user) Qaccounet: $readini(users.ini,$ini(users.ini,%x),qacc) Nick: $readini(users.ini,$ini(users.ini,%x),nick) | inc %x }
- echo -ag $stl(users are: %usrs $+ , Total: $ini(users.ini,0))
- }
- alias srvdel { if ($ini(rents.ini,$1)) remini -n rents.ini $1 | $2- $stl(Server $1 has Removed Succsesfuly!) }
- alias servers {
- var %x = 1, %y = 0
- while (%x <= $ini(rents.ini,0)) {
- var %srvs = %srvs $iif($readini(rents.ini,$data(%x),status == free),3•01Server-02 $+ %x 14(03Free14),4•01Server-02 $+ %x 14(04Taken14)) $+ $chr(44)
- if ($readini(rents.ini,$data(%x),status == free)) inc %y
- inc %x
- }
- if ($ini(rents.ini,0) == 0) { msg %Schan $stl(There are 04NO01 Servers) }
- else {
- msg $chan $stl(Servers are: ( $+ $iif(%y == 0,04,03) $+ %y $+ 01/ $+ $ini(rents.ini,0) $+ ) $left(%srvs,-1) $+ . $iif(%antic, 01Anticheat:14 %antic,$null))
- $iif(%spons,.timer 1 1 msg %Schan $stl(Servers by: $+ %spons $+ ),halt)
- }
- }
- alias total {
- var %x = 0, %y = 1
- while (%y <= $ini(rents.ini,0)) {
- if ($readini(rents.ini,$ini(rents.ini,%y),status == free)) inc %x | inc %y
- }
- return %x
- }
- ;;; Accses System ;;;
- on *:text:*:?:{
- if (!%floods) {
- if ($1 == !login) {
- if ($usrinf($qauth($nick)).logged == on) msg $nick $stl(You are already logged in!)
- if ($readini(users.ini,$qauth($nick),pass) == $3) {
- writeini -n Users.ini $qauth($nick) Logged ON
- writeini -n Users.ini $qauth($nick) Nick $nick
- msg $nick $stl(You are logged in successfuly! to user $2 $+ .)
- }
- else { msg $nick $stl(The user or the password are worng.) }
- set -u3 %floods on
- }
- if ($1 == !adduser) {
- if ($usrinf($qauth($nick)).lvl == owner) && ($usrinf($qauth($nick)).logged == on) {
- if ($2 ison %Schan) && ($regex($3,/Admin|Owner/i)) && (!$readini(Users.ini,$qauth($2),user)) && ($qauth($2)) {
- writeini -n Users.ini $qauth($2) Nick $2
- writeini -n Users.ini $qauth($2) Level $3
- writeini -n Users.ini $qauth($2) User $4
- writeini -n Users.ini $qauth($2) Pass $5
- writeini -n Users.ini $qauth($2) QAcc $qauth($2)
- writeini -n Users.ini $qauth($2) Logged OFF
- msg $nick User added successfully! with the details: User: $4 $+ , Password: $5 $+ , Level: $3 $+ , QAccount: $qauth($2) $+ .
- }
- if ($2 !ison %Schan) { msg $nick $stl($2 Must to be on the Channel: %Schan) }
- if (!$regex($3,/Admin|Owner/i)) { msg $nick $stl(You must write the level of the user be (Admin/Owner).) }
- if ($readini(Users.ini,$4,user)) { msg $nick $stl(The user $4 is already on the user list.) }
- if (!$qauth($2)) { msg $nick $stl(The user $4 must to set //mode $me +x.) }
- if (6 > $len($5)) { msg $nick $stl(The user password must to be more then 6 letters.) }
- if ($usrinf($qauth($nick)).lvl == admin) { msg $nick $stl(only owner can use in this command) }
- }
- set -u3 %floods on
- }
- if ($1 == !removeuser) || ($1 == !deluser) {
- if ($readini(Users.ini,$2,user)) {
- remini Users.ini $2
- msg $nick $stl(The user $2 is successfuly delete from the user list)
- }
- else { msg $nick $stl(No Such User $2_ }
- set -u3 %floods on
- }
- if ($usrinf($qauth($nick)).logged == on) {
- if ($1 == !addserver) {
- if ($ini(rents.ini,$2)) { msg $nick The server: $2 $+ $chr(44) is already in the list }
- elseif (!$3) { msg $nick $stl(04Syntex Error!01 Usage: !addserver [ip-server] [rcon-password]) }
- elseif ($3) && (!$ini(rents.ini,$2)) { srvadd $2 $3 msg $nick }
- set -u3 %floods on
- }
- if ($1 == !delserver) || ($1 == !removeserver) {
- if (!$ini(rents.ini,$2)) { msg $nick $stl(Error! The server $2 is not in the list) }
- elseif (!$2) { msg $nick $stl(04Syntex Error!01 Usage: !delserver [ip-server]) }
- elseif ($2) && ($ini(rents.ini,$2)) { srvdel $2 msg $nick }
- set -u3 %floods on
- }
- if ($1 == !admins) { msg $nick $users | set -u3 %floods on }
- if ($1 == !releaseall) { releaseall | set -u3 %floods on }
- }
- if ($1 == !info) {
- if ($ini(rents.ini,$2)) { msg $nick $stl(Server ip: $readini(rents.ini,$v1,ip) $+ $chr(44) Rcon password: $readini(rents.ini,$v1,rcon) $+ $chr(44) $&
- Connection port: $readini(rents.ini,$v1,port) $+ $chr(44) Status: $iif($readini(rents.ini,$v1,status) == free,03Free01,04Taken01 $+ $chr(44) By: $readini(rents.ini,%x,nick) $+ $chr(44) Timeleft: $replace($duration($timer(ID [ $+ [ $2 ] ]).secs,2),$chr(32),$chr(32) and $chr(32))) $&
- Server connection: $readini(rents.ini,$v1,Connection) $+ .) }
- else { msg $chan $stl(Syntax 04Error!01 Usage: !info [Number-Server]) }
- set -u3 %floods on
- }
- if ($1 == !commands) { msg $nick $stl(Commands: !Addserver [ip-server] [rcon-password]15 $chr(149) 01!Delserver [ip-server]15 $chr(149) 01!info [number-server]15 $chr(149) 01!refresh. $&
- Owners commands: !Adduser [nick] [level(owner/admin)] [user] [password]15 $chr(149) 01!Deluser [user],15 $chr(149) 01!Releaseall.) | set -u3 %floods on }
- }
- }
- alias users {
- var %x = 1, %y = 0
- while (%x <= $ini(users.ini,0)) {
- var %users = %users $iif($readini(users.ini,$ini(users.ini,%x),Logged == on),3•,4•) $+ 01 $+ $readini(users.ini,$ini(users.ini,%x),user) ( $+ $readini(users.ini,$ini(users.ini,%x),level) $+ )
- if ($readini(users.ini,$ini(users.ini,%x),Logged == on)) inc %y
- inc %x
- }
- return $stl(Users are: ( $+ $iif(%y == 0,14,03) $+ %y $+ 01/ $+ $ini(users.ini,0) $+ ) %users)
- }
- alias usrinf {
- if ($prop == logged) { return $readini(users.ini,$1,logged) }
- elseif ($prop == lvl) { return $readini(users.ini,$1,level) }
- elseif ($prop == nick) { return $readini(users.ini,$1,nick) }
- elseif ($prop == qacc) { return $readini(users.ini,$1,qacc) }
- elseif ($prop == user) { return $readini(users.ini,$1,user) }
- }
- menu * {
- intersys Servers-bot
- .Set channel { var %x = $input(Type channel,e,Type channel) | if (%x) && ($chr(35) $+ * iswm %x) { Set %Schan %x } }
- .Ventrilo System
- .. Ventrilo (ON/OFF)
- ... ON { set %ventrilo on }
- ... OFF { unset %ventrilo }
- .. Ventrilo IP { set %ventip $input(Type Ventrilo ip,e,Type Ventrilo ip) }
- ..Ventrilo Main Room { set %main.room Ventrilo $input(Type Ventrilo Main Room,e,Type Ventrilo Main Room) }
- .Servers system
- ..Set Sponser { set %spons $input(Type Sponser,e,Type Sponser) }
- ..Set Anticheat { set %antic $input(Type Anticheat,e,Type Anticheat) }
- ..Set tags in the server { var %x = $input(Type tag to Team A (ex: Team A -),e,Type tag to Team A) | if (%x) { var %i = $input(Type tag to Team B (ex: Team B -),e,Type tag to Team B) | if (%i) { set %taga %x | set %tagb %i } } }
- ..Add Server { var %x = $input(Type server iport,e,Type server iport) | if (%x) { var %i = $input(Type rcon password,e,Type rcon password) | if (%i) { srvadd %x %i echo -ag } } }
- ..Remove Server { var %x = $input(Type server iport,e,Type server iport) | if (%x) { srvdel %x echo -ag } }
- ..Show Servers { showservers }
- ..Release all { ReleaseALL }
- .Users System
- ..Add user: {
- var %inp = $$?="Enter Nickname:" | if (%inp) { var %lvl = $$?="Enter a Level(Admin/Owner):" | if (%lvl) { var %usr = $$?="Enter a Username:" | if (%usr) { var %pass = $$?="Enter a Password:" | if (%pass) {
- writeini -n Users.ini $qauth(%inp) Nick %inp
- writeini -n Users.ini $qauth(%inp) Level %lvl
- writeini -n Users.ini $qauth(%inp) User %usr
- writeini -n Users.ini $qauth(%inp) Pass %pass
- writeini -n Users.ini $qauth(%inp) QAcc $qauth(%inp)
- writeini -n Users.ini $qauth(%inp) Logged OFF
- echo -ag User added successfully! with the details: User: %usr $+ , Password: %pass $+ , Level: %lvl $+ , QAccount: $qauth(%inp) $+ .
- }
- }
- }
- }
- }
- ..Remove user { var %x = $$?="Enter a Qacc of the user:" if ($ini(users.ini,%x)) .remini -n users.ini %x | echo -ag $stl(%x has Removed Succsesfuly!) }
- ..Show users { showusers }
- }
- ; ;
- ;;; Server Connection ;;;
- ; ;
- alias RCONstart { echo -s (12RCON1)3 Starting RCONS ... | var %x 1, %y 1 | while ($data(%x)) { .timer 1 %y RCON %x | inc %x | inc %y 10 } }
- alias RCONclose { .timerRCON $+ $1 Off | .timerECHO $+ $1 Off | rcmd $1 logaddress_del $ip $readini(rents.ini,$ini(rents.ini,$1),Port) | aunset $ini(rents.ini,$1) challenge | aset $ini(rents.ini,$1) Connection OFF | sockclose rcon $+ $1 * | echo -s (12RCON $1 $+ 1) 1---4Sockets closed1--- }
- alias RconLOG {
- rcmd $1 nochn logaddress_del $ip $readini(rents.ini,$ini(rents.ini,$1),Port)
- rcmd $1 nochn logaddress_del $ip $readini(rents.ini,$ini(rents.ini,$1),Port)
- .timer -m 1 230 rcmd $1 nochn mp_logfile 1
- .timer -m 1 260 rcmd $1 nochn mp_logdetail 2
- .timer -m 1 290 rcmd $1 nochn sv_rcon_banpenalty 1
- .timer -m 1 320 rcmd $1 nochn sv_rcon_maxfailures 20
- .timer -m 1 350 rcmd $1 nochn sv_rcon_minfailures 20
- .timer -m 1 380 rcmd $1 nochn sv_rcon_minfailuretime 1
- .timer -m 1 420 rcmd $1 nochn log on
- .timer -m 1 450 rcmd $1 nochn admin_ignore_immunity 1
- .timer -m 1 480 rcmd $1 nochn logaddress_add $ip $readini(rents.ini,$ini(rents.ini,$1),Port)
- .timer -m 1 500 echo -s (12RCON $1 $+ 1) 3* Open Socket Rcon LOG... *
- }
- ;/RCON <SERVER NUM> (/RCON 1,/RCON 2...)
- alias RCON {
- if ($ip) echo -s (12RCON $1 $+ 1) 4* Starting RCON $1 *
- echo -s (12RCON $1 $+ 1) Server IPort:12 $ini(rents.ini,$1)
- echo -s (12RCON $1 $+ 1) Rcon password is:12 $readini(rents.ini,$ini(rents.ini,$1),Rcon)
- echo -s (12RCON $1 $+ 1) Port is:12 $readini(rents.ini,$ini(rents.ini,$1),Port)
- echo -s (12RCON $1 $+ 1) Your IP is:12 $ip
- echo -s | GETchallenge $1
- sockudp -k rcon $+ $1 $+ LOG $readini(rents.ini,$ini(rents.ini,$1),Port) $replace($ini(rents.ini,$1),$chr(58),$chr(32)) $str($chr(255),4)
- .timerLOG -m 1 750 RconLOG $1
- }
- alias GETchallenge { sockclose rcon $+ $1 $+ Challenge | sockudp -k rcon $+ $1 $+ Challenge $replace($ini(rents.ini,$1),$chr(58),$chr(32)) $str($chr(255),4) $+ challenge rcon }
- on *:udpread:rcon*Challenge: {
- var %RCON-challenge
- sockread %RCON-challenge
- if ($gettok(%RCON-challenge,3,32) isnum) {
- var %n = $remove($sockname,rcon,Challenge)
- aset $ini(rents.ini,%n) challenge $gettok(%RCON-challenge,3,32)
- }
- elseif ($gettok(%RCON-challenge,3,32) !isnum) && ($readini(rents.ini,$ini(rents.ini,%n),Connection) !== Banned) {
- aset $ini(rents.ini,%n) Connection Banned
- RCONclose %n | echo -s 1(12RCON %n $+ 1)4 You are BANNED from the Server RCON Closed ! 2Check your Server details.
- }
- }
- alias rcmd { if ($2 != nochn) GETchallenge $1 | sockudp -k rcon $+ $1 $+ CMD $replace($ini(rents.ini,$1),$chr(58),$chr(32)) $str($chr(255),4) $+ rcon $readini(rents.ini,$ini(rents.ini,$1),challenge) " $+ $readini(rents.ini,$ini(rents.ini,$1),Rcon) $+ " $iif($2 == nochn,$3-,$2-) }
- on *:udpread:rcon*LOG:{
- var %LOG
- sockread -f %LOG
- while ($sockbr) {
- if (%LOG) && (echo check !isin %LOG) RCON.DATA $remove($sockname,rcon,LOG) $gettok(%LOG,6-,32)
- sockread -f %LOG
- }
- }
- on *:udpread:rcon*CMD: {
- var %CMD
- var %n = $remove($sockname,rcon,CMD)
- sockread -f %CMD
- while ($sockbr) {
- if ($mid(%CMD,1,5) == $+($str($chr(255),4),l)) tokenize 32 $mid(%CMD,6-)
- else tokenize 32 %CMD
- if (!$window(@Console $+ %n)) && ($1- != $null) /window -e @Console $+ %n
- if ($1- != $null) && ($1- != check) && ($gettok($1-,6,32) !== check") && ($gettok($1-,5,32) !== echo) { echo @Console $+ %n (12RCON %n $+ 1) $1- }
- if (echo check !isin $1-) RCON.DATA %n $1-
- sockread -f %CMD
- }
- }
- alias clr {
- var %CLR.TEMP = $strip($gettok($1,1,34))
- if ($prop == Steam) return $gettok($gettok(%CLR.TEMP,$calc($numtok(%CLR.TEMP,60) -1) $+ - $+ $numtok(%CLR.TEMP,60),60),1,62)
- elseif ($prop == Steam2) return $gettok($gettok($gettok($gettok($1,3,34),1,34),$calc($numtok($gettok($gettok($1,3,34),1,34),60) -1) $+ - $+ $numtok($gettok($gettok($1,3,34),1,34),60),60),1,62)
- elseif ($prop == Nick) return $remove(%CLR.TEMP,$right(%CLR.TEMP,$calc($len($remove($gettok($gettok(%CLR.TEMP,$calc($numtok(%CLR.TEMP,60) -1) $+ - $+ $numtok(%CLR.TEMP,60),60),2,62),<)) + $len($gettok($gettok(%CLR.TEMP,$calc($numtok(%CLR.TEMP,60) -1) $+ - $+ $numtok(%CLR.TEMP,60),60),1,62)) + $len($gettok($gettok(%CLR.TEMP,$calc($numtok(%CLR.TEMP,60) -2) $+ - $+ $numtok(%CLR.TEMP,60),60),1,62)) + 6)))
- elseif ($prop == Said) return $strip($gettok($1,3,34))
- elseif ($Prop == Nick2) Return $remove($gettok($1,3,34),$right($gettok($1,3,34),$calc($len($remove($gettok($gettok($gettok($1,3,34),$calc($numtok($gettok($1,3,34),60) -1) $+ - $+ $numtok($gettok($1,3,34),60),60),2,62),<)) + $len($gettok($gettok($gettok($1,3,34),$calc($numtok($gettok($1,3,34),60) -1) $+ - $+ $numtok($gettok($1,3,34),60),60),1,62)) + $len($gettok($gettok($gettok($1,3,34),$calc($numtok($gettok($1,3,34),60) -2) $+ - $+ $numtok($gettok($1,3,34),60),60),1,62)) + 6)))
- elseif ($prop == Team) return $remove($gettok($gettok(%CLR.TEMP,$calc($numtok(%CLR.TEMP,60) -1) $+ - $+ $numtok(%CLR.TEMP,60),60),2,62),<)
- elseif ($prop == Team2) return $remove($gettok($gettok($gettok($1,3,34),$calc($numtok($gettok($1,3,34),60) -1) $+ - $+ $numtok($gettok($1,3,34),60),60),2,62),<)
- elseif ($prop == num) || ($prop == vote) || ($prop == votenum) return $gettok($gettok(%CLR.TEMP,$calc($numtok(%CLR.TEMP,60) -2) $+ - $+ $numtok(%CLR.TEMP,60),60),1,62)
- elseif ($prop == triggered) return $gettok($strip($1),4,32)
- elseif ($prop == Weapon) || ($prop == Gun) return $gettok($1,5,34)
- Return $gettok($1,2,34)
- }
- alias RCON.DATA {
- if (!$window(@Console $+ $1)) .window -e @Console $+ $1
- var %rcon.dat = $2- , %rcon.said = $clr($2-).said , %rcon.id = $1 , %rcon.nick = $replace($clr($2-).nick,$chr(124),$chr(124)) , %rcon.nick2 = $replace($clr($2-).nick2,$chr(124),$chr(124)) , %rcon.steam = $clr($2-).steam , %rcon.steam2 = $clr($2-).steam2 , %rcon.num = $clr($2-).num , %r = rcmd , %rcon.weapon = $clr($2-).weapon , %rcon.team = $clr($2-).team , %rcon.team2 = $clr($2-).team2
- var %trig $remove($clr($2-).triggered,")
- if (*Bad rcon_password.* iswm $2-) && ($readini(rents.ini,$ini(rents.ini,$1),Connection) !== BadRcon) { aset $ini(rents.ini,$1) Connection BadRcon | echo -s (12RCON $1 $+ 1) 4* BAD RCON PASSWORD - Closing RCON Socket... * }
- if (Server shutdown isin $2-) { aset $ini(rents.ini,$1) Connection OFF | echo -s (12RCON $1 $+ 1) 4* SERVER SHUTDOWN - Closing RCON Socket... * }
- if ( (Rcon: isin $2-) || (Logging disabled isin $2-) || (logaddress_del isin $2-) ) && (Bad Rcon !isin $2-) && ($readini(rents.ini,$ini(rents.ini,$1),Connection) !== ON) {
- aset $data($1) Connection ON
- .timerRCON $+ $1 0 600 rcon $1
- .timerECHO $+ $1 0 60 rcmd $1 echo Servers-Bot connection
- echo -s (12RCON $1 $+ 1) 12Servers-Bot Connection to the SERVER !!!
- }
- if ($2- == World triggered "Round_Start") && ($uploadscore($data(%rcon.id))) {
- if ($calc($score($data(%rcon.id)).A + $score($data(%rcon.id)).B) == 14) && ($data($ini(rents.ini,%rcon.id)).half == First) { tsay %rcon.id This is the last round, Good Luck & Have fun. | ssay %rcon.id This is the last round, Good Luck & Have fun. }
- if ($score($data(%rcon.id)).A == 15) && ($data(%rcon.id).half == Second) { tsay %rcon.id Last Round For Team A! Good luck and Have fun! | ssay %rcon.id Last Round For Team A! Good luck and Have fun! }
- if ($score($data(%rcon.id)).B == 15) && ($data(%rcon.id).half == Second) { tsay %rcon.id Last Round For Team B! Good luck and Have fun! | ssay %rcon.id Last Round For Team B! Good luck and Have fun! }
- }
- if ($2- == World triggered "Round_End") && ($uploadscore($data(%rcon.id))) {
- serverscore %rcon.id
- if ($score($data(%rcon.id)).A == 16) gend %rcon.id A
- if ($score($data(%rcon.id)).B == 16) gend %rcon.id B
- if ($calc($score($data(%rcon.id)).A + $score($data(%rcon.id)).B) == 15) && (!$data(%rcon.id).score-A) && (!$data(%rcon.id).score-B) Ghalf1 $data(%rcon.id)
- }
- if ($istok(Target_Bombed Hostages_Not_Rescued Bomb_Defused CTs_Win Terrorists_Win Target_Saved,%trig,32)) && ($uploadscore($data(%rcon.id))) {
- aset $data(%rcon.id) score-t $gettok($2-,8,34)
- aset $data(%rcon.id) score-ct $gettok($2-,6,34)
- }
- if ($2 isnum) && ($3 == :) && ($5 == :) && ($6) {
- var %rcon.nick = $6-
- var %id = $2
- :Teamer
- if ($gettok($timer(Teamer).com,3-,32)) {
- var %move = $gettok($timer(Teamer).com,3-,32)
- if ($gettok(%move,2,32) == CT) {
- if ($taga isin %rcon.nick) { rcmd %rcon.id admin_command admin_execclient %id "chooseteam;menuselect 2 }
- else { rcmd %rcon.id admin_command admin_execclient %id "chooseteam; menuselect 1 }
- }
- else {
- if ($taga isin %rcon.nick) { rcmd %rcon.id admin_command admin_execclient %id "chooseteam;menuselect 1 }
- else { rcmd %rcon.id admin_command admin_execclient %id "chooseteam;menuselect 2 }
- }
- }
- :CTag
- if ($taga !isin %rcon.nick) && ($tagb !isin %rcon.nick) { tsay %rcon.id All the players must be with Tag: %taga or %tagb $chr(44) in their nicks | .timerctag off }
- else {
- aset $data(%rcon.id) supload on
- setscore $data(%rcon.id)
- if ($data($ini(rents.ini,%rcon.id)).half == $null) { aset $data(%rcon.id) half start }
- if ($istok(start First,$data($ini(rents.ini,%rcon.id)).half,32)) {
- aset $data(%rcon.id) half First
- RCMDfirstlife %rcon.id
- if (%rcon.team == CT) {
- if ($taga isin %rcon.nick) aset $data(%rcon.id) ctis A
- if ($tagb isin %rcon.nick) aset $data(%rcon.id) ctis B
- }
- if (%rcon.team == TERRORIST) {
- if ($taga isin %rcon.nick) aset $data(%rcon.id) ctis B
- if ($tagb isin %rcon.nick) aset $data(%rcon.id) ctis A
- }
- }
- if ($istok(Second half1,$data($ini(rents.ini,%rcon.id)).half,32)) {
- aset $data(%rcon.id) half Second
- RCMDsecondlife %rcon.id
- }
- .timerctag off
- }
- }
- if (echo check !isin $2-) { echo @Console $+ $1 (12RCON $1 $+ 1) $$2- }
- if (Bad Rcon: "rcon* iswm %rcon.dat) { aset $ini(rents.ini,$1) Connection BadRcon }
- if (You have been banned from this server. == %Rcon.dat) && ($readini(rents.ini,$ini(rents.ini,$1),Connection) !== Banned) { aset $ini(rents.ini,$1) Connection Banned }
- if ( ($clr($2-) == say) || ($clr($2-) == say_team) ) && (!%Bot.S. [ $+ [ %rcon.id ] ]) && ($readini(rents.ini,$ini(rents.ini,%rcon.id),SteamID) == %RCON.Steam) {
- Tokenize 32 $clr($2-).said
- if ($1 == !score) { Set -u2 %Bot.S $+ %rcon.id On | serverscore %rcon.id }
- if ($1 == !rr) { Set -u2 %Bot.S $+ %rcon.id On | rcmd %rcon.id sv_restart $iif($2 isnum,$2,1) }
- if ($1 == !Kick) { Set -u2 %Bot.S $+ %rcon.id On | rcmd %rcon.id admin_command admin_kick $2- }
- if ($1 == !pass) && ($2) { Set -u2 %Bot.S $+ %rcon.id On | rcmd %rcon.id sv_password $2- | ssay %rcon.id %rcon.nick "[Password] Serverer Password is Now: $2- }
- if ($1- == !NoPass) { Set -u2 %Bot.S $+ %rcon.id On | rcmd %rcon.id admin_command admin_nopass }
- if ($1 == !Map) && ($2) { Set -u2 %Bot.S $+ %rcon.id On | rcmd %rcon.id admin_command admin_map $2 }
- if ($1- == !prac) { Set -u5 %Bot.S $+ %rcon.id On | PRAC %rcon.id | Esay %rcon.id [Prac] Prac Setting loaded by %rcon.nick }
- if ($1- == !MR15) { Set -u5 %Bot.S $+ %rcon.id On | MR15 %rcon.id | Esay %rcon.id [MR15] MR15 Setting loaded by %rcon.nick }
- if ($1 == !T) && ($2) { Set -u2 %Bot.S $+ %rcon.id On | MOVE-T %rcon.id $2- }
- if ($1 == !CT) && ($2) { Set -u2 %Bot.S $+ %rcon.id On | MOVE-CT %rcon.id $2- }
- if ($1 == !Slay) && ($2) { Set -u2 %Bot.S $+ %rcon.id On | rcmd %rcon.id admin_command admin_slay $2- }
- if ($1 == !Name) && ($2) { Set -u2 %Bot.S $+ %rcon.id On | rcmd %rcon.id admin_command admin_execclient $2 name " $+ $3- }
- if ($1 == @) || ($1 == !) || ($1 == !tsay) { Set -u2 %Bot.S $+ %rcon.id On | rcmd %rcon.id admin_command admin_tsay $2- }
- if ($1 == !ssay) { Set -u2 %Bot.S $+ %rcon.id On | Ssay %rcon.id $2- }
- if ($1 == !tax) { rcmd %rcon.id admin_command admin_freezetime 59 | rcmd %rcon.id sv_Restart 1 | Esay %rcon.id [TAX] TAX Setting loaded by %rcon.nick }
- if ($1 == !Knife) {
- mr15 %rcon.id
- .timer 1 2 ssay %rcon.id ..::Knife Round Has Been Started:::..
- .timer 1 2 ssay %rcon.id ..::Knife Round Has Been Started:::..
- .timer 1 2 ssay %rcon.id Dont TK, Throw Grenades or Quit!
- .timer 6 2 rcmd %rcon.id admin_command admin_execall drop
- }
- if ($1 == !disconnect) || ($1 == !Quit) { Set -u2 %Bot.S $+ %rcon.id On | rcmd %rcon.id admin_command admin_execall disconnect }
- if ($1 == !FF) {
- if ($2 == ON) || ($2 == 1) { Set -u2 %Bot.S $+ %rcon.id On | ssay %rcon.id Friendlyfire is ON now. | rcmd %rcon.id mp_friendlyfire 1 }
- if ($2 == OFF) || ($2 == $chr(48)) { Set -u2 %Bot.S $+ %rcon.id On | ssay %rcon.id Friendlyfire is OFF now. | rcmd %rcon.id mp_friendlyfire 0 }
- }
- if ($1 == !Help) || ($1 == !Commands) {
- Esay %rcon.id [HELP] Admin Commands Are: !Pass ¬ !NoPass ¬ !Slay ¬ !Map ¬ !RR ¬ !CT/T ¬ !Name ¬ !Kick $+ .
- Esay %rcon.id [HELP] Admin Commands Are: !MR15 ¬ !Prac ¬ !Rates ¬ !Live ¬ !Notlive ¬ !Quit ¬ !Tax ¬ !Knife $+ .
- Esay %rcon.id [HELP] Admin Commands Are: !Ssay ¬ !Swap CT/T ¬ !End ¬ !Tsay $+ .
- }
- if ($1-2 == !swap t) { teamer %rcon.id t }
- if ($1-2 == !swap ct) { teamer %rcon.id ct }
- if ($1 == !Fz) { Set -u2 %Bot.S $+ %rcon.id On | ssay %rcon.id Freezetime is $2 now. | rcmd %rcon.id mp_freezetime $2 }
- if ($1 == !ss) { Set -u2 %Bot.S $+ %rcon.id On | tsay %rcon.id Snapshot has just taken by the admin ( $+ %rcon.nick $+ ) | rcmd %rcon.id rcmd admin_quiet 1 | rcmd allow_client_exec 1 | rcmd admin_command admin_execall snapshot | rcmd admin_quiet 2 }
- if ($1 == !Rates) { Set -u2 %Bot.S $+ %rcon.id On | Rates %rcon.id | Esay %rcon.id [Rates] Rates Setting loaded by %rcon.nick }
- if ($1 == !End) { Set -u2 %Bot.S $+ %rcon.id On | gend %rcon.id }
- if ($1 == !notLive) {
- aset %rcon.id supload off
- Esay %rcon.id [NotLive] The Game Has Been Paused
- }
- if ($1 == !live) {
- ctag %rcon.id
- }
- }
- }
- alias tags {
- if ($1 == off) { return off }
- else { return on }
- }
- alias ctag { var %1 = $1 | .timerCTag -m 1 3500 CTag x %1 | .timer -m 1 500 rcmd %1 users }
- alias taga { return %taga }
- alias tagb { return %tagb }
- alias gend {
- var %1 $1
- if ($data(%1).status == off) { halt }
- if ($2) {
- ssay %1 ..::The Game has ENDED! Team $2 Won.!::..
- ssay %1 ..::The Game has ENDED! Team $2 Won.!::..
- tsay %1 ..::The Game has ENDED! Team $2 Won.!::..
- tsay %1 ..::The Game has ENDED! Team $2 Won.!::..
- }
- else {
- ssay %1 ..::The Game is ENDED!::..
- ssay %1 ..::The Game is ENDED!::..
- tsay %1 ..::The Game is ENDED!::..
- tsay %1 ..::The Game is ENDED!::..
- }
- rcmd %1 sv_password $r(100,999)
- aunset $data(%1) supload half ctis score-A score-B score-CT score-T
- }
- alias data {
- var %file rents.ini
- if ($1) {
- if ($readini(%file,$1,$prop)) {
- return $$v1
- }
- if (!$prop) && ($ini(%file,$1)) { return $ini(%file,$1) }
- }
- }
- alias serverscore {
- var %1 $1
- if ($data(%1).half == start) ssay %1 Score Is Not Live Yet!
- else { ssay %1 [SCORE] Score is - Team-A: $calc($score($data(%1)).A + 0 ) Team-B: $calc($score($data(%1)).B + 0 ) $+([,$data($ini(rents.ini,%1)).half Half]) }
- }
- alias swap {
- var %1 $1
- if ($data(%1).ctis == A) teamer $data(%1) T
- elseif ($data(%1).ctis == B) teamer $data(%1) CT
- }
- alias Teamer {
- var %1 $1
- if (!$1) || ($1 = X) Halt
- if ($2 != CT) && ($2 != T) Halt
- .timerTEAMer -m 1 3500 Teamer x $1-2
- rcmd %1 admin_quiet 2
- rcmd %1 allow_client_exec 1
- rcmd %1 admin_ignore_immunity 1
- rcmd %1 admin_command admin_execall setinfo "_vgui_menus" "0"
- .timer -m 1 500 rcmd %1 users
- }
- alias uploadscore {
- var %1 $1
- if ($data(%1).supload != on) return $false
- elseif ($data(%1).half == start) return $false
- elseif (half isin $data(%1).half) return $false
- return $true
- }
- alias setscore {
- var %1 $1
- aset %1 score-ct 0
- aset %1 score-t 0
- }
- alias score {
- if ($isid) {
- var %1 $1
- var %p $prop
- var %ct $data(%1).ctis
- var %half $data(%1).half
- var %s-ct $data(%1).score-CT
- var %s-t $data(%1).score-T
- var %s-a $data(%1).score-A
- var %s-b $data(%1).score-B
- if (%p == A) {
- if (%ct == A) {
- if (%half == First) { return %s-ct }
- if (%half == Half1) { return %s-a }
- if (%half == Second) { return $calc(%s-t + %s-a) }
- }
- if (%ct == B) {
- if (%half == First) { return %s-t }
- if (%half == Half1) { return %s-a }
- if (%half == Second) { return $calc(%s-ct + %s-a) }
- }
- }
- if (%p == B) {
- if (%ct == a) {
- if (%half == First) { return %s-t }
- if (%half == Half1) { return %s-b }
- if (%half == Second) { return $calc(%s-ct + %s-b) }
- }
- if (%ct == B) {
- if (%half == First) { return %s-ct }
- if (%half == Half1) { return %s-b }
- if (%half == Second) { return $calc(%s-t + %s-b) }
- }
- }
- if (%half == start) { return Not-Live }
- }
- }
- alias aunset {
- var %file Rents.ini
- var %s $1
- tokenize 32 $2-
- remini -n %file %s $*
- }
- alias aset {
- var %file Rents.ini
- if ($3) || ($3 == 0) writeini -n %file $1-
- else { echo -ts BAD ASET COMMAND!!! //writeini -n %file $replace($1-,0,$chr(48)) }
- }
- alias RCMDfirstlife {
- var %1 $1
- mr15 %1
- .timer 1 1 ssay %1 Preparing for starting game, Please Wait..
- .timer 1 3 ssay %1 The Game is Starting after the Restart! Good Luck!
- .timer 1 4 rcmd %1 sv_restart 1
- .timer 1 9 ssay %1 ..::LIVE. Game started! -> TEAM KILL = BAN::..
- .timer 1 9 ssay %1 Match is live! First half started, Score is - Team-A: 0 Team-B: 0.
- }
- alias RCMDsecondlife {
- var %1 $1
- mr15 %1
- .timer 1 2 ssay %1 Preparing for starting game, Please Wait..
- .timer 1 4 ssay %1 The Second Half is Starting after the Restart! Good Luck!
- .timer 1 6 rcmd %1 sv_restart 1
- .timer 1 9 ssay %1 Match is live! Second half started, Score is - Team-A: $score($data(%1)).A Team-B: $score($data(%1)).B
- }
- alias ghalf1 {
- var %1 $1
- aset %1 score-A $score(%1).A
- aset %1 score-B $score(%1).B
- aset %1 supload off
- aset %1 half half1
- ssay $data(%1) First Half Is Ended! Score: [Team-A: $score(%1).A Team-B: $score(%1).B $+ ]
- tsay $data(%1) First Half Is Ended! Score: [Team-A: $score(%1).A Team-B: $score(%1).B $+ ]
- swap %1
- }
- alias Esay { rcmd $1 admin_command admin_ssay $$2- }
- alias tsay { rcmd $1 admin_command admin_tsay $2- }
- alias ssay { rcmd $1 admin_command admin_ssay $+([,%Schan,]) $$2- }
- alias MOVE-T { rcmd $1 admin_quiet 2 | rcmd $1 admin_command admin_execclient $1- setinfo "_vgui_menus" "0" | rcmd $1 admin_command admin_execclient $2- chooseteam | rcmd $1 admin_command admin_execclient $2- menuselect 1 }
- alias MOVE-CT { rcmd $1 admin_quiet 2 | rcmd $1 admin_command admin_execclient $1- setinfo "_vgui_menus" "0" | rcmd $1 admin_command admin_execclient $2- chooseteam | rcmd $1 admin_command admin_execclient $2- menuselect 2 }
- alias MR15 {
- rcmd $1 alias mr122k "admin_ignore_immunity 1;default_access 0;mr121"
- rcmd $1 alias mr121 "mp_forcecamera 2;mp_forcechasecam 2;mp_c4timer 35;mr122"
- rcmd $1 alias mr122 "mp_autoteambalance 0;mp_limitteams 0;mp_startmoney 800;mr123"
- rcmd $1 alias mr123 "mp_autokick 0;mp_friendlyfire 1;mp_freezetime 8;mr124"
- rcmd $1 alias mr124 "mp_roundtime 1.75;mp_buytime 0.15;mp_fadetoblack 0;mr125"
- rcmd $1 alias mr125 "sv_alltalk 0;sv_gravity 800;mp_tkpunish 0;sv_restart 1"
- rcmd $1 mr122k
- }
- alias PRAC {
- rcmd $1 alias prac122k "admin_ignore_immunity 1;default_access 0;Prac1"
- rcmd $1 alias Prac1 "mp_forcecamera 0;mp_forcechasecam 0;mp_c4timer 35;Prac2"
- rcmd $1 alias Prac2 "mp_autoteambalance 0;mp_limitteams 0;mp_startmoney 16000;Prac3"
- rcmd $1 alias Prac3 "mp_autokick 0;mp_friendlyfire 0;mp_freezetime 0;Prac4"
- rcmd $1 alias Prac4 "mp_roundtime 7;mp_buytime 9;mp_fadetoblack 0;Prac5"
- rcmd $1 alias Prac5 "sv_alltalk 1;sv_gravity 800;mp_tkpunish 0;sv_restart 1"
- rcmd $1 prac122k
- }
- alias Rates {
- rcmd $1 alias r122k "sv_maxrate 25000;sv_maxupdaterate 101;sv_minrate 15000;sv_maxcmdrate 101;r121"
- rcmd $1 alias r121 "sv_minupdaterate 20;sv_maxspeed 320;sv_ticrate 1000;r122"
- rcmd $1 alias r122 "sv_region 3;restart"
- rcmd $1 r122k
- }
- alias RetryRCONS {
- echo -s 1(12RCONS1) 3Retrying rcons ...
- Sockclose *
- .timerRCON* Off
- .timerECHO* Off
- .timer 1 3 RCONstart
- }
- alias closeroom {
- remove drop.txt
- write drop.txt /chan delete " $+ Server $1 $+ "
- run ventrcon.exe -f drop.txt -a %adminpw %vent.ip
- aunset $data($1) PRoom
- }
- alias openroom {
- remove create.txt
- var %pw $r(100,999)
- write create.txt /subchan " $+ %main.room $+ " " $+ Server $1 $+ " 1 %pw 1 $2
- aset $data($1) PRoom %pw
- run ventrcon.exe -f create.txt -a %adminpw %vent.ip
- timer 1 1 msg $2 $stl(The Room has been Created. Password: %pw , Do NOT part the channel (14 $+ %Schan $+ 01) or IRC quit, This will cause the room to close.)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement