Advertisement
intersys

Untitled

Jul 10th, 2015
365
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 40.21 KB | None | 0 0
  1. <3.2>
  2. ;;
  3. ;; Servers-Bot By intersys ;;
  4. ;;
  5. ;; To help,support,advice,report on bug, get in #Scripts
  6. ;;
  7. alias istakeq { var %x = 1 | while ($data(%x)) { if ($readini(rents.ini,$data(%x),Status) == taken) { return $readini(rents.ini,$ini(rents.ini,%x),qacc) %x } | inc %x } }
  8. alias checksrv { var %x = 1 | while ($data(%x)) { if ($readini(rents.ini,$data(%x),Status) == free) { return $data(%x) %x } | inc %x } }
  9. alias qauth { return $gettok($address($1,1),2-,64) }
  10. alias qauth2 { return $gettok($address,2-,64)) }
  11. alias steam { return ($regex($1,/^steam_[0-5]:[01]:\d+$/i)) }
  12. alias stl return 15»07»10» $replace($1-,$chr(32) $+ free,$chr(32) Free,taken,Taken) 10«07«15«
  13. on *:connect: { rconstart | .timer 1 2 join %Schan | .timerrcons 0 600 rconstart | fullname $stl(Servers-bot v2.0 by intersys) }
  14. on *:part:%schan: {
  15.   if ($istakeq($gettok($address,2-,64))) { ReleaseServer $gettok($address,2-,64)) }
  16.   if ($usrinf($qauth($nick)).logged == on) { writeini -n Users.ini $qauth($nick) Logged OFF }
  17. }
  18. on *:quit: {
  19.   if ($istakeq($gettok($address,2-,64))) { ReleaseServer $gettok($address,2-,64)) }
  20.   if ($usrinf($qauth($nick)).logged == on) { writeini -n Users.ini $qauth($nick) Logged OFF }
  21. }
  22. on *:kick:%Schan {
  23.   if ($istakeq($qauth($knick))) { ReleaseServer $qauth($knick) }
  24.   if ($usrinf($qauth($knick)).logged == on) { writeini -n Users.ini $qauth($knick) Logged OFF }
  25. }
  26. alias cstrike {
  27.   if ($1 == off) { sockclose $2 | echo -a(05Server,04) Offline. | return }
  28.   var %csrike2 = $+(cs.,$ticks,$r(1000,9999))
  29.   sockudp -k %csrike2 $replace($1,:,$chr(32)) $str($chr(255),4) $+ TSource Engine Query
  30.   sockmark %csrike2 $ticks | .timer $+ %cstike2 1 3 cstrike off %csrike2
  31. }
  32. on *:udpread:cs.*:{
  33.   sockread &cs | if (!$bfind(&cs,1,0)) { cstrike off $sockname }
  34.   var %hostname,%map,%gmod,%plmin,%plmax,%ping,%pass,%secure,%csrike2 = $bfind(&cs,1,0) + 1
  35.   %hostname = $bvar(&cs,%csrike2,128).text | %csrike2 = $calc(%csrike2 + $len(%hostname) +1)
  36.   %map = $bvar(&cs,%csrike2,128).text | %csrike2 = $bfind(&cs,$calc(%csrike2 + $len(%map) +1),0) + 1
  37.   %gmod = $bvar(&cs,%csrike2,128).text | %csrike2 = $calc(%csrike2 + $len(%gmod) +1)
  38.   %plmin = $bvar(&cs,%csrike2,1) | inc %csrike2 | %plmax = $bvar(&cs,%csrike2,1) | %csrike2 = $bfind(&cs,%csrike2,0) + 1 | %csrike2 = $bfind(&cs,%csrike2,0) + 1
  39.   if (%plmax > 32) { %plmin = 0 } | %pass = $iif($bvar(&cs,%csrike2,1),03,04) | inc %csrike2 2 | %secure = $iif($bvar(&cs,%csrike2,1),No,Yes)
  40.   .timer $+ $sockname off
  41.   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))
  42.   sockclose $sockname
  43. }
  44. on $*:TEXT:/^!(servers|take|release|info|commands|admins|yes|no)( |$)/Si:%Schan: {
  45.   if (!%floods) {
  46.     if ($regml(1) == servers) { servers | set -u3 %floods on }
  47.     if ($regml(1) == take) {
  48.       if ($total == 0) { msg %Schan $stl(There are 04NO01 free servers) }
  49.       elseif (!$regex($2,/^steam_[0-5]:[01]:\d+$/i)) && (!$regex($3,/^STEAM_[0-5]:[01]:\d+$/i)) { msg %Schan $stl(Syntax 04Error!01 $nick You must write your steam-id like this: STEAM_0:0:12345678) }
  50.       elseif ($istakeq($qauth($nick))) { msg %Schan $stl($+  $nick  $+ You already took the server number  $+ $gettok($ifmatch,2,32) $+ ) }
  51.       elseif ($3) && ($steam($3)) && (!$istakeq($qauth($nick))) && ($take != 0) && (!%answer) { set -u15 % [ $+ [ $nick ] ] $3 | takeserver2 $2 $3 $nick $qauth($nick) }
  52.       elseif ($2) && ($steam($2)) && (!$istakeq($qauth($nick))) && ($take != 0) && (!%answer) { set -u15 % [ $+ [ $nick ] ] $2 | takeserver $2 $nick $qauth($nick) }
  53.       set -u3 %floods on
  54.     }
  55.     if (% $+ $nick != $null) && (%answer) && ($regml(1) == yes) { takeserver % [ $+ [ $nick ] ] $nick $qauth($nick) | unset %answer }
  56.     if (% $+ $nick != $null) && (%answer) && ($regml(1) == no) { unset % [ $+ [ $nick ] ] %answer | msg %Schan $stl( $+ $nick You canceled youre rent) }
  57.     if ($regml(1) == release) { $iif($istakeq($qauth($nick)),ReleaseServer $qauth($nick),msg %Schan $stl($nick you didnt take any server)) }
  58.     if ($regml(1) == info) {
  59.       if ($data($2)) {
  60.         var %x = $data($v1).ip
  61.         msg %Schan $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))) Anticheat: $iif($data($2).anticheat != $null, $data($2).anticheat, none) $data($2).anticheat)
  62.         cstrike %x | set -u3 %floods on
  63.       }
  64.       else { msg %Schan $stl(Syntax 04Error!01 Usage: !info [Number-Server]) }
  65.       set -u3 %floods on
  66.     }
  67.     if ($regml(1) == commands) { msg %Schan $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 }
  68.     if ($regml(1) == admins) { msg %Schan $users | set -u3 %floods on }
  69.   }
  70. }
  71. on *:text:!credits:%schan: {
  72.   msg %Schan $stl(Servers-bot made by intersys (v3.2))
  73. }
  74. alias ReleaseServer {
  75.   var %num = $istakeq($1), %srv = $gettok(%num,2,32)
  76.   %num = $gettok(%num,2,32)
  77.   .timerID [ $+ [ %num ] ] off
  78.   unset %pass [ $+ [ %num ] ]
  79.   aunset $data(%srv) Nick
  80.   aunset $data(%srv) Qacc
  81.   aunset $data(%srv) SteamID
  82.   aset $data(%srv) Status Free
  83.   msg %Schan $stl( $+ $nick $+  You released server number  $+ %num $+ )
  84.   rcmd %num sv_password none
  85.   .timer 1 1 RCON %num
  86.   if (%Vent == on) closeroom %num
  87.   gend %num
  88. }
  89. alias TakeServer2 {
  90.   var %num = $checksrv , %srv = $gettok(%num,1,32)
  91.   set %pass $+ $1 $rand(100,999)
  92.   if (%AC [ $+ [ $1 ] ] == on) && (%answer != on) {
  93.     set -u15 % [ $+ $nick ] $nick
  94.     msg %Schan $stl(This server using in  $+ $data($data($1)).anticheat $+  anticheat if you want take this server please type !Yes $+ $chr(44) if you want take another server please type !No. you $&
  95.       have 15 Seconds to answer if not, the server will be released) | set -u15 %answer on
  96.   }
  97.   else {
  98.     if (%srv) {
  99.       .timerID [ $+ [ $1 ] ] 1 4500 ReleaseServer $4
  100.       aset $data($1) Status Taken
  101.       aset $data($1) Nick $3
  102.       aset $data($1) QAcc $4
  103.       aset $data($1) SteamID $2
  104.       msg %Schan $stl( $+ $nick $+  You are 04taken01 server number  $+ $1 $+  $+ $chr(44) The details of the rent send to you in private massge $+ $chr(44) Have Fun!.)
  105.       msg $nick $stl(The server ip: $data($1) $+ $chr(44) Password to server: %pass [ $+ [ $1 ] ] $+ $chr(44) Timeleft: $replace($duration($timer(ID [ $+ [ $1 ] ]).secs,2),$chr(32),$chr(32) and $chr(32)))
  106.       rcmd $1 sv_password %pass [ $+ [ $1 ] ]
  107.       .timer 1 1 RCON $1
  108.       if (%Vent == on) openroom $gettok(%num,2,32) $nick
  109.     }
  110.   }
  111. }
  112. alias TakeServer {
  113.   var %num = $checksrv , %srv = $gettok(%num,1,32)
  114.   set %pass $+ $gettok(%num,2,32) $rand(100,999)
  115.   if (%AC [ $+ [ $gettok(%num,2,32) ] ] == on) && (%answer != on) {
  116.     set -u15 % [ $+ $nick ] $nick
  117.     msg %Schan $stl(This server using in $data(%srv).anticheat anticheat if you want take this server please type !Yes $+ $chr(44) if you want take another server please type !No. you $&
  118.       have 15 Seconds to answer if not, the server will be released) | set -u15 %answer on
  119.   }
  120.   else {
  121.     if (%srv) {
  122.       .timerID [ $+ [ $gettok(%num,2,32) ] ] 1 4500 ReleaseServer $3
  123.       aset %srv Status Taken
  124.       aset %srv Nick $2
  125.       aset %srv QAcc $3
  126.       aset %srv SteamID $1
  127.       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!.)
  128.       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)) )
  129.       rcmd $gettok(%num,2,32) sv_password %pass [ $+ [ $gettok(%num,2,32) ] ]
  130.       .timer 1 1 RCON $gettok(%num,2,32)
  131.       if (%Vent == on) openroom $gettok(%num,2,32) $nick
  132.     }
  133.   }
  134. }
  135. alias Releaseall {
  136.   .timerID* OFF
  137.   var %x = 1
  138.   while ($data(%x)) {
  139.     var %ip = $data(%x) | aunset $data(%x) supload half ctis score-A score-B score-CT score-T SteamID QAcc nick PRoom
  140.   aset $data(%x) Status Free | inc %x } | msg %Schan $stl(All the servers are 03free01 now)
  141. }
  142. alias srvdel { if ($data($1)) remini -n rents.ini $data($1) | unset %ac [ $+ $1 ] ] | rconclose $1 | $2- $stl(Server Number $1 has Removed Succsesfuly!) }
  143. alias srvadd {
  144.   if ($3 == yes) { set %ac [ $+ [ $calc($ini(rents.ini,0) + 1) ] ] on | aset $1 Anticheat $4 | $5- $stl(Server $1 has Added Succsesfuly!) }
  145.   aset $1 ip $1
  146.   aset $1 Rcon $2
  147.   aset $1 Port $rand(10000,99999)
  148.   aset $1 Connection OFF
  149.   aset $1 Status free
  150.   rcon $1
  151.   else {
  152.     $3- $stl(Server $1 has Added Succsesfuly!)
  153.   }
  154. }
  155. alias showservers {
  156.   var %x = 1, %y = 0 $data($data(%x)).ip
  157.   while (%x <= $ini(rents.ini,0)) { var %srvs = %srvs Server %x $+ : $data($data(%x)).ip | inc %x }
  158.   echo -ag $stl(Servers are: %srvs $+ , Total: $ini(rents.ini,0))
  159. }
  160. alias showusers {
  161.   var %x = 1, %y = 0
  162.   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 }
  163.   echo -ag $stl(users are: %usrs $+ , Total: $ini(users.ini,0))
  164. }
  165. alias servers {
  166.   var %x = 1, %y = 0,
  167.   while (%x <= $ini(rents.ini,0)) {
  168.     var %srvs = %srvs $iif($readini(rents.ini,$data(%x),status == free),3•01Server02 %x $+ $iif($data($data(%x)).anticheat,$chr(124),$null) $+ $data($data(%x)).anticheat $+ $chr(58) 14(03Free14),4•01Server02 %x $+ $iif($data($data(%x)).anticheat,$chr(124),$null) $+ $data($data(%x)).anticheat $+ $chr(58) 14(04Taken14 $+ $chr(124) $+ $gettok($calc($timer(ID [ $+ [ %x ] ]).secs / 60),1,46) $+ Min)) $+ $chr(44)
  169.     if ($readini(rents.ini,$data(%x),status == free)) inc %y
  170.     inc %x
  171.   }
  172.   if ($ini(rents.ini,0) == 0) { msg %Schan $stl(There are 04NO01 Servers) }
  173.   else {
  174.     msg %SChan $stl(Servers are: ( $+ $iif(%y == 0,04,03) $+ %y $+ 01/ $+ $ini(rents.ini,0) $+ ) $left(%srvs,-1) $+ . $iif(%antic, 01Anticheat:14 %antic,$null))
  175.     $iif(%spons,.timer 1 1 msg %Schan $stl(Servers by:  $+ %spons $+ ),halt)
  176.   }
  177. }
  178. alias total {
  179.   var %x = 0, %y = 1
  180.   while (%y <= $ini(rents.ini,0)) {
  181.     if ($readini(rents.ini,$ini(rents.ini,%y),status == free)) inc %x | inc %y
  182.   }
  183.   return %x
  184. }
  185. ;;; Accses System ;;;
  186. on *:text:*:?:{
  187.   if (!%floods) {
  188.     if ($1 == !login) {
  189.       if ($usrinf($qauth($nick)).logged == on) msg $nick $stl(You are already logged in!)
  190.       if ($readini(users.ini,$qauth($nick),pass) == $3) {
  191.         writeini -n Users.ini $qauth($nick) Logged ON
  192.         writeini -n Users.ini $qauth($nick) Nick $nick
  193.         msg $nick $stl(You are logged in successfuly! to user $2 $+ .)
  194.       }
  195.       else { msg $nick $stl(The user or the password are worng.) }
  196.       set -u3 %floods on
  197.     }
  198.     if ($1 == !adduser) {
  199.       if ($usrinf($qauth($nick)).lvl == owner) && ($usrinf($qauth($nick)).logged == on) {
  200.         if ($2 ison %Schan) && ($regex($3,/Admin|Owner/i)) && (!$readini(Users.ini,$qauth($2),user)) && ($qauth($2)) {
  201.           writeini -n Users.ini $qauth($2) Nick $2
  202.           writeini -n Users.ini $qauth($2) Level $3
  203.           writeini -n Users.ini $qauth($2) User $4
  204.           writeini -n Users.ini $qauth($2) Pass $5
  205.           writeini -n Users.ini $qauth($2) QAcc $qauth($2)
  206.           writeini -n Users.ini $qauth($2) Logged OFF
  207.           msg $nick User added successfully! with the details: User: $4 $+ , Password: $5 $+ , Level: $3 $+ , QAccount: $qauth($2) $+ .
  208.         }
  209.         if ($2 !ison %Schan) { msg $nick $stl($2 Must to be on the Channel: %Schan) }
  210.         if (!$regex($3,/Admin|Owner/i)) { msg $nick $stl(You must write the level of the user be (Admin/Owner).) }
  211.         if ($readini(Users.ini,$4,user)) { msg $nick $stl(The user $4 is already on the user list.) }
  212.         if (!$qauth($2)) { msg $nick $stl(The user $4 must to set //mode $me +x.) }
  213.         if (6 > $len($5)) { msg $nick $stl(The user password must to be more then 6 letters.) }
  214.         if ($usrinf($qauth($nick)).lvl == admin) { msg $nick $stl(only owner can use in this command) }
  215.       }
  216.       set -u3 %floods on
  217.     }
  218.     if ($1 == !removeuser) || ($1 == !deluser) {
  219.       if ($readini(Users.ini,$2,user)) {
  220.         remini Users.ini $2
  221.         msg $nick $stl(The user $2 is successfuly delete from the user list)
  222.       }
  223.       else { msg $nick $stl(No Such User $2_ }
  224.       set -u3 %floods on
  225.     }
  226.     if ($usrinf($qauth($nick)).logged == on) {
  227.       if ($1 == !addserver) {
  228.         if ($ini(rents.ini,$2)) { msg $nick The server: $2 $+ $chr(44) is already in the list }
  229.         elseif (!$3) { msg $nick $stl(04Syntex Error!01 Usage: !addserver [ip-server] [rcon-password]) }
  230.         elseif ($3) && (!$ini(rents.ini,$2)) { srvadd $2 $3 msg $nick }
  231.         set -u3 %floods on
  232.       }
  233.       if ($1 == !delserver) || ($1 == !removeserver) {
  234.         if (!$ini(rents.ini,$2)) { msg $nick $stl(Error! The server $2 is not in the list) }
  235.         elseif (!$2) { msg $nick $stl(04Syntex Error!01 Usage: !delserver [ip-server]) }
  236.         elseif ($2) && ($ini(rents.ini,$2)) { srvdel $2 msg $nick }
  237.         set -u3 %floods on
  238.       }
  239.       if ($1 == !admins) { msg $nick $users | set -u3 %floods on }
  240.       if ($1 == !releaseall) { releaseall | set -u3 %floods on }
  241.     }
  242.     if ($1 == !info) {
  243.       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) $&
  244.           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))) $&
  245.         Server connection: $readini(rents.ini,$v1,Connection) $+ .) }
  246.       else { msg %Schan $stl(Syntax 04Error!01 Usage: !info [Number-Server]) }
  247.       set -u3 %floods on
  248.     }
  249.     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]01. $&
  250.       Owners commands: !Adduser [nick] [level(owner/admin)] [user] [password]15 $chr(149) 01!Deluser [user],15 $chr(149) 01!Releaseall.) | set -u3 %floods on }
  251.   }
  252. }
  253. alias users {
  254.   var %x = 1, %y = 0
  255.   while (%x <= $ini(users.ini,0)) {
  256.     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) $+ )
  257.     if ($readini(users.ini,$ini(users.ini,%x),Logged == on)) inc %y
  258.     inc %x
  259.   }
  260.   return $stl(Users are: ( $+ $iif(%y == 0,14,03) $+ %y $+ 01/ $+ $ini(users.ini,0) $+ ) %users)
  261. }
  262. alias usrinf {
  263.   if ($prop == logged) { return $readini(users.ini,$1,logged) }
  264.   elseif ($prop == lvl) { return $readini(users.ini,$1,level) }
  265.   elseif ($prop == nick) { return $readini(users.ini,$1,nick) }
  266.   elseif ($prop == qacc) { return $readini(users.ini,$1,qacc) }
  267.   elseif ($prop == user) { return $readini(users.ini,$1,user) }
  268. }
  269. menu * {
  270.   intersys Servers-bot
  271.   .Set channel { var %x = $input(Type channel,e,Type channel) | if (%x) && ($chr(35) $+ * iswm %x) { Set %Schan %x } }
  272.   .Ventrilo System
  273.   .. Ventrilo (ON/OFF)
  274.   ... ON { set %ventrilo on }
  275.   ... OFF { unset %ventrilo }
  276.   .. Ventrilo IP { set %ventip $input(Type Ventrilo ip,e,Type Ventrilo ip) }
  277.   ..Ventrilo Main Room { set %main.room Ventrilo $input(Type Ventrilo Main Room,e,Type Ventrilo Main Room) }
  278.   .Servers system
  279.   ..Set Sponser { set %spons $input(Type Sponser,e,Type Sponser) }
  280.   ..Set Anticheat { set %antic $input(Type Anticheat,e,Type Anticheat) }
  281.   ..Add Server {
  282.     var %x = $input(Type server iport,e,Type server iport)
  283.     if (%x) {
  284.       var %i = $input(Type rcon password,e,Type rcon password)
  285.       if (%i) {
  286.         var %y = $input(The Server using an anticheat? Type (YES/NO),e,The Server using an anticheat? Type (YES/NO))
  287.         if (%y != yes) { srvadd %x %i echo -ag }
  288.         if (%y == yes) {
  289.           var %o = $input(Type the name of the anticheat. ex: Cheat-Defender,e,Type the name of the anticheat)
  290.           if (%o) { srvadd %x %i %y %o echo -ag }
  291.         }
  292.       }
  293.     }
  294.   }
  295.   ..Remove Server { var %x = $input(Type server number,e,Type server number) | if (%x) { srvdel %x echo -ag } }
  296.   ..Show Servers { showservers }
  297.   ..Release all { ReleaseALL }
  298.   .Users System
  299.   ..Add user: {
  300.     var %inp = $$?="Enter Nickname:"
  301.     if (%inp) {
  302.       var %lvl = $$?="Enter a Level(Admin/Owner):"
  303.       if (%lvl) {
  304.         var %usr = $$?="Enter a Username:"
  305.         if (%usr) {
  306.           var %pass = $$?="Enter a Password:"
  307.           if (%pass) {
  308.             writeini -n Users.ini $qauth(%inp) Nick %inp
  309.             writeini -n Users.ini $qauth(%inp) Level %lvl
  310.             writeini -n Users.ini $qauth(%inp) User %usr
  311.             writeini -n Users.ini $qauth(%inp) Pass %pass
  312.             writeini -n Users.ini $qauth(%inp) QAcc $qauth(%inp)
  313.             writeini -n Users.ini $qauth(%inp) Logged OFF
  314.             echo -ag User added successfully! with the details: User: %usr $+ , Password: %pass $+ , Level: %lvl $+ , QAccount: $qauth(%inp) $+ .
  315.           }
  316.         }
  317.       }
  318.     }
  319.   }
  320.   ..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!) }
  321.   ..Show users { showusers }
  322.   .Update System
  323.   ..Check for updates: uptcheck
  324.   ..Start to update: upt
  325.   ..Version %version
  326. }
  327. ; ;
  328. ;;; Server Connection ;;;
  329. ; ;
  330. 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 } }
  331. 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--- }
  332. alias RconLOG {
  333.   rcmd $1 nochn logaddress_del $ip $readini(rents.ini,$ini(rents.ini,$1),Port)
  334.   rcmd $1 nochn logaddress_del $ip $readini(rents.ini,$ini(rents.ini,$1),Port)
  335.   .timer -m 1 230 rcmd $1 nochn mp_logfile 1
  336.   .timer -m 1 260 rcmd $1 nochn mp_logdetail 2
  337.   .timer -m 1 290 rcmd $1 nochn sv_rcon_banpenalty 1
  338.   .timer -m 1 320 rcmd $1 nochn sv_rcon_maxfailures 20
  339.   .timer -m 1 350 rcmd $1 nochn sv_rcon_minfailures 20
  340.   .timer -m 1 380 rcmd $1 nochn sv_rcon_minfailuretime 1
  341.   .timer -m 1 420 rcmd $1 nochn log on
  342.   .timer -m 1 450 rcmd $1 nochn admin_ignore_immunity 1
  343.   .timer -m 1 480 rcmd $1 nochn logaddress_add $ip $readini(rents.ini,$ini(rents.ini,$1),Port)
  344.   .timer -m 1 500 echo -s (12RCON $1 $+ 1) 3* Open Socket Rcon LOG... *
  345. }
  346. alias RCON {
  347.   if ($ip) echo -s (12RCON $1 $+ 1) 4* Starting RCON $1 *
  348.   echo -s (12RCON $1 $+ 1) Server IPort:12 $ini(rents.ini,$1)
  349.   echo -s (12RCON $1 $+ 1) Rcon password is:12 $readini(rents.ini,$ini(rents.ini,$1),Rcon)
  350.   echo -s (12RCON $1 $+ 1) Port is:12 $readini(rents.ini,$ini(rents.ini,$1),Port)
  351.   echo -s (12RCON $1 $+ 1) Your IP is:12 $ip
  352.   echo -s  | GETchallenge $1
  353.   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)
  354.   .timerLOG -m 1 750 RconLOG $1
  355. }
  356. 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 }
  357. on *:udpread:rcon*Challenge: {
  358.   var %RCON-challenge
  359.   sockread %RCON-challenge
  360.   if ($gettok(%RCON-challenge,3,32) isnum) {
  361.     var %n = $remove($sockname,rcon,Challenge)
  362.     aset $ini(rents.ini,%n) challenge $gettok(%RCON-challenge,3,32)
  363.   }
  364.   elseif ($gettok(%RCON-challenge,3,32) !isnum) && ($readini(rents.ini,$ini(rents.ini,%n),Connection) !== Banned) {
  365.     aset $ini(rents.ini,%n) Connection Banned
  366.     RCONclose %n | echo -s 1(12RCON %n $+ 1)4 You are BANNED from the Server RCON Closed ! 2Check your Server details.
  367.   }
  368. }
  369. 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-) }
  370. on *:udpread:rcon*LOG:{
  371.   var %LOG
  372.   sockread -f %LOG
  373.   while ($sockbr) {
  374.     if (%LOG) && (echo check !isin %LOG) RCON.DATA $remove($sockname,rcon,LOG) $gettok(%LOG,6-,32)
  375.     sockread -f %LOG
  376.   }
  377. }
  378. on *:udpread:rcon*CMD: {
  379.   var %CMD
  380.   var %n = $remove($sockname,rcon,CMD)
  381.   sockread -f %CMD
  382.   while ($sockbr) {
  383.     if ($mid(%CMD,1,5) == $+($str($chr(255),4),l)) tokenize 32 $mid(%CMD,6-)
  384.     else tokenize 32 %CMD
  385.     if (!$window(@Console $+ %n)) && ($1- != $null) /window -e @Console $+ %n
  386.     if ($1- != $null) && ($1- != check) && ($gettok($1-,6,32) !== check") && ($gettok($1-,5,32) !== echo) { echo @Console $+ %n (12RCON %n $+ 1) $1- }
  387.     if (echo check !isin $1-) RCON.DATA %n $1-
  388.     sockread -f %CMD
  389.   }
  390. }
  391. alias clr {
  392.   var %CLR.TEMP = $strip($gettok($1,1,34))
  393.   if ($prop == Steam) return $gettok($gettok(%CLR.TEMP,$calc($numtok(%CLR.TEMP,60) -1) $+ - $+ $numtok(%CLR.TEMP,60),60),1,62)
  394.   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)
  395.   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)))
  396.   elseif ($prop == Said) return $strip($gettok($1,3,34))
  397.   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)))
  398.   elseif ($prop == Team) return $remove($gettok($gettok(%CLR.TEMP,$calc($numtok(%CLR.TEMP,60) -1) $+ - $+ $numtok(%CLR.TEMP,60),60),2,62),<)
  399.   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),<)
  400.   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)
  401.   elseif ($prop == triggered) return $gettok($strip($1),4,32)
  402.   elseif ($prop == Weapon) || ($prop == Gun) return $gettok($1,5,34)
  403.   Return $gettok($1,2,34)
  404. }
  405. alias RCON.DATA {
  406.   if (!$window(@Console $+ $1)) .window -e @Console $+ $1
  407.   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
  408.   var %trig $remove($clr($2-).triggered,")
  409.   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... * }
  410.   if (Server shutdown isin $2-) { aset $ini(rents.ini,$1) Connection OFF | echo -s (12RCON $1 $+ 1) 4* SERVER SHUTDOWN - Closing RCON Socket... * }
  411.   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) {
  412.     aset $data($1) Connection ON
  413.     .timerRCON $+ $1 0 600 rcon $1
  414.     .timerECHO $+ $1 0 60 rcmd $1 echo Servers-Bot connection
  415.     echo -s (12RCON $1 $+ 1) 12Servers-Bot Connection to the SERVER !!!
  416.   }
  417.   if ($2- == World triggered "Round_Start") && ($uploadscore($data(%rcon.id))) {
  418.     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. }
  419.     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! }
  420.     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! }
  421.   }
  422.   if ($2- == World triggered "Round_End") && ($uploadscore($data(%rcon.id))) {
  423.     serverscore %rcon.id
  424.     if ($score($data(%rcon.id)).A == 16) gend %rcon.id A
  425.     if ($score($data(%rcon.id)).B == 16) gend %rcon.id B
  426.     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)
  427.   }
  428.   if ($istok(Target_Bombed Hostages_Not_Rescued Bomb_Defused CTs_Win Terrorists_Win Target_Saved,%trig,32)) && ($uploadscore($data(%rcon.id))) {
  429.     aset $data(%rcon.id) score-t $gettok($2-,8,34)
  430.     aset $data(%rcon.id) score-ct $gettok($2-,6,34)
  431.   }
  432.   if ($2 isnum) && ($3 == :) && ($5 == :) && ($6) {
  433.     var %rcon.nick = $6-
  434.     var %id = $2
  435.     :Teamer
  436.     if ($gettok($timer(Teamer).com,3-,32)) {
  437.       var %move = $gettok($timer(Teamer).com,3-,32)
  438.       if ($gettok(%move,2,32) == CT) {
  439.         rcmd %rcon.id admin_command admin_execclient %id "chooseteam;menuselect 2
  440.         ;else { rcmd %rcon.id admin_command admin_execclient %id "chooseteam; menuselect 1 }
  441.       }
  442.       else {
  443.         rcmd %rcon.id admin_command admin_execclient %id "chooseteam;menuselect 1
  444.         ;else { rcmd %rcon.id admin_command admin_execclient %id "chooseteam;menuselect 2 }
  445.       }
  446.     }
  447.     :CTag
  448.     ;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 }
  449.     ;else {
  450.     aset $data(%rcon.id) supload on
  451.     setscore $data(%rcon.id)
  452.     if ($data($ini(rents.ini,%rcon.id)).half == $null) { aset $data(%rcon.id) half start }
  453.     if ($istok(start First,$data($ini(rents.ini,%rcon.id)).half,32)) {
  454.       aset $data(%rcon.id) half First
  455.       RCMDfirstlife %rcon.id
  456.       if (%rcon.team == CT) {
  457.         aset $data(%rcon.id) ctis A
  458.       }
  459.       if (%rcon.team == TERRORIST) {
  460.         aset $data(%rcon.id) ctis B
  461.       }
  462.     }
  463.     if ($istok(Second half1,$data($ini(rents.ini,%rcon.id)).half,32)) {
  464.       aset $data(%rcon.id) half Second
  465.       RCMDsecondlife %rcon.id
  466.     }
  467.     .timerctag off
  468.     ;}
  469.   }
  470.   if (echo check !isin $2-) { echo @Console $+ $1 (12RCON $1 $+ 1) $$2- }
  471.   if (Bad Rcon: "rcon* iswm %rcon.dat) { aset $ini(rents.ini,$1) Connection BadRcon }
  472.   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 }
  473.   if ( ($clr($2-) == say) || ($clr($2-) == say_team) ) && (!%Bot.S. [ $+ [ %rcon.id ] ]) && ($readini(rents.ini,$ini(rents.ini,%rcon.id),SteamID) == %RCON.Steam) {
  474.     Tokenize 32 $clr($2-).said
  475.     if ($1 == !score) { Set -u2 %Bot.S $+ %rcon.id On | serverscore %rcon.id }
  476.     if ($1 == !rr) { Set -u2 %Bot.S $+ %rcon.id On | rcmd %rcon.id sv_restart $iif($2 isnum,$2,1) }
  477.     if ($1 == !Kick) { Set -u2 %Bot.S $+ %rcon.id On | rcmd %rcon.id admin_command admin_kick $2- }
  478.     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- }
  479.     if ($1- == !NoPass) { Set -u2 %Bot.S $+ %rcon.id On | rcmd %rcon.id admin_command admin_nopass }
  480.     if ($1 == !Map) && ($2) { Set -u2 %Bot.S $+ %rcon.id On | rcmd %rcon.id admin_command admin_map $2 }
  481.     if ($1- == !prac) { Set -u5 %Bot.S $+ %rcon.id On | PRAC %rcon.id | Esay %rcon.id [Prac] Prac Setting loaded by %rcon.nick }
  482.     if ($1- == !MR15) { Set -u5 %Bot.S $+ %rcon.id On | MR15 %rcon.id | Esay %rcon.id [MR15] MR15 Setting loaded by %rcon.nick }
  483.     if ($1 == !T) && ($2) { Set -u2 %Bot.S $+ %rcon.id On | MOVE-T %rcon.id $2- }
  484.     if ($1 == !CT) && ($2) { Set -u2 %Bot.S $+ %rcon.id On | MOVE-CT %rcon.id $2- }
  485.     if ($1 == !Slay) && ($2) { Set -u2 %Bot.S $+ %rcon.id On | rcmd %rcon.id admin_command admin_slay $2- }
  486.     if ($1 == !Name) && ($2) { Set -u2 %Bot.S $+ %rcon.id On | rcmd %rcon.id admin_command admin_execclient $2 name " $+ $3- }
  487.     if ($1 == @) || ($1 == !) || ($1 == !tsay) { Set -u2 %Bot.S $+ %rcon.id On | rcmd %rcon.id admin_command admin_tsay $2- }
  488.     if ($1 == !ssay) { Set -u2 %Bot.S $+ %rcon.id On | Ssay %rcon.id $2- }
  489.     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 }
  490.     if ($1 == !Knife) {
  491.       mr15 %rcon.id
  492.       .timer 1 2 ssay %rcon.id ..::Knife Round Has Been Started:::..
  493.       .timer 1 2 ssay %rcon.id ..::Knife Round Has Been Started:::..
  494.       .timer 1 2 ssay %rcon.id Dont TK, Throw Grenades or Quit!
  495.       .timer 6 2 rcmd %rcon.id admin_command admin_execall drop
  496.     }
  497.     if ($1 == !disconnect) || ($1 == !Quit) { Set -u2 %Bot.S $+ %rcon.id On | rcmd %rcon.id admin_command admin_execall disconnect }
  498.     if ($1 == !FF) {
  499.       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 }
  500.       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 }
  501.     }
  502.     if ($1 == !Help) || ($1 == !Commands) {
  503.       Esay %rcon.id [HELP] Admin Commands Are: !Pass ¬ !NoPass ¬ !Slay ¬ !Map ¬ !RR ¬ !CT/T ¬ !Name ¬ !Kick $+ .
  504.       Esay %rcon.id [HELP] Admin Commands Are: !MR15 ¬ !Prac ¬ !Rates ¬ !Live ¬ !Notlive ¬ !Quit ¬ !Tax ¬ !Knife $+ .
  505.       Esay %rcon.id [HELP] Admin Commands Are: !Ssay ¬ !Swap CT/T ¬ !End ¬ !Tsay $+ .
  506.     }
  507.     if ($1-2 == !swap t) { teamer %rcon.id t }
  508.     if ($1-2 == !swap ct) { teamer %rcon.id ct }
  509.     if ($1 == !Fz) { Set -u2 %Bot.S $+ %rcon.id On | ssay %rcon.id Freezetime is $2 now. | rcmd %rcon.id mp_freezetime $2 }
  510.     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 }
  511.     if ($1 == !Rates) { Set -u2 %Bot.S $+ %rcon.id On | Rates %rcon.id | Esay %rcon.id [Rates] Rates Setting loaded by %rcon.nick }
  512.     if ($1 == !End) { Set -u2 %Bot.S $+ %rcon.id On | gend %rcon.id }
  513.     if ($1 == !notLive) {
  514.       aset %rcon.id supload off
  515.       Esay %rcon.id [NotLive] The Game Has Been Paused
  516.     }
  517.     if ($1 == !live) {
  518.       aset $data(%rcon.id) supload on
  519.       setscore $data(%rcon.id)
  520.       if ($data($ini(rents.ini,%rcon.id)).half == $null) { aset $data(%rcon.id) half start }
  521.       if ($istok(start First,$data($ini(rents.ini,%rcon.id)).half,32)) {
  522.         aset $data(%rcon.id) half First
  523.         RCMDfirstlife %rcon.id
  524.         if (%rcon.team == CT) {
  525.           aset $data(%rcon.id) ctis A
  526.         }
  527.         if (%rcon.team == TERRORIST) {
  528.           aset $data(%rcon.id) ctis B
  529.         }
  530.       }
  531.       if ($istok(Second half1,$data($ini(rents.ini,%rcon.id)).half,32)) {
  532.         aset $data(%rcon.id) half Second
  533.         RCMDsecondlife %rcon.id
  534.       }
  535.       ;ctag %rcon.id
  536.     }
  537.   }
  538. }
  539. alias tags {
  540.   if ($1 == off) { return off }
  541.   else { return on }
  542. }
  543. alias ctag { var %1 = $1 | .timerCTag -m 1 3500 CTag x %1 | .timer -m 1 500 rcmd %1 users }
  544. alias taga { return %taga }
  545. alias tagb { return %tagb }
  546. alias gend {
  547.   var %1 $1
  548.   if ($data(%1).status == off) { halt }
  549.   if ($2) {
  550.     ssay %1 ..::The Game has ENDED! Team $2 Won.!::..
  551.     ssay %1 ..::The Game has ENDED! Team $2 Won.!::..
  552.     tsay %1 ..::The Game has ENDED! Team $2 Won.!::..
  553.     tsay %1 ..::The Game has ENDED! Team $2 Won.!::..
  554.   }
  555.   else {
  556.     ssay %1 ..::The Game is ENDED!::..
  557.     ssay %1 ..::The Game is ENDED!::..
  558.     tsay %1 ..::The Game is ENDED!::..
  559.     tsay %1 ..::The Game is ENDED!::..
  560.   }
  561.   rcmd %1 sv_password $r(100,999)
  562.   aunset $data(%1) supload half ctis score-A score-B score-CT score-T
  563. }
  564. alias data {
  565.   var %file rents.ini
  566.   if ($1) {
  567.     if ($readini(%file,$1,$prop)) {
  568.       return $$v1
  569.     }
  570.     if (!$prop) && ($ini(%file,$1)) { return $ini(%file,$1) }
  571.   }
  572. }
  573. alias serverscore {
  574.   var %1 $1
  575.   if ($data(%1).half == start) ssay %1 Score Is Not Live Yet!
  576.   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]) }
  577. }
  578. alias swap {
  579.   var %1 $1
  580.   if ($data(%1).ctis == A) teamer $data(%1) T
  581.   elseif ($data(%1).ctis == B) teamer $data(%1) CT
  582. }
  583. alias Teamer {
  584.   var %1 $1
  585.   if (!$1) || ($1 = X) Halt
  586.   if ($2 != CT) && ($2 != T) Halt
  587.   .timerTEAMer -m 1 3500 Teamer x $1-2
  588.   rcmd %1 admin_quiet 2
  589.   rcmd %1 allow_client_exec 1
  590.   rcmd %1 admin_ignore_immunity 1
  591.   rcmd %1 admin_command admin_execall setinfo "_vgui_menus" "0"
  592.   .timer -m 1 500 rcmd %1 users
  593. }
  594. alias uploadscore {
  595.   var %1 $1
  596.   if ($data(%1).supload != on) return $false
  597.   elseif ($data(%1).half == start) return $false
  598.   elseif (half isin $data(%1).half) return $false
  599.   return $true
  600. }
  601. alias setscore {
  602.   var %1 $1
  603.   aset %1 score-ct 0
  604.   aset %1 score-t 0
  605. }
  606. alias score {
  607.   if ($isid) {
  608.     var %1 $1
  609.     var %p $prop
  610.     var %ct $data(%1).ctis
  611.     var %half $data(%1).half
  612.     var %s-ct $data(%1).score-CT
  613.     var %s-t $data(%1).score-T
  614.     var %s-a $data(%1).score-A
  615.     var %s-b $data(%1).score-B
  616.     if (%p == A) {
  617.       if (%ct == A) {
  618.         if (%half == First) { return %s-ct }
  619.         if (%half == Half1) { return %s-a }
  620.         if (%half == Second) { return $calc(%s-t + %s-a) }
  621.       }
  622.       if (%ct == B) {
  623.         if (%half == First) { return %s-t }
  624.         if (%half == Half1) { return %s-a }
  625.         if (%half == Second) { return $calc(%s-ct + %s-a) }
  626.       }
  627.     }
  628.     if (%p == B) {
  629.       if (%ct == a) {
  630.         if (%half == First) { return %s-t }
  631.         if (%half == Half1) { return %s-b }
  632.         if (%half == Second) { return $calc(%s-ct + %s-b) }
  633.       }
  634.       if (%ct == B) {
  635.         if (%half == First) { return %s-ct }
  636.         if (%half == Half1) { return %s-b }
  637.         if (%half == Second) { return $calc(%s-t + %s-b) }
  638.       }
  639.     }
  640.     if (%half == start) { return Not-Live }
  641.   }
  642. }
  643. alias aunset {
  644.   var %file Rents.ini
  645.   var %s $1
  646.   tokenize 32 $2-
  647.   remini -n %file %s $*
  648. }
  649. alias aset {
  650.   var %file Rents.ini
  651.   if ($3) || ($3 == 0) writeini -n %file $1-
  652.   else { echo -ts BAD ASET COMMAND!!! //writeini -n %file $replace($1-,0,$chr(48)) }
  653. }
  654. alias RCMDfirstlife {
  655.   var %1 $1
  656.   mr15 %1
  657.   .timer 1 1 ssay %1 Preparing for starting game, Please Wait..
  658.   .timer 1 3 ssay %1 The Game is Starting after the Restart! Good Luck!
  659.   .timer 1 4 rcmd %1 sv_restart 1
  660.   .timer 1 9 ssay %1 ..::LIVE. Game started! -> TEAM KILL = BAN::..
  661.   .timer 1 9 ssay %1 Match is live! First half started, Score is - Team-A: 0 Team-B: 0.
  662. }
  663. alias RCMDsecondlife {
  664.   var %1 $1
  665.   mr15 %1
  666.   .timer 1 2 ssay %1 Preparing for starting game, Please Wait..
  667.   .timer 1 4 ssay %1 The Second Half is Starting after the Restart! Good Luck!
  668.   .timer 1 6 rcmd %1 sv_restart 1
  669.   .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
  670. }
  671. alias ghalf1 {
  672.   var %1 $1
  673.   aset %1 score-A $score(%1).A
  674.   aset %1 score-B $score(%1).B
  675.   aset %1 supload off
  676.   aset %1 half half1
  677.   ssay $data(%1) First Half Is Ended! Score: [Team-A: $score(%1).A Team-B: $score(%1).B $+ ]
  678.   tsay $data(%1) First Half Is Ended! Score: [Team-A: $score(%1).A Team-B: $score(%1).B $+ ]
  679.   swap %1
  680. }
  681. alias Esay { rcmd $1 admin_command admin_ssay $$2- }
  682. alias tsay { rcmd $1 admin_command admin_tsay $2- }
  683. alias ssay { rcmd $1 admin_command admin_ssay $+([,%Schan,]) $$2- }
  684. 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 }
  685. 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 }
  686. alias MR15 {
  687.   rcmd $1 alias mr122k "admin_ignore_immunity 1;default_access 0;mr121"
  688.   rcmd $1 alias mr121 "mp_forcecamera 2;mp_forcechasecam 2;mp_c4timer 35;mr122"
  689.   rcmd $1 alias mr122 "mp_autoteambalance 0;mp_limitteams 0;mp_startmoney 800;mr123"
  690.   rcmd $1 alias mr123 "mp_autokick 0;mp_friendlyfire 1;mp_freezetime 8;mr124"
  691.   rcmd $1 alias mr124 "mp_roundtime 1.75;mp_buytime 0.15;mp_fadetoblack 0;mr125"
  692.   rcmd $1 alias mr125 "sv_alltalk 0;sv_gravity 800;mp_tkpunish 0;sv_restart 1"
  693.   rcmd $1 mr122k
  694. }
  695. alias PRAC {
  696.   rcmd $1 alias prac122k "admin_ignore_immunity 1;default_access 0;Prac1"
  697.   rcmd $1 alias Prac1 "mp_forcecamera 0;mp_forcechasecam 0;mp_c4timer 35;Prac2"
  698.   rcmd $1 alias Prac2 "mp_autoteambalance 0;mp_limitteams 0;mp_startmoney 16000;Prac3"
  699.   rcmd $1 alias Prac3 "mp_autokick 0;mp_friendlyfire 0;mp_freezetime 0;Prac4"
  700.   rcmd $1 alias Prac4 "mp_roundtime 7;mp_buytime 9;mp_fadetoblack 0;Prac5"
  701.   rcmd $1 alias Prac5 "sv_alltalk 1;sv_gravity 800;mp_tkpunish 0;sv_restart 1"
  702.   rcmd $1 prac122k
  703. }
  704. alias Rates {
  705.   rcmd $1 alias r122k "sv_maxrate 25000;sv_maxupdaterate 101;sv_minrate 15000;sv_maxcmdrate 101;r121"
  706.   rcmd $1 alias r121 "sv_minupdaterate 20;sv_maxspeed 320;sv_ticrate 1000;r122"
  707.   rcmd $1 alias r122 "sv_region 3;restart"
  708.   rcmd $1 r122k
  709. }
  710. alias RetryRCONS {
  711.   echo -s 1(12RCONS1) 3Retrying rcons ...
  712.   Sockclose *
  713.   .timerRCON* Off
  714.   .timerECHO* Off
  715.   .timer 1 3 RCONstart
  716. }
  717. alias closeroom {
  718.   remove drop.txt
  719.   write drop.txt /chan delete " $+ Server $1 $+ "
  720.   run ventrcon.exe -f drop.txt -a %adminpw %vent.ip
  721.   aunset $data($1) PRoom
  722. }
  723. alias openroom {
  724.   remove create.txt
  725.   var %pw $r(100,999)
  726.   write create.txt /subchan " $+ %main.room $+ " " $+ Server $1 $+ " 1 %pw 1 $2
  727.   aset $data($1) PRoom %pw
  728.   run ventrcon.exe -f create.txt -a %adminpw %vent.ip
  729.   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.)
  730. }
  731. alias uptcheck { sockclose uptc | sockopen uptc www.intersys.byethost7.com 80 }
  732. on *:sockopen:uptc: {
  733.   sockwrite -nt uptc GET /intersys.txt HTTP/1.0
  734.   sockwrite -nt uptc Host: www.intersys.byethost7.com
  735.   sockwrite -nt uptc $crlf
  736. }
  737. on *:sockread:uptc: {
  738.   if (!$sockerr) {
  739.     var %uptc | sockread %uptc
  740.     if ($regex(%uptc,<(\d.+)>)) && ($regml(1) != %version) {
  741.       echo -s $stl(You using in older version(14 $+ %version $+ 01), You need to update the bot.)
  742.       echo -s $stl(The newest version is:  $+ $regml(1) $+  $+ $chr(44) to update use command: 04/upt01)
  743.     }
  744.     elseif ($regex(%uptc,<(\d.+)>)) && ($regml(1) == %version) {
  745.       echo -s $stl(You using updated version $+ $chr(44) You dont need update.)
  746.     }
  747.   }
  748. }
  749. alias upt { sockclose yt | sockopen yt www.intersys.byethost7.com 80 }
  750. on *:sockopen:yt: {
  751.   sockwrite -nt yt GET /intersys.txt HTTP/1.0
  752.   sockwrite -nt yt Host: www.intersys.byethost7.com
  753.   sockwrite -nt yt $crlf
  754.   %upt = off
  755. }
  756. on *:sockread:yt: {
  757.   if (!$sockerr) {
  758.     var %yt | sockread %yt
  759.     if ($regex(%yt,<(\d.+)>)) { set %version $regml(1) }
  760.     if (%upt == on) { write bot2.mrc %yt }
  761.     if (<start> isin %yt) && (%upt == off) { %upt = on | .timer 1 5 progressbar | .timer 1 5 update | echo -s $stl(The bot updated, please wait...) }
  762.   }
  763. }
  764. alias update {
  765.   .timer 1 0 .load -rs bot2.mrc
  766.   .timer 1 1 .unload -rs bot.mrc
  767.   .timer 1 2 .remove bot.mrc
  768.   .timer 1 3 .rename bot2.mrc bot.mrc
  769.   .timer 1 4 .unload -rs bot.mrc
  770.   .timer 1 5 .unload -rs bot2.mrc
  771.   .timer 1 6 .load -rs bot.mrc
  772.   .timer 1 6 .echo -s $stl(The update was successful $+ $chr(44) Now your version is:  $+ %version $+  )
  773. }
  774. alias progressbar {
  775.   window -ahCkodp +fe @Updated 1 1 255 40
  776.   drawfill @Updated 1 1 1 1
  777.   var %i 1
  778.   while (%i <= 255) {
  779.     drawline -r @Updated $rgb(%i,$calc(255 - %i),0) 2 $calc(0 + %i) 20 $calc(0 + %i) 40
  780.     drawtext -r @Updated $rgb(%i,$calc(255 - %i),0) Arial 12 55 0 Updated, please wait...
  781.     inc %i
  782.     var %t 1
  783.     while (%t <= 5500) { inc %t }
  784.   }
  785.   window -c @Updated
  786. }
  787. ;;;;; END Update System ;;;;;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement