Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ctcp *:*:{ ignore -tp $nick | haltdef }
- alias php.exe { return C:\Program Files (x86)\PHP\v5.3\php.exe }
- alias php.ini { return php.ini }
- alias php.file { return mysql.php }
- alias php.command { .timerphp.exe -o 1 0 run $+(",$php.exe,") -f $+(",$mircdir,$gfile($php.file),") }
- alias gdir { return gatherbot\ }
- alias sigmirc { run -hn C:\sigmirc\sigmirc.exe $1- }
- alias contact { return #zikkan }
- alias scripter { return #zikkan }
- alias blockaccess { return cokebabz }
- alias blockipaccess { return ?.?.?.? }
- alias team.updateid {
- var %gfile = $gfile(gteams.ini), %read = $+($1,=,*) | while ($read(%gfile,w,%read)) {
- var %i = $readn, %x = $read(%gfile,%i) | write -l $+ %i %gfile $replace(%x,$1,$2)
- }
- var %read = $+(leader,=,$1) | while ($read(%gfile,w,%read)) {
- var %i = $readn, %x = $read(%gfile,%i) | write -l $+ %i %gfile $replace(%x,$1,$2)
- }
- }
- alias team.deleteid {
- var %gfile = $gfile(gteams.ini), %read = $+(leader,=,$1) | while ($read(%gfile,w,%read)) {
- var %i = $readn, %x = 25, %team | while (!%team) && (%x) && ($read(%gfile,%i)) {
- var %f = $ifmatch | if ([*] iswm %f) { var %team = $left($right(%f,-1),-1) | remini -n %gfile %team } | dec %i | dec %x
- }
- }
- var %read = $+($1,=,*) | while ($read(%gfile,w,%read)) {
- var %i = $readn, %x = 25, %team | while (!%team) && (%x) && ($read(%gfile,%i)) {
- var %f = $ifmatch | if ([*] iswm %f) { var %team = $left($right(%f,-1),-1) | remini -n %gfile %team $1 } | dec %i | dec %x
- }
- }
- }
- alias team.unrequest {
- var %gfile = $gfile(gteams.ini), %read = $+($1,=,request) | while ($read(%gfile,w,%read)) {
- var %i = $readn, %x = 25, %team | while (!%team) && (%x) && ($read(%gfile,%i)) {
- var %f = $ifmatch | if ([*] iswm %f) { var %team = $left($right(%f,-1),-1) | remini -n %gfile %team $1 } | dec %i | dec %x
- }
- }
- var %read = $+($1,=,invite) | while ($read(%gfile,w,%read)) {
- var %i = $readn, %x = 25, %team | while (!%team) && (%x) && ($read(%gfile,%i)) {
- var %f = $ifmatch | if ([*] iswm %f) { var %team = $left($right(%f,-1),-1) | remini -n %gfile %team $1 } | dec %i | dec %x
- }
- }
- }
- alias team.invites {
- var %gfile = $gfile(gteams.ini), %i = 1, %teams
- while ($ini(%gfile,%i)) {
- var %team = $ifmatch | if ($readini(%gfile,%team,$1) == invite) { var %teams = $iif(%teams,$+(%teams,$chr(44))) %team } | inc %i
- }
- return $iif(%teams,%teams,0)
- }
- alias team.player {
- var %gfile = $gfile(gteams.ini), %r = $+($1,=,leader), %r2 = $+($1,=,officer), %r3 = $+($1,=,member)
- if ($read(%gfile,w,%r)) || ($read(%gfile,w,%r2)) || ($read(%gfile,w,%r3)) {
- var %i = $readn, %x = 25 | while (%x) && ($read(%gfile,%i)) {
- var %f = $ifmatch | if ([*] iswm %f) { return $left($right(%f,-1),-1) } | dec %i | dec %x
- }
- }
- return $false
- }
- alias team.rank {
- if ($1 isnum 10) { return Leader }
- if ($1 isnum 9) { return Officer }
- if ($1 isnum 8) { return Member }
- if ($1 == Leader) { return 10 }
- if ($1 == Officer) { return 9 }
- if ($1 == Member) { return 8 }
- return 0
- }
- alias team.playerrank {
- var %gfile = $gfile(gteams.ini), %r = $+($1,=,leader), %r2 = $+($1,=,officer), %r3 = $+($1,=,member)
- if ($read(%gfile,w,%r)) || ($read(%gfile,w,%r2)) || ($read(%gfile,w,%r3)) {
- var %i = $readn, %x = $read(%gfile,%i) | return $team.rank($gettok(%x,2,61))
- }
- return 0
- }
- alias team.name {
- var %gfile = $gfile(gteams.ini)
- if ($ini(%gfile,$1)) { return $ini(%gfile,$ifmatch) }
- return $false
- }
- alias team.ids {
- var %ranks = leader officer member, %gfile = $gfile(gteams.ini), %i = 1, %p
- if ($ini(%gfile,$1)) {
- while ($ini(%gfile,$1,%i)) {
- var %x = $ifmatch, %r = $readini(%gfile,$1,%x) | if ($istok(%ranks,%r,32)) { var %p = %p %x } | inc %i
- }
- return $iif(%p,%p,0)
- }
- return 0
- }
- alias team.names {
- var %ranks = leader officer member, %gfile = $gfile(gteams.ini), %i = 1, %p
- if ($ini(%gfile,$1)) {
- while ($ini(%gfile,$1,%i)) {
- var %x = $ifmatch, %r = $readini(%gfile,$1,%x)
- if ($istok(%ranks,%r,32)) { var %p = $iif(%p,$+(%p,$chr(44))) $+($anick(%x),$col(14,$chr(91)),$upleft(%r),$col(14,$chr(93))) }
- inc %i
- }
- }
- return $iif(%p,%p,0)
- }
- alias team.cnames {
- var %ranks = leader officer member, %gfile = $gfile(gteams.ini), %i = 1, %p
- if ($ini(%gfile,$1)) {
- while ($ini(%gfile,$1,%i)) {
- var %x = $ifmatch, %r = $readini(%gfile,$1,%x) | if ($istok(%ranks,%r,32)) { var %p = $iif(%p,$+(%p,$chr(44))) $anick(%x) } | inc %i
- }
- }
- return $iif(%p,%p,0)
- }
- alias team.players {
- var %ranks = leader officer member, %gfile = $gfile(gteams.ini), %i = 1, %p = 0
- if ($ini(%gfile,$1)) {
- while ($ini(%gfile,$1,%i)) {
- var %x = $ifmatch, %r = $readini(%gfile,$1,%x) | if ($istok(%ranks,%r,32)) { inc %p } | inc %i
- }
- }
- return %p
- }
- alias team.banned {
- if ($readini($gfile(teambans.ini),$1,tid)) { return $true }
- return $false
- }
- alias team.checkname {
- var %i = 1 | while ($mid($1,%i,1)) {
- var %x = $ifmatch, %chr = $asc(%x)
- if (%chr !isnum 97-122) && (%chr !isnum 65-90) { return $false }
- inc %i
- }
- return $iif(!$1,$false,$true)
- }
- alias statsblock {
- ;;SPECIAL;;
- if (#signfrag.* iswm $mainchan) { if (!$gatherstatus(accept)) && ($gatherstatus(signup)) { return $ifmatch } }
- if ($gatherstatus(pick)) { return $ifmatch }
- if (%statsblock) { return $ifmatch }
- if (%statscmd > 6) { set -z %statsblock $iif(%statscmd > 7,8,5) | unset %statscmd | return %statsblock }
- inc -z %statscmd 3.5 | return 0
- }
- alias ct { return $+($chr(35),$1-) }
- alias ignorecmds { var %cmd = $cmd_ingame($1) | if (!%ignore) || ($istok(reload bots bot add sign rem remove out del delete adminsign reject stop accept acceptcl reject rejectcl,%cmd,32)) { return $false } | return $true }
- alias checkconn {
- if ($me ison $ownerchan) {
- ;msg $ownerchan .
- }
- elseif ($me ison $privchan) {
- ;msg $privchan .
- }
- elseif ($me ison $mainchan) {
- ;msg $mainchan .
- }
- .timercheckconn -o 1 300 checkconn
- }
- alias obslogo {
- if ($mainchan == #signfrag.cs) { return 04,1::0 }
- return 04::
- }
- alias howtogetaccess {
- return Use .buystatus to see how you can get access
- }
- alias getaccess {
- if (!$gatherinfo(access)) { return $calc($ctime + 31536000) }
- var %steamid = $1, %gfile = $gfile(access.ini)
- return $iif($readini(%gfile,%steamid,access),$ifmatch,$false)
- }
- alias haveaccess {
- if (!$gatherinfo(access)) { return $true }
- var %steamid = $1, %gfile = $gfile(access.ini), %access = $readini(%gfile,%steamid,access), %ctime = $ctime, %auth = $gauth(%steamid)
- if (%access > %ctime) || ($admin($+($chr(35),%auth)) >= 10) { return $true }
- return $false
- }
- alias giveaccess {
- var %steamid = $1, %gfile = $gfile(access.ini), %access = $readini(%gfile,%steamid,access), %ctime = $ctime, %days = $iif($2 isnum,$2,30)
- if (%access < %ctime) || (!%access) { var %access = %ctime }
- var %give = $calc(3600 * 24 * %days), %access = $calc(%access + %give)
- writeini -n %gfile %steamid access %access
- }
- alias takeaccess {
- var %steamid = $1, %gfile = $gfile(access.ini), %access = $readini(%gfile,%steamid,access), %ctime = $ctime, %days = $iif($2 isnum,$2,0)
- if (%access < %ctime) || (!%access) { return }
- var %take = $calc(3600 * 24 * %days), %access = $calc(%access - %take)
- if (%access < %ctime) || (!%days) { var %access = %ctime }
- writeini -n %gfile %steamid access %access
- }
- alias gfile {
- var %dir = $iif(*?\ iswm $gdir,$gdir), %file = $replace($lower($1),cstats,clutchstats), %dfile = $+(%dir,%file)
- if (%dir) {
- if (!$isdir(%dir)) { .mkdir %dir }
- if (!$isfile(%dfile)) && ($isfile(%file)) { .rename %file %dfile }
- return $iif(*?\?*.?* iswm %dfile,%dfile,$+(%dir,error.ini))
- }
- return $iif(*?.?* iswm %file,%file,error.ini)
- }
- alias unlim {
- if ($1 == pool) { if ($readini($gfile(gatherinfo.ini),modes,unlimpool) == ON) || (($2) && ($readini($gfile(gatherstatus.ini),$2,unlimpool))) { return $true } }
- if ($1 == noon) { if ($time <= 12) && ($readini($gfile(gatherinfo.ini),modes,unlimnoon) == ON) { return $true } }
- if ($readini($gfile(gatherinfo.ini),modes,unlimpool) == ON) || (($time <= 12) && ($readini($gfile(gatherinfo.ini),modes,unlimnoon) == ON)) { return $true }
- return $false
- }
- alias gatherinfo {
- if ($1 == game) { return $iif($readini($gfile(gatherinfo.ini),modes,gametype),$ifmatch,CS:GO) }
- if ($1 == access) { return $iif($readini($gfile(gatherinfo.ini),modes,access) == ON,$true,$false) }
- if ($1 == unlimpool) { return $iif($readini($gfile(gatherinfo.ini),modes,unlimpool) == ON,$true,$false) }
- if ($1 == unlimnoon) { return $iif($readini($gfile(gatherinfo.ini),modes,unlimnoon) == ON,$true,$false) }
- if ($1 == amx) { return $iif($readini($gfile(gatherinfo.ini),modes,amx) == ON,$true,$false) }
- if ($1 == stats) { return $iif($readini($gfile(gatherinfo.ini),modes,stats) == OFF,$false,$true) }
- if ($1 == overtime) { return $iif($readini($gfile(gatherinfo.ini),modes,overtime),$ifmatch,$false) }
- if ($1 == regions) { return $iif($readini($gfile(gatherinfo.ini),modes,regions),$ifmatch,$false) }
- if ($1 == adminreg) { return $iif($readini($gfile(gatherinfo.ini),modes,adminreg) == ON,$true,$false) }
- if ($1 == admingames) { return $iif($readini($gfile(gatherinfo.ini),modes,admingames) == ON,$true,$false) }
- if ($1 == topic) { return $iif($readini($gfile(gatherinfo.ini),modes,topic),$ifmatch,$false) }
- if ($1 == onlypro) { return $false }
- if ($1 == mysql) || ($1 == sql) { return $false }
- if ($1 == php.exe) { return $iif($readini($gfile(gatherinfo.ini),modes,php.exe) == ON,$true,$false) }
- if ($1 == mysql.exe) || ($1 == sql.exe) { return $iif($readini($gfile(gatherinfo.ini),modes,mysql.exe) == ON,$true,$false) }
- if ($1 == schat) { if ($ini($gfile(gatherinfo.ini),schat,0) >= 1) { return $true } | return $false }
- if ($1 == leavebans) { return $iif($readini($gfile(gatherinfo.ini),modes,leavebans) == OFF,$false,$true) }
- if ($1 == gotv) { return $iif($readini($gfile(gatherinfo.ini),modes,gotv) == ON,$true,$false) }
- if ($1 == cooldown) { return $iif($readini($gfile(gatherinfo.ini),modes,cooldown) == ON,$true,$false) }
- if ($1 == teams) { return $iif($readini($gfile(gatherinfo.ini),modes,teams) == ON,$true,$false) }
- if ($1 == maxstack) { return $iif($readini($gfile(gatherinfo.ini),modes,maxstack),$ifmatch,1) }
- if ($1 == timetojoin) { return $iif($readini($gfile(gatherinfo.ini),modes,timetojoin),$ifmatch,10) }
- if ($1 == timetoadv) { return $iif($readini($gfile(gatherinfo.ini),modes,timetoadv),$ifmatch,30) }
- if ($1 == timetoabortcl) { return $iif($readini($gfile(gatherinfo.ini),modes,timetoabortcl),$ifmatch,30) }
- if ($1 == timetoabortsg) { return $iif($readini($gfile(gatherinfo.ini),modes,timetoabortsg),$ifmatch,10) }
- if ($1 == timetoaccept) { return $iif($readini($gfile(gatherinfo.ini),modes,timetoacceptplayer),$ifmatch,1) }
- if ($1 == timetoacceptall) { return $iif($readini($gfile(gatherinfo.ini),modes,timetoacceptall),$ifmatch,2) }
- if ($1 == kickban) { return $iif($readini($gfile(gatherinfo.ini),modes,kickban),$ifmatch,0) }
- if ($1 == lameban) { return $iif($readini($gfile(gatherinfo.ini),modes,lameban),$ifmatch,0) }
- if (leaveban_* iswm $1) { return $iif($readini($gfile(gatherinfo.ini),modes,$1),$ifmatch,0) }
- if (color_* iswm $1) { return $iif($readini($gfile(gatherinfo.ini),modes,$1),$ifmatch,0) }
- if (disablecmd_* iswm $1) { return $iif($readini($gfile(gatherinfo.ini),disablecmd,$gettok($1,2,95)),$ifmatch,$false) }
- if ($1 == ftp) { var %x = $lower($2)
- var %host = $readini($gfile(gatherinfo.ini),ftp,host), %user = $readini($gfile(gatherinfo.ini),ftp,user), %pass = $readini($gfile(gatherinfo.ini),ftp,pass), %dir = $readini($gfile(gatherinfo.ini),ftp,dir), %url = $readini($gfile(gatherinfo.ini),ftp,url)
- if (%host) && (%user) && (%pass) && (%dir) && (%url) {
- if ($istok(host user pass dir url,%x,32)) { return % [ $+ [ %x ] ] }
- return %host %user %pass %dir %url
- }
- return $false
- }
- if ($ini($gfile(gatherservers.ini),$1)) { var %ip = $iif($1 isnum,$ini($gfile(gatherservers.ini),$1),$1)
- if ($2 != $null) { var %x = $iif($readini($gfile(gatherservers.ini),%ip,$2),$ifmatch,$ip) | if (*myip* iswm %x) { return $ip } | return %x }
- else {
- if ($readini($gfile(gatherservers.ini),%ip,error)) { return Error }
- if ($readini($gfile(gatherstatus.ini),info,ip) == %ip) { if ($ini($gfile(players.ini),%ip,0) < $readini($gfile(gatherstatus.ini),%ip,slots)) { if ($gatherstatus(accept)) { return Accept } | return Signup } | else { return Sending_Info } }
- if (($sock($+($srcon.prefix,%ip))) && ($readini($gfile(gatherstatus.ini),%ip,map))) || (($readini($gfile(gatherstatus.ini),%ip,gatheradmin)) && ($readini($gfile(gatherstatus.ini),%ip,start_time))) { if (%gatherpause. [ $+ [ %ip ] ]) { return Paused } | if (%gatherhold. [ $+ [ %ip ] ]) { return Round_End } | return $iif($readini($gfile(gatherservers.ini),%ip,status),$ifmatch,Connected) }
- if ($readini($gfile(gatherservers.ini),%ip,offline)) { return Offline }
- if ($readini($gfile(gatherservers.ini),%ip,cooldown) > $ctime) { return Cooldown }
- return Free
- }
- }
- return 0
- }
- alias gatherstatus {
- var %ip = $iif($readini($gfile(gatherstatus.ini),info,ip),$ifmatch,0) | if ($1 == ip) { return %ip }
- elseif ($1 == signup) || ($1 == sign) {
- if (%ip != 0) && (!$readini($gfile(gatherstatus.ini),%ip,accept)) {
- if ($ini($gfile(players.ini),%ip,0) < $readini($gfile(gatherstatus.ini),%ip,slots)) { return %ip }
- if (($readini($gfile(gatherstatus.ini),%ip,type) == Challenge) && (!$readini($gfile(gatherstatus.ini),%ip,clstatus)) && (($unlim(pool,%ip)) || ($unlim(noon)))) { return %ip }
- }
- return $false
- }
- elseif ($1 == signout) || ($1 == out) {
- if (%ip != 0) && (!$readini($gfile(gatherstatus.ini),%ip,accept)) {
- if ($ini($gfile(players.ini),%ip,0) < $readini($gfile(gatherstatus.ini),%ip,slots)) { return %ip }
- if ($readini($gfile(gatherstatus.ini),%ip,type) == Challenge) && (!$readini($gfile(gatherstatus.ini),%ip,clstatus)) { return %ip }
- }
- return $false
- }
- elseif ($1 == pick) { if (%ip != 0) && ($readini($gfile(gatherstatus.ini),%ip,type) == Challenge) && ($readini($gfile(gatherstatus.ini),%ip,clstatus) == Picking) || ((!$unlim(pool,%ip)) && (!$unlim(noon)) && ($ini($gfile(players.ini),%ip,0) == $readini($gfile(gatherstatus.ini),%ip,slots))) { return %ip } | return $false }
- elseif ($1 == accept) {
- if (%challenge) { var %x = $ifmatch, %accept = $gettok(%x,2,32) | return %accept }
- if (%ip != 0) && ($readini($gfile(gatherstatus.ini),%ip,accept)) { return $ifmatch } | return $false
- }
- elseif ($1 == teamgame) { if (%ip != 0) && ($readini($gfile(gatherstatus.ini),%ip,type) == TeamGame) { return %ip } | return $false }
- elseif ($1 == chan) { return $iif($readini($gfile(gatherstatus.ini),chan,$2),$ifmatch,0) }
- elseif ($2 == slots) { return $iif($readini($gfile(gatherstatus.ini),$1,slots),$ifmatch,0) }
- elseif ($2 == type) { return $iif($readini($gfile(gatherstatus.ini),$1,type),$ifmatch,0) }
- elseif ($2 == admin) || ($1 == gatheradmin) { return $iif($readini($gfile(gatherstatus.ini),$1,gatheradmin),$ifmatch,0) }
- elseif ($2 == cl) || ($1 == challenger) { return $iif($readini($gfile(gatherstatus.ini),$1,challenger),$ifmatch,0) }
- elseif ($2 == cl2) || ($1 == challenged) { return $iif($readini($gfile(gatherstatus.ini),$1,challenged),$ifmatch,0) }
- elseif ($2 == map) { return $iif($readini($gfile(gatherstatus.ini),$1,map),$ifmatch,0) }
- elseif ($2 == accept) { return $iif($readini($gfile(gatherstatus.ini),$1,accept),$ifmatch,0) }
- elseif ($2 == added) { return $ini($gfile(players.ini),$1,0) }
- elseif ($2 == region) { return $iif($readini($gfile(gatherservers.ini),$1,region),$ifmatch,n/a) }
- elseif ($1 == start) {
- var %gfile = $gfile(gatherservers.ini)
- if ($2) && ($gatherinfo(regions)) {
- var %regions = $ifmatch, %i = 1, %priorities, %nopriority | while (%i <= $ini(%gfile,0)) {
- var %ip = $ini(%gfile,%i), %region = $readini(%gfile,%ip,region), %priority = $readini(%gfile,%ip,priority)
- if ($serverstatus(%ip,clean) == Free) && ((%region == $2) || (%region iswm $2)) {
- if (%priority isnum) { var %priorities = $addtok(%priorities,%priority,32), %priority. [ $+ [ %priority ] ] %priority. [ $+ [ %priority ] ] %ip }
- else { var %nopriority = %nopriority %ip }
- }
- inc %i
- }
- if (%priorities) {
- var %priorities = $sorttok(%priorities,32), %nr = $gettok(%priorities,1,32), %numtok = $numtok(%priority. [ $+ [ %nr ] ],32), %rand = $rand(1,%numtok)
- return $gettok(%priority. [ $+ [ %nr ] ],%rand,32)
- }
- elseif (%nopriority) { var %numtok = $numtok(%nopriority,32), %rand = $rand(1,%numtok) | return $gettok(%nopriority,%rand,32) }
- return $false
- }
- else {
- if (old == new) {
- var %i = 1 | while (%i <= $ini($gfile(gatherservers.ini),0)) { var %ip = $ini($gfile(gatherservers.ini),%i) | if ($serverstatus(%ip,clean) == Free) { return %ip } | inc %i } | return $false
- }
- var %i = 1, %priorities, %nopriority | while (%i <= $ini(%gfile,0)) {
- var %ip = $ini(%gfile,%i), %priority = $readini(%gfile,%ip,priority)
- if ($serverstatus(%ip,clean) == Free) {
- if (%priority isnum) { var %priorities = $addtok(%priorities,%priority,32), %priority. [ $+ [ %priority ] ] %priority. [ $+ [ %priority ] ] %ip }
- else { var %nopriority = %nopriority %ip }
- }
- inc %i
- }
- if (%priorities) {
- var %priorities = $sorttok(%priorities,32), %nr = $gettok(%priorities,1,32), %numtok = $numtok(%priority. [ $+ [ %nr ] ],32), %rand = $rand(1,%numtok)
- return $gettok(%priority. [ $+ [ %nr ] ],%rand,32)
- }
- elseif (%nopriority) { var %numtok = $numtok(%nopriority,32), %rand = $rand(1,%numtok) | return $gettok(%nopriority,%rand,32) }
- return $false
- }
- }
- elseif ($1 == sub) { var %i = 1 | while (%i <= $ini($gfile(gatherservers.ini),0)) { if ($serverstatus(%i,sub)) { return $ini($gfile(gatherservers.ini),%i) } | inc %i } | return $false }
- elseif ($1 == servers) {
- var %i = 1, %servers = $null | while (%i <= $ini($gfile(gatherservers.ini),0)) { var %status = $serverstatus($ini($gfile(gatherservers.ini),%i)), %servers = $iif(%servers,$ifmatch $logo) $+($chr(35),%i,$chr(58)) $iif($serverstatus(%i,clean) == Free && $gatherinfo(regions), $+(%status,$col(14,$chr(40)),$readini($gfile(gatherservers.ini),$ini($gfile(gatherservers.ini),%i),region),$col(14,$chr(41))), %status) | inc %i }
- return $iif(%servers,$ifmatch,There is no server added)
- }
- elseif ($1 == topic) {
- var %i = 1, %n = 2, %ga = $iif($readini($gfile(gatherstatus.ini),%ip,gatheradmin),$ifmatch,0), %gauth = $gauth(%ga), %p = $null, %type = $readini($gfile(gatherstatus.ini),%ip,type), %region = $readini($gfile(gatherstatus.ini),%ip,region)
- if (%challenge) {
- var %x = $ifmatch, %cl = $gettok(%x,1,32), %accept = $gettok(%x,2,32), %ip = $gettok(%x,3,32), %map = $gettok(%x,4,32), %region = $readini($gfile(gatherstatus.ini),%ip,region)
- var %x = $timer(challenge).reps, %d = $timer(challenge).delay, %s = $timer(challenge).secs, %t = $iif(%x > 1,$calc((%x -1) * %d + %s),%s)
- return $anick(%cl) has challenged $iif(%accept == All,You?,$anick(%accept) $+ ) for a 1v1 $iif($gatherinfo(regions),$split Region: $+(,%region,)) $split Map: $iif(%map,$ifmatch,0) $+ $logo $iif(%accept == All,Anyone can use .accept ,Use .accept or .reject) $col(14,$chr(40)) $+ $duration(%t) $+ $col(14,$chr(41)) $logo
- }
- if (%type == Challenge) {
- var %cl = $readini($gfile(gatherstatus.ini),%ip,challenger), %cla = $gauth(%cl), %cl2 = $readini($gfile(gatherstatus.ini),%ip,challenged), %cl2a = $gauth(%cl2), %accept = $readini($gfile(gatherstatus.ini),%ip,accept), %n = 3, %p
- if (%accept) {
- var %accept = $ifmatch, %x = $timer(challenge).reps, %d = $timer(challenge).delay, %s = $timer(challenge).secs, %t = $iif(%x > 1,$calc((%x -1) * %d + %s),%s)
- return $anick(%cla) has challenged $iif(%accept == All,You?,$anick(%accept) $+ ) $iif($gatherinfo(regions),$split Region: $+(,%region,)) $split Map: $iif($readini($gfile(gatherstatus.ini),%ip,map),$ifmatch,0) $+ $logo $iif(%accept == All,Anyone can use .accept ,Use .accept or .reject) $col(14,$chr(40)) $+ $duration(%t) $+ $col(14,$chr(41)) $logo
- }
- var %players = $ini($gfile(players.ini),%ip,0), %slots = $iif($readini($gfile(gatherstatus.ini),%ip,slots),$ifmatch,10), %p = $+($anick(%cl),$chr(44)) $anick(%cl2)
- while (%i <= $ini($gfile(players.ini),%ip,0)) { var %x = $ini($gfile(players.ini),%ip,%i) | if (%x != %cl) && (%x != %cl2) { var %p = $iif(%p,$+(%p,$chr(44))) $anick(%x) | inc %n } | inc %i }
- return $iif($gatherinfo(regions), Region: $+(,%region,) $split) Map: $iif($readini($gfile(gatherstatus.ini),%ip,map),$ifmatch,0) $logo Players: %p $iif(($unlim(pool)) || (($unlim(noon)) && ($time < 12)),$+($chr(40),$iif(%players >= %slots,$col(09,%players),$col(04,%players)),$chr(41)),$+($chr(40),%players,/,%slots,$chr(41)))
- }
- else {
- var %p = $anick(%ga) | while (%i <= $ini($gfile(players.ini),%ip,0)) { var %x = $ini($gfile(players.ini),%ip,%i) | if (%x != %ga) { var %p = $iif(%p,$+(%p,$chr(44))) $anick(%x) | inc %n } | inc %i }
- return $iif($gatherinfo(regions), Region: $+(,%region,) $split) Map: $iif($readini($gfile(gatherstatus.ini),%ip,map),$ifmatch,0) $logo Players: %p $split ( $+ $ini($gfile(players.ini),%ip,0) $+ / $+ $iif($readini($gfile(gatherstatus.ini),%ip,slots),$ifmatch,10) $+ )
- }
- }
- elseif ($ini($gfile(gatherservers.ini),$1)) { var %ip = $iif($1 isnum,$ini($gfile(gatherservers.ini),$1),$1)
- if ($2 != $null) {
- if ($2 == status) && ($gettok(%challenge,3,32) == %ip) { return Accept }
- return $iif($readini($gfile(gatherstatus.ini),%ip,$2),$ifmatch,0)
- }
- else {
- if ($readini($gfile(gatherservers.ini),%ip,error)) { return Error }
- if ($gettok(%challenge,3,32) == %ip) { return Accept }
- if ($readini($gfile(gatherstatus.ini),info,ip) == %ip) {
- if ($ini($gfile(players.ini),%ip,0) < $readini($gfile(gatherstatus.ini),%ip,slots)) {
- if ($readini($gfile(gatherstatus.ini),%ip,accept)) { return Accept } | return Signup
- }
- elseif (($unlim(pool,%ip)) || ($unlim(noon))) && (!$readini($gfile(gatherstatus.ini),%ip,clstatus)) { return Signup }
- elseif ($readini($gfile(gatherstatus.ini),%ip,picker)) && ($readini($gfile(gatherstatus.ini),%ip,clstatus) != Closed) { return $iif($readini($gfile(gatherstatus.ini),%ip,clstatus),$ifmatch,Picking) }
- else { return Sending_Info }
- }
- if (($sock($+($srcon.prefix,%ip))) && ($readini($gfile(gatherstatus.ini),%ip,map))) || (($readini($gfile(gatherstatus.ini),%ip,gatheradmin)) && ($readini($gfile(gatherstatus.ini),%ip,start_time))) {
- if ($readini($gfile(gatherstatus.ini),%ip,error)) { return Started } | if (%gatherpause. [ $+ [ %ip ] ]) { return Paused } | if (%gatherhold. [ $+ [ %ip ] ]) { return Round_End } | return $iif($readini($gfile(gatherservers.ini),%ip,status),$ifmatch,Connected)
- }
- if ($readini($gfile(gatherservers.ini),%ip,offline)) { return Offline }
- if ($readini($gfile(gatherservers.ini),%ip,cooldown) > $ctime) { return Cooldown }
- return Free
- }
- }
- return Error
- }
- alias serverstatus {
- if ($ini($gfile(gatherservers.ini),$1)) {
- var %ip = $iif($1 isnum,$ini($gfile(gatherservers.ini),$1),$1), %status = $gatherstatus(%ip), %error
- if ($2 == clean) { return $iif(%status,$ifmatch,Error) }
- if ($2 == ingame) {
- if ($readini($gfile(gatherstatus.ini),%ip,gatheradmin)) && ($readini($gfile(gatherstatus.ini),%ip,start_time)) && ($readini($gfile(gatherservers.ini),%ip,status) != Ended) {
- if ($readini($gfile(gatherstatus.ini),%ip,error)) { return Started }
- if (%gatherpause. [ $+ [ %ip ] ]) { return Paused } | if (%gatherhold. [ $+ [ $1 ] ]) { return Round_End } | return $iif($readini($gfile(gatherservers.ini),%ip,status),$ifmatch,Connecting)
- }
- return $false
- }
- if ($2 == sub) {
- if (($readini($gfile(gatherstatus.ini),%ip,t_subs)) || ($readini($gfile(gatherstatus.ini),%ip,ct_subs))) {
- if (%status != Error) && (%status != Offline) && (%status != Signup) && (%status != Free) && (%status != Ended) { return %ip }
- }
- if ($timer(submsg. [ $+ [ %ip ] ])) { .timersubmsg. [ $+ [ %ip ] ] off } | return $false
- }
- if ($readini($gfile(gatherservers.ini),%ip,error)) { var %x = $ifmatch | return $col(04,Error) $+ $col(14,$chr(40)) $+ %x $+ $col(14,$chr(41)) }
- if ($gettok(%challenge,3,32) == %ip) { var %x = $ifmatch, %cl = $gettok(%x,1,32), %accept = $gettok(%x,2,32)
- return $col(07,Accept) $+ $col(14,$chr(40)) $+ $anick(%cl) $+ '1vs1' $+ $iif(%accept == All,You?,$anick(%accept)) $+ $col(14,$chr(41))
- }
- if ($readini($gfile(gatherstatus.ini),info,ip) == %ip) { var %type = $gatherstatus(%ip,type), %players = $ini($gfile(players.ini),%ip,0), %slots = $gatherstatus(%ip,slots)
- if ($ini($gfile(players.ini),%ip,0) < $readini($gfile(gatherstatus.ini),%ip,slots)) {
- if ($gatherstatus(accept)) { var %accept = $ifmatch, %cl = $readini($gfile(gatherstatus.ini),%ip,challenger) | return $col(07,Accept) $+ $col(14,$chr(40)) $+ $anick(%cl) $+ 'vs' $+ $iif(%accept == All,You?,$anick(%accept)) $+ $col(14,$chr(41)) }
- if ($gatherstatus(%ip,type) == BRush) { var %x = $col(07,BRush-Signup) } | else { var %x = $col(07,Signup) }
- }
- elseif (($unlim(pool,%ip)) || ($unlim(noon))) && (!$readini($gfile(gatherstatus.ini),%ip,clstatus)) { var %x = $col(09,Signup) }
- elseif ($readini($gfile(gatherstatus.ini),%ip,picker)) && ($readini($gfile(gatherstatus.ini),%ip,clstatus) != Closed) { var %x = $col(09,$iif($readini($gfile(gatherstatus.ini),%ip,clstatus),$ifmatch,Picking)) } | else { var %x = $col(09,Sending_Info) }
- return %x $+ $col(14,$chr(40)) $+ $+($col(14,$readini($gfile(gatherstatus.ini),%ip,map)),$col(14,$chr(91)),$iif((%type == Challenge) && (($unlim(pool)) || (($unlim(noon)) && ($time < 12))),$+($iif(%players >= %slots,$col(09,%players),$col(04,%players))),$+(%players,/,%slots)),$col(14,$chr(93))) $+ $col(14,$chr(41))
- }
- if (($sock($+($srcon.prefix,%ip))) && ($readini($gfile(gatherstatus.ini),%ip,map))) || (($readini($gfile(gatherstatus.ini),%ip,gatheradmin)) && ($readini($gfile(gatherstatus.ini),%ip,start_time))) {
- if ($readini($gfile(gatherstatus.ini),%ip,error)) { var %x = $col(04,Started), %error = $true } | elseif (%gatherpause. [ $+ [ %ip ] ]) { var %x = $col(04,Paused) }
- elseif (%gatherhold. [ $+ [ $1 ] ]) { var %x = $col(04,Round_End) } | else { var %x = $col(04,$iif($readini($gfile(gatherservers.ini),%ip,status),$ifmatch,Connected)) }
- if (%error) {
- var %ctime = $duration($calc($ctime - $ctime($readini($gfile(gatherstatus.ini),%ip,start_time))))
- return $+(%x,$col(14,$chr(40)),$col(14,$readini($gfile(gatherstatus.ini),%ip,map)),$col(14,$chr(91)),%ctime,$col(14,$chr(93)),$col(14,$chr(41)))
- }
- else {
- return $+(%x,$col(14,$chr(40)),$col(14,$readini($gfile(gatherstatus.ini),%ip,map)),$col(14,$chr(91)),,$col(11,$score(%ip,ct)),,$col(14,-),,$col(04,$score(%ip,t)),,$col(14,$chr(93)),$col(14,$chr(41)))
- }
- return %x $+ $col(14,$chr(40)) $+ $col(14,$readini($gfile(gatherstatus.ini),%ip,map)) $+ $iif(!%error,$+($col(14,$chr(91)),,$col(11,$score(%ip,ct)),,$col(14,-),,$col(04,$score(%ip,t)),,$col(14,$chr(93)))) $+ $col(14,$chr(41))
- }
- if ($readini($gfile(gatherservers.ini),%ip,offline)) { var %x = $ifmatch | return $col(04,Offline) $+ $iif(%x != n/a,$col(14,$chr(40)) $+ %x $+ $col(14,$chr(41))) }
- if ($readini($gfile(gatherservers.ini),%ip,cooldown) > $ctime) {
- var %x = $readini($gfile(gatherservers.ini),%ip,cooldown), %t = $calc(%x - $ctime)
- return $col(04,Cooldown) $+ $col(14,$chr(40)) $+ $duration(%t) $+ $col(14,$chr(41))
- }
- if ($readini($gfile(gatherservers.ini),%ip,name)) { var %x = $ifmatch | return $col(09,Free) $+ $iif(%x != n/a,$col(14,$chr(40)) $+ %x $+ $col(14,$chr(41))) }
- return $col(09,Free)
- }
- return $iif($2 != clean,$iif($2 == sub,$false,$+($col(04,Error),$col(14,$chr(40)),Missing IP,$col(14,$chr(41)))),Error)
- }
- alias settopic {
- if (!$gatherinfo(topic)) || ($me !isop $mainchan) { return }
- var %topic = $c_text($me,$gatherinfo(topic))
- if ($gatherstatus(signup)) {
- var %ip = $ifmatch
- if ($gatherstatus(%ip,type) == Challenge) {
- var %cl = $gauth($readini($gfile(gatherstatus.ini),%ip,challenger)), %cl2 = $gauth($readini($gfile(gatherstatus.ini),%ip,challenged))
- var %topic = $col(start) $+ %topic $split Signup is open at the moment, $+(,%cl,) and $+(,%cl2,) are the leaders
- }
- else { var %topic = $col(start) $+ %topic $split Signup is open at the moment }
- if ($chan($mainchan).topic != %topic) { topic $mainchan %topic }
- return
- }
- var %i = 1, %progress = 0 | while ($serverid(get,%i)) { var %ip = $ifmatch | if ($serverinuse(%ip)) { inc %progress } | inc %i }
- if (%progress > 0) { var %topic = $col(start) $+ %topic $split Games in progress: $+(,%progress,) }
- if ($chan($mainchan).topic != %topic) { topic $mainchan %topic }
- }
- alias userdata { if ($gsteamid($1)) { var %steamid = $ifmatch, %gfile = $gfile(userdata.ini) | return $iif($readini(%gfile,%steamid,$2),$ifmatch,n/a) } | return n/a }
- alias gatherstats { var %gfile = $gfile(gatherstats.ini), %x = $iif($readini(%gfile,$1,$2),$ifmatch,$iif($2 == points,1000,0)) | return $iif($2 == points,$round(%x,2),%x) }
- alias clutchstats { var %gfile = $gfile(clutchstats.ini) | return $iif($readini(%gfile,$1,$2),$ifmatch,0) }
- alias cstats { var %gfile = $gfile(clutchstats.ini) | return $iif($readini(%gfile,$1,$2),$ifmatch,0) }
- alias hitstats { var %gfile = $gfile(hitstats.ini) | return $iif($readini(%gfile,$1,$2),$ifmatch,0) }
- alias wepstats { var %gfile = $gfile(wepstats.ini) | return $iif($readini(%gfile,$1,$2),$ifmatch,0) }
- alias teamstats { var %gfile = $gfile(teamstats.ini), %x = $iif($readini(%gfile,$1,$2),$ifmatch,$iif($2 == points,1000,0)) | return $iif($2 == points,$round(%x,2),%x) }
- #################################### ON KICK/PART/QUIT/NICK part ##########################################
- alias onjoin { set -u5 %startflood 1 | flood 250 10 3 10 | write -c $gfile(authed.dat) | whatcmd who $iif($1,$1,$iif($chan,$chan,$mainchan)) n%na | .timeronjoin off }
- alias onstart { setmynick | .timer 1 0.5 myip | .timer 1 2 refresh }
- alias refresh {
- if ($1 != 0) && ($ini($gfile(gatherservers.ini),$1)) { var %ip = $iif($1 isnum,$ini($gfile(gatherservers.ini),$1),$1), %status = $gatherstatus(%ip) | if ($serverstatus(%ip,ingame)) && (%status != Ended) { remini -n $gfile(gatherstatus.ini) %ip error | challenge %ip | return %ip } | return $false }
- var %i = 1, %x = 0 | while ($ini($gfile(gatherservers.ini),%i)) { var %ip = $ifmatch, %status = $gatherstatus(%ip) | if ($serverstatus(%ip,ingame)) && (%status != Ended) { remini -n $gfile(gatherstatus.ini) %ip error | .timerrecheck. [ $+ [ $1 ] ] 1 %x rechecksocket %ip | inc %x 0.5 } | inc %i }
- }
- on *:INVITE:#:{
- if ($nick != $Qbot) && ($Qhidden !iswm $address($me,2)) { return }
- if ($istok($mainchan $privchan $ownerchan,$chan,32)) { whatcmd raw join $chan }
- }
- on *:DISCONNECT:{ ;.timerconnect -o 1 60 server irc.quakenet.org:6667 | .timerc.* off }
- on *:START:{ onstart }
- on *:CONNECT:{
- if ($timer(connect)) { .timerconnect off }
- if ($window(@glist)) { clear @glist }
- if ($me ison $mainchan) { .timeronjoin 1 10 onjoin }
- write -c $gfile(authed.dat) | unset %tmp.* | set -u30 %tmp.antiflood 1 | .timer 1 0 rload | .timer 1 1 refresh | .timer 1 2 checktimers | .timerc.1 1 5 .authing
- }
- on *:NICK:{
- if ($nick == $me) && ($network == Aitvaras || $network == GRNet) {
- if ($newnick == $mynick) { authing } | else { if (!$timer(mynick)) { .timermynick 1 60 setmynick } }
- }
- if ($read($gfile(authed.dat),s,$nick)) { var %ifmatch = $ifmatch | write -l $+ $readn $gfile(authed.dat) $newnick %ifmatch }
- if ($nick ison $mainchan) { logchan ? Nick: $nick is now known as $newnick }
- }
- on *:JOIN:$($mainchan):{
- if ($nick == $me) && ($Qhidden !iswm $address($me,2)) && ($network != Aitvaras && $network != GRNet) { join #0,0 | return }
- if (!%startflood) {
- if ($nick != $me) && ($nick != $Qbot) && ($nick != S) { var %addr = $address($nick,2), %auth = $gettok($gettok(%addr,2,64),1,46)
- if ($Qaddr iswm %addr) { reguser $nick $iif(%auth,$ifmatch,0) } | elseif (!%joinflood) { set -u1 %joinflood 1 | whatcmd who $nick n%na }
- }
- elseif ($nick == $me) { onjoin $chan }
- }
- elseif ($nick == $me) { onjoin $chan }
- logchan ? Join: $nick ( $+ $address($nick,1) $+ )
- }
- on ^*:JOIN:$($privchan):{
- if ($nick == $me) && ($Qhidden !iswm $address($me,2)) && ($network != Aitvaras && $network != GRNet) { join #0,0 | return }
- if ($chan != $mainchan) && ($me isop $chan) && ($nick != $me) && ($nick != $Qbot) && ($nick != S) {
- var %addr = $address($nick,2), %auth = $gettok($gettok(%addr,2,64),1,46)
- if ($gauth($nick)) { var %auth = $ifmatch
- if ($admin($+($chr(35),%auth)) >= 7) { .timer 1 1 $iif($script(pushmode.mrc),pushmode -l,putmode) $chan +o $nick }
- ;else { ban -ku30 $chan $nick 1 $logo You are not allowed to join this channel $split Reason: You're not an admin! $logo }
- }
- elseif ($Qaddr iswm %addr) && (%auth) {
- if ($admin($+($chr(35),%auth)) >= 7) { reguser $nick %auth | .timer 1 1 $iif($script(pushmode.mrc),pushmode -l,putmode) $chan +o $nick }
- ;else { ban -ku30 $chan $nick 1 $logo You are not allowed to join this channel $split Reason: You're not an admin! $logo }
- }
- ;else { ban -ku30 $chan $nick 1 $logo You are not allowed to join this channel $split Reason: You're not authed! $logo }
- }
- }
- on *:KICK:$($mainchan):{ remfromgather $knick
- if ($knick != $me) && ($read($gfile(authed.dat),s,$knick)) { var %s = $gettok($ifmatch,2,32) | write -ds $+ $knick $gfile(authed.dat) | if (%s) { writeini -n $gfile(userdata.ini) %s lastnick $knick } }
- }
- on *:PART:$($mainchan):{ remfromgather $nick
- if ($nick != $me) && ($read($gfile(authed.dat),s,$nick)) { var %s = $gettok($ifmatch,2,32) | write -ds $+ $nick $gfile(authed.dat) | if (%s) { writeini -n $gfile(userdata.ini) %s lastnick $nick } }
- }
- on *:QUIT:{
- if ($1 != Registered) { remfromgather $nick
- if ($nick != $me) && ($read($gfile(authed.dat),s,$nick)) { var %s = $gettok($ifmatch,2,32) | write -ds $+ $nick $gfile(authed.dat) | if (%s) { writeini -n $gfile(userdata.ini) %s lastnick $nick } }
- }
- }
- alias findnewadmin {
- var %ip = $1, %ga = $gatherstatus(%ip,gatheradmin), %i = 1 | while (%i <= $ini($gfile(players.ini),%ip,0)) {
- var %newadmin = $ini($gfile(players.ini),%ip,%i), %auth = $gauth(%newadmin) | if (%ga != %newadmin) && ($admin($+($chr(35),%auth)) >= 8) { return %newadmin 8 } | inc %i
- }
- return $iif($ini($gfile(players.ini),%ip,1),$ifmatch,:gatherbot:)
- }
- alias remfromgather {
- if ($gatherstatus(signout)) && ($gsteamid($1)) { var %steamid = $ifmatch, %ip = $gatherstatus(ip)
- if ($readini($gfile(players.ini),%ip,%steamid)) { var %type = $gatherstatus(%ip,type), %ga = $gatherstatus(%ip,gatheradmin), %added = $gatherstatus(%ip,added)
- if (%type == Challenge) && ((%steamid == $gatherstatus(%ip,challenger)) || (%steamid == $gatherstatus(%ip,challenged))) {
- resetall %ip | whatcmd settopic | .timeradded 1 0 whatcmd $meorsay $iif($me ison $2,$2,$mainchan) $logo $anick($1) $iif($iif($me ison $2,$3-,$2-),$ifmatch,left the channel) $+ , the gather is therefore stopped $logo | .timerendsignup off
- }
- elseif (%added > 1) {
- if (%added < $gatherstatus(%ip,slots)) || ((%type == Challenge) && (!$gatherstatus(%ip,clstatus))) { remini -n $gfile(players.ini) %ip %steamid | endsigntimer %type
- if ($readini($gfile(gatherstatus.ini),%ip,picker)) { remini -n $gfile(gatherstatus.ini) %ip picker }
- if ($istack(%ip,%steamid)) { var %stack = $ifmatch | remini -n $gfile(stacks.ini) %ip %stack }
- if (%ga == %steamid) {
- var %new = $findnewadmin(%ip), %newga = $gettok(%new,1,32), %level = $gettok(%new,2,32) | writeini -n $gfile(gatherstatus.ini) %ip gatheradmin %newga
- if (%level < 8) && (%type != Challenge) { writeini -n $gfile(gatherstatus.ini) %ip type Public | var %type = Public }
- elseif (%level >= 8) && (%type == Public) { writeini -n $gfile(gatherstatus.ini) %ip type Admin | var %type = Admin }
- }
- }
- }
- else { resetall %ip | whatcmd settopic | .timeradded 1 0 whatcmd $meorsay $iif($me ison $2,$2,$mainchan) $logo $anick($1) $iif($iif($me ison $2,$3-,$2-),$ifmatch,left the channel) $+ , the gather is therefore stopped $logo | .timerendsignup off }
- }
- }
- }
- ;#################################### Alias to get nick/auth/steamid/admin level ##########################################;
- alias isonchans {
- if ($1 ison $chan) || ($1 ison $mainchan) || ($1 ison $privchan) || ($1 ison $ownerchan) || ($comchan($1,0)) { return $true }
- return $false
- }
- alias cleanit { return $strip($remove($1-,$chr(35),$chr(63),$chr(42))) }
- alias cleanit2 { return $strip($remove($1-,$chr(63),$chr(42))) }
- alias ginfo {
- if ($gauth($1)) { var %a = $ifmatch, %n = $colnick($+($chr(35),%a)), %s = $gsteamid($+($chr(35),%a)) | return %n %a %s }
- return 0
- }
- alias colnick {
- var %who = $cleanit($1), %nick, %auth
- if (!%who) { return 0 }
- if ($1 == :me:) || ($1 == :gatherbot:) || ($1 == $me) { return $me }
- if ($left($1,1) == $chr(35)) {
- if ($read($gfile(authed.dat),w,* %who *)) { var %nick = $gettok($ifmatch,1,32), %auth = $gettok($ifmatch,2,32), %id = $gettok($ifmatch,3,32) | goto next }
- if ($read($gfile(gatherusers.dat),w,%who *)) { var %auth = $gettok($ifmatch,1,32), %id = $gettok($ifmatch,2,32) | goto next }
- return $+($chr(35),%who)
- }
- if (STEAM_*:*:* iswm %who) {
- if ($read($gfile(authed.dat),w,* %who)) { var %nick = $gettok($ifmatch,1,32), %auth = $gettok($ifmatch,2,32), %id = $gettok($ifmatch,3,32) | goto next }
- if ($read($gfile(gatherusers.dat),w,* %who)) { var %auth = $gettok($ifmatch,1,32), %id = $gettok($ifmatch,2,32) | goto next }
- return %who
- }
- if ($read($gfile(authed.dat),w,%who *)) { var %nick = $gettok($ifmatch,1,32), %auth = $gettok($ifmatch,2,32), %id = $gettok($ifmatch,3,32) | goto next }
- if ($isonchans(%who)) { return %who }
- if ($read($gfile(authed.dat),w,* %who)) { var %nick = $gettok($ifmatch,1,32), %auth = $gettok($ifmatch,2,32), %id = $gettok($ifmatch,3,32) | goto next }
- if ($read($gfile(authed.dat),w,* %who *)) { var %nick = $gettok($ifmatch,1,32), %auth = $gettok($ifmatch,2,32), %id = $gettok($ifmatch,3,32) | goto next }
- if ($read($gfile(gatherusers.dat),w,%who *)) { var %auth = $gettok($ifmatch,1,32), %id = $gettok($ifmatch,2,32) | goto next }
- if ($read($gfile(gatherusers.dat),w,* %who)) { var %auth = $gettok($ifmatch,1,32), %id = $gettok($ifmatch,2,32) | goto next }
- return 0
- :next
- if (%auth) {
- if (!%nick) { var %n = $readini($gfile(userdata.ini),%id,lastnick), %nick = $iif(%n,%n,$+($chr(35),%auth)) }
- if ($admin($+($chr(35),%auth))) { var %level = $ifmatch | return $col($admincol(%level),%nick) }
- return %nick
- }
- return %who
- }
- alias anick {
- var %who = $cleanit($1), %nick, %auth
- if (!%who) { return 0 }
- if ($1 == :me:) || ($1 == :gatherbot:) || ($1 == $me) { return $me }
- if ($left($1,1) == $chr(35)) {
- if ($read($gfile(authed.dat),w,* %who *)) { var %nick = $gettok($ifmatch,1,32), %auth = $gettok($ifmatch,2,32), %id = $gettok($ifmatch,3,32) | goto next }
- if ($read($gfile(gatherusers.dat),w,%who *)) { var %auth = $gettok($ifmatch,1,32), %id = $gettok($ifmatch,2,32) | goto next }
- return $+($chr(35),%who)
- }
- if (STEAM_*:*:* iswm %who) {
- if ($read($gfile(authed.dat),w,* %who)) { var %nick = $gettok($ifmatch,1,32), %auth = $gettok($ifmatch,2,32), %id = $gettok($ifmatch,3,32) | goto next }
- if ($read($gfile(gatherusers.dat),w,* %who)) { var %auth = $gettok($ifmatch,1,32), %id = $gettok($ifmatch,2,32) | goto next }
- return %who
- }
- if ($read($gfile(authed.dat),w,%who *)) { var %nick = $gettok($ifmatch,1,32), %auth = $gettok($ifmatch,2,32), %id = $gettok($ifmatch,3,32) | goto next }
- if ($isonchans(%who)) { return %who }
- if ($read($gfile(authed.dat),w,* %who)) { var %nick = $gettok($ifmatch,1,32), %auth = $gettok($ifmatch,2,32), %id = $gettok($ifmatch,3,32) | goto next }
- if ($read($gfile(authed.dat),w,* %who *)) { var %nick = $gettok($ifmatch,1,32), %auth = $gettok($ifmatch,2,32), %id = $gettok($ifmatch,3,32) | goto next }
- if ($read($gfile(gatherusers.dat),w,%who *)) { var %auth = $gettok($ifmatch,1,32), %id = $gettok($ifmatch,2,32) | goto next }
- if ($read($gfile(gatherusers.dat),w,* %who)) { var %auth = $gettok($ifmatch,1,32), %id = $gettok($ifmatch,2,32) | goto next }
- return 0
- :next
- if (%auth) {
- if (!%nick) { var %n = $readini($gfile(userdata.ini),%id,lastnick), %nick = $iif(%n,$iif(%n != %auth,$+(%n,$col(05,$chr(91)),%auth,$col(05,$chr(93))),%n),$+($chr(35),%auth)) }
- if ($adminonly($+($chr(35),%auth))) { var %level = $ifmatch | return $col($admincol(%level),%nick) }
- return %nick
- }
- return %who
- }
- alias gnick {
- var %who = $cleanit($1)
- if (!%who) { return 0 }
- if ($1 == :me:) || ($1 == :gatherbot:) || ($1 == $me) { return $me }
- if ($left($1,1) == $chr(35)) {
- if ($read($gfile(authed.dat),w,* %who *)) { return $gettok($ifmatch,1,32) }
- if ($read($gfile(gatherusers.dat),w,%who *)) { var %auth = $gettok($ifmatch,1,32), %id = $gettok($ifmatch,2,32) | goto next }
- return $+($chr(35),%who)
- }
- if (STEAM_*:*:* iswm %who) {
- if ($read($gfile(authed.dat),w,* %who)) { return $gettok($ifmatch,1,32) }
- if ($read($gfile(gatherusers.dat),w,* %who)) { var %auth = $gettok($ifmatch,1,32), %id = $gettok($ifmatch,2,32) | goto next }
- return %who
- }
- if ($read($gfile(authed.dat),w,%who *)) { return $gettok($ifmatch,1,32) }
- if ($isonchans(%who)) { return %who }
- if ($read($gfile(authed.dat),w,* %who)) { return $gettok($ifmatch,1,32) }
- if ($read($gfile(authed.dat),w,* %who *)) { return $gettok($ifmatch,1,32) }
- if ($read($gfile(gatherusers.dat),w,%who *)) { var %auth = $gettok($ifmatch,1,32), %id = $gettok($ifmatch,2,32) | goto next }
- if ($read($gfile(gatherusers.dat),w,* %who)) { var %auth = $gettok($ifmatch,1,32), %id = $gettok($ifmatch,2,32) | goto next }
- return 0
- :next
- return $iif($readini($gfile(userdata.ini),%id,lastnick),$ifmatch,$iif(%auth,$+($chr(35),%auth),0))
- }
- alias gauth {
- var %who = $cleanit($1)
- if (!%who) { return 0 }
- if ($1 == :me:) || ($1 == :gatherbot:) || ($1 == $me) { return $me }
- if ($left($1,1) == $chr(35)) {
- if ($read($gfile(gatherusers.dat),w,%who *)) { return $gettok($ifmatch,1,32) }
- if ($read($gfile(authed.dat),w,* %who *)) { return $gettok($ifmatch,2,32) }
- return 0
- }
- if (STEAM_*:*:* iswm %who) {
- if ($read($gfile(gatherusers.dat),w,* %who)) { return $gettok($ifmatch,1,32) }
- if ($read($gfile(authed.dat),w,* %who)) { return $gettok($ifmatch,2,32) }
- return 0
- }
- if ($read($gfile(authed.dat),s,%who)) { return $gettok($ifmatch,1,32) }
- if ($isonchans(%who)) { return 0 }
- if ($read($gfile(authed.dat),w,* %who)) { return $gettok($ifmatch,2,32) }
- if ($read($gfile(authed.dat),w,* %who *)) { return $gettok($ifmatch,2,32) }
- if ($read($gfile(gatherusers.dat),w,%who *)) { return $gettok($ifmatch,1,32) }
- if ($read($gfile(gatherusers.dat),w,* %who)) { return $gettok($ifmatch,1,32) }
- return 0
- }
- alias gsteamid {
- var %who = $cleanit($1), %wnick = $cleanit2($1)
- if (!%who) { return 0 }
- if ($1 == :me:) || ($1 == :gatherbot:) || ($1 == $me) { return $me }
- if ($left($1,1) == $chr(35)) {
- if ($read($gfile(gatherusers.dat),w,%who *)) { return $gettok($ifmatch,2,32) }
- if ($read($gfile(authed.dat),w,* %who *)) { return $gettok($ifmatch,3,32) }
- return 0
- }
- if (STEAM_*:*:* iswm %who) {
- if ($read($gfile(gatherusers.dat),w,* %who)) { return $gettok($ifmatch,2,32) }
- if ($read($gfile(authed.dat),w,* %who)) { return $gettok($ifmatch,3,32) }
- return 0
- }
- if ($read($gfile(authed.dat),s,%who)) { return $gettok($ifmatch,2,32) }
- if ($isonchans(%who)) { return 0 }
- if ($read($gfile(authed.dat),w,* %who)) { return $gettok($ifmatch,3,32) }
- if ($read($gfile(authed.dat),w,* %who *)) { return $gettok($ifmatch,3,32) }
- if ($read($gfile(gatherusers.dat),w,%who *)) { return $gettok($ifmatch,2,32) }
- if ($read($gfile(gatherusers.dat),w,* %who)) { return $gettok($ifmatch,2,32) }
- return 0
- }
- alias admin {
- if ($gauth($1)) { var %auth = $ifmatch, %i = 10
- if ($istok($headadmins,%auth,32)) { return 10 }
- while ($adminid(%i)) { var %type = $ifmatch | if ($readini($gfile(gatheradmins.ini),%type,%auth)) { return %i } | dec %i }
- return $iif($readini($gfile(gatheradmins.ini),Owner,%auth),10,0)
- }
- return 0
- }
- alias adminonly {
- if ($gauth($1)) { var %auth = $ifmatch, %i = 10
- while ($adminid(%i)) { var %type = $ifmatch | if ($readini($gfile(gatheradmins.ini),%type,%auth)) { return %i } | dec %i }
- return $iif($readini($gfile(gatheradmins.ini),Owner,%auth),10,0)
- }
- return 0
- }
- alias gadmin {
- var %ip = $1, %id = $2, %ga = $gatherstatus(%ip,gatheradmin), %cl1 = $gatherstatus(%ip,challenger), %cl2 = $gatherstatus(%ip,challenged), %auth = $gauth(%id), %gauth = $gauth(%ga), %admin = $admin($+($chr(35),%auth))
- if ($istok(%ga %cl1 %cl2,%id,32)) || ((%admin >= 8) && (%admin >= $admin($+($chr(35),%gauth)))) { return $true } | return $false
- }
- alias sadmin {
- var %ip = $1, %id = $2, %ga = $gatherstatus(%ip,gatheradmin), %auth = $gauth(%id), %admin = $admin($+($chr(35),%auth))
- if (%admin >= 8) && (($istok(%ga,%id,32)) || (%admin >= $admin($+($chr(35),%gauth)))) { return $true } | return $false
- }
- ;#################################### Alias to mixteams ##########################################;
- alias mute { var %chan = $iif($me ison $1,$1,$mainchan) | if ($me isop %chan) && (m !isincs $chan(%chan).mode) { mode %chan +m } }
- alias unmute { var %chan = $iif($me ison $1,$1,$mainchan) | if ($me isop %chan) && (m isincs $chan(%chan).mode) { mode %chan -m } }
- alias noticechan { if ($me ison $1) { if (N !isincs $chan($1).mode) { whatcmd notice $1 $2- } | else { whatcmd $meorsay $1 $2- } } }
- alias istack {
- var %i = 1 | while ($ini($gfile(stacks.ini),$1,%i)) { var %x = $ifmatch, %p = $readini($gfile(stacks.ini),$1,%x) | if ($istok(%p,$2,32)) { return %x } | inc %i }
- return $false
- }
- alias checkrematch {
- var %i = 1, %gfile = $gfile(rematch.ini) | while ($ini(%gfile,%i)) {
- var %mid = $ifmatch, %id = $remove(%mid,id_), %slots = $calc($left($readini($gfile(gatherids.ini),%id,type),1) *2), %time = $calc($ctime - $ctime($readini($gfile(gatherids.ini),%id,Ended)))
- if ($ini(%gfile,%mid,0) == %slots) { return %id }
- if (%time >= 7200) { remini -n %gfile %mid } | else { inc %i }
- }
- return $false
- }
- alias rematch {
- if ($1 !isnum) || (%ignore) { return }
- var %id = $1, %mid = $+(id_,%id), %ip = $gatherstatus(start), %gfile = $gfile(rematch.ini), %slots = $calc($left($readini($gfile(gatherids.ini),%id,type),1) *2)
- if (!$ini(%gfile,%mid,0)) || ($ini(%gfile,%mid,0) != %slots) {
- var %time = $calc($ctime - $ctime($readini($gfile(gatherids.ini),%id,Ended)))
- if (%time < 7200) { .timerre. [ $+ [ %id ] ] 1 $calc(7200 - %time + 1) rematch %id }
- else {
- if ($ini(%gfile,%mid,0) >= 1) { whatcmd $meorsay $mainchan $logo Rematch on Gather ID $+($chr(35),%id) did not get full in time! $logo }
- remini -n %gfile %mid | .timerre. [ $+ [ %id ] ] off
- }
- return
- }
- if (!%ip) { whatcmd $meorsay $mainchan $logo Rematch on Gather ID $+($chr(35),%id) will auto. start when a server is available $logo | return }
- myip | resetall %ip | writeini -n $gfile(gatherstatus.ini) info ip %ip
- writeini -n $gfile(gatherstatus.ini) %ip gatheradmin $ini(%gfile,%mid,1) | writeini -n $gfile(gatherstatus.ini) %ip slots %slots | writeini -n $gfile(gatherstatus.ini) %ip type Rematch
- var %i = 1, %team.ct = $readini($gfile(gatherids.ini),%id,CT), %team.t = $readini($gfile(gatherids.ini),%id,TERRORIST), %team = $rand(1,2), %t_p = 0, %ct_p = 0, %t, %ct, %maps
- while ($ini(%gfile,%mid,%i)) {
- var %sid = $ifmatch, %auth = $gauth(%sid), %x = $readini(%gfile,%mid,%sid), %vote. [ $+ [ %x ] ] $calc(%vote. [ $+ [ %x ] ] +1)
- if ($istok(%team.ct,%sid,32)) || ($istok(%team.ct,%auth,32)) { var %now = $iif(%team == 1,counter.ini,terrorist.ini) } | else { var %now = $iif(%team == 2,counter.ini,terrorist.ini) }
- writeini -n $gfile(players.ini) %ip %sid %sid | writeini -n $gfile(%now) %ip %sid %sid
- if (%now == counter.ini) { var %p = $getpoints(%sid), %ct_p = $calc(%ct_p + %p), %ct = $iif(%ct,$+(%ct,$chr(44))) $anick(%sid) }
- else { var %p = $getpoints(%sid), %t_p = $calc(%t_p + %p), %t = $iif(%t,$+(%t,$chr(44))) $anick(%sid) }
- if (!$istok(%maps,%x,32)) { var %maps = %maps %x }
- inc %i
- }
- var %ct_pts = $round(%ct_p,0), %t_pts = $round(%t_p,0), %total = $calc(%ct_pts + %t_pts), %procent = $calc(100 / %total), %ct_win = $round($calc(%procent * %ct_pts),0), %t_win = $round($calc(%procent * %t_pts),0)
- var %i = 1, %x = $numtok(%maps,32), %max = 0, %map = de_inferno | while (%x) { var %m = $gettok(%maps,%x,32) | dec %x
- if (%vote. [ $+ [ %m ] ] >= %max) && (%vote. [ $+ [ %m ] ]) { var %max = $ifmatch, %map = %m }
- }
- if ($me isop $mainchan) && (m !isincs $chan($mainchan).mode) { whatcmd mode $mainchan +m }
- whatcmd $meorsay $mainchan $logo Rematch started $split Sending info now (ID: $posgid(%ip) $+ ) $split Map: %map $+ $logo | .rconstart %ip startup
- ;;SPECIAL;;
- writeini -n $gfile(gatherstatus.ini) %ip map %map | writeini -n $gfile(gatherstatus.ini) %ip start_time $date $time | writeini -n $gfile(gatherservers.ini) %ip cs_pw $cs_pw | if ($vtset(%ip)) { create.vt %ip }
- whatcmd $meorsay $mainchan $logo $col(04,Terrorist) $+ : $iif(%t,$ifmatch,0) $split Win: $col(07,$iif(%t_win,$ifmatch,0)) $+ $col(14,$chr(37)) $logo | whatcmd $meorsay $mainchan $logo $col(11,CounterTerrorist) $+ : $iif(%ct,$ifmatch,0) $split Win: $col(07,$iif(%ct_win,$ifmatch,0)) $+ $col(14,$chr(37)) $logo
- var %voice = $readini($gfile(gatherservers.ini),%ip,voice), %vtip = $readini($gfile(gatherservers.ini),%ip,vt_ip), %voiceip = $readini($gfile(gatherservers.ini),%ip,voice_ip)
- if ((%voice == Ventrilo) && (%vtip) && (%vtip != n/a)) || ((%voice) && (%voice != n/a) && (%voiceip) && (%voiceip != n/a)) {
- var %i = 1 | while (%i <= $ini($gfile(players.ini),%ip,0)) { msgnick %ip $ini($gfile(players.ini),%ip,%i) | inc %i }
- ;;SPECIAL;;
- whatcmd $meorsay $mainchan $logo You have $iif($timetojoin.nr isnum,$duration($timetojoin.nr),$timetojoin.nr time) to join the server $split Server $+($chr(35),,$serverid(%ip),) $logo $iif($readini($gfile(gatherservers.ini),%ip,text),$ifmatch $logo)
- }
- else {
- whatcmd $meorsay $mainchan $logo Console: connect %ip $+ ;password $readini($gfile(gatherservers.ini),%ip,cs_pw) $logo $iif($readini($gfile(gatherservers.ini),%ip,text),$ifmatch $logo)
- ;;SPECIAL;;
- whatcmd $meorsay $mainchan $logo You have $iif($timetojoin.nr isnum,$duration($timetojoin.nr),$timetojoin.nr time) to join the server $split Server $+($chr(35),,$serverid(%ip),) $logo
- }
- whatcmd timetojoin %ip | whatcmd removeip %ip | if ($gatheradvtjek) { whatcmd $meorsay $mainchan $logo $readini($gfile(gatherinfo.ini),n,adv,$gatheradv) $logo } | remini -n %gfile %mid
- if ($gatherstatus(start)) && ($checkrematch) { var %id = $ifmatch | whatcmd rematch %id } | else { whatcmd unmute $mainchan }
- }
- alias msgteams {
- ;;SPECIAL;;
- writeini -n $gfile(gatherstatus.ini) $1 start_time $date $time | writeini -n $gfile(gatherservers.ini) $1 cs_pw $cs_pw | if ($vtset($1)) { create.vt $1 }
- var %i = 1, %t = $null, %t_p = 0 | while (%i <= $ini($gfile(terrorist.ini),$1,0)) { var %s = $ini($gfile(terrorist.ini),$1,%i), %p = $getpoints(%s), %t_p = $calc(%t_p + %p), %t = $iif(%t,$+(%t,$chr(44))) $anick(%s) | inc %i }
- var %i = 1, %ct = $null, %ct_p = 0 | while (%i <= $ini($gfile(counter.ini),$1,0)) { var %s = $ini($gfile(counter.ini),$1,%i), %p = $getpoints(%s), %ct_p = $calc(%ct_p + %p), %ct = $iif(%ct,$+(%ct,$chr(44))) $anick(%s) | inc %i }
- var %ct_pts = $round(%ct_p,0), %t_pts = $round(%t_p,0), %total = $calc(%ct_pts + %t_pts), %procent = $calc(100 / %total), %ct_win = $round($calc(%procent * %ct_pts),0), %t_win = $round($calc(%procent * %t_pts),0)
- whatcmd $meorsay $mainchan $logo $col(04,Terrorist) $+ : $iif(%t,$ifmatch,0) $split Win: $col(07,$iif(%t_win,$ifmatch,0)) $+ $col(14,$chr(37)) $logo | whatcmd $meorsay $mainchan $logo $col(11,CounterTerrorist) $+ : $iif(%ct,$ifmatch,0) $split Win: $col(07,$iif(%ct_win,$ifmatch,0)) $+ $col(14,$chr(37)) $logo
- var %voice = $readini($gfile(gatherservers.ini),$1,voice), %vtip = $readini($gfile(gatherservers.ini),$1,vt_ip), %voiceip = $readini($gfile(gatherservers.ini),$1,voice_ip) | temppw $1
- if ((%voice == Ventrilo) && (%vtip) && (%vtip != n/a)) || ((%voice) && (%voice != n/a) && (%voiceip) && (%voiceip != n/a)) {
- var %i = 1 | while (%i <= $ini($gfile(players.ini),$1,0)) { msgnick $1 $ini($gfile(players.ini),$1,%i) | inc %i }
- ;;SPECIAL;;
- whatcmd $meorsay $mainchan $logo You have $iif($timetojoin.nr isnum,$duration($timetojoin.nr),$timetojoin.nr time) to join the server $split Server $+($chr(35),,$serverid($1),) $logo $iif($readini($gfile(gatherservers.ini),$1,text),$ifmatch $logo)
- }
- else {
- if ($tempplayers($1)) {
- var %i = 1 | while ($ini($gfile(players.ini),$1,%i)) { var %x = $ifmatch | if (STEAM_T:E:MP* iswm %x) { msgnick $1 %x } | inc %i }
- }
- whatcmd $meorsay $mainchan $logo Console: connect $1 $+ ;password $readini($gfile(gatherservers.ini),$1,cs_pw) $logo $iif($readini($gfile(gatherservers.ini),$1,text),$ifmatch $logo)
- whatcmd $meorsay $mainchan $logo You have $iif($timetojoin.nr isnum,$duration($timetojoin.nr),$timetojoin.nr time) to join the server $split Server $+($chr(35),,$serverid($1),) $logo
- }
- whatcmd timetojoin $1 | whatcmd removeip $1 | if ($gatheradvtjek) { whatcmd $meorsay $mainchan $logo $readini($gfile(gatherinfo.ini),adv,$gatheradv) $logo }
- if ($readini($gfile(gatherservers.ini),$1,gotv)) { var %gotv = $ifmatch | whatcmd $meorsay $mainchan $logo GOTV: %gotv $logo }
- whatcmd settopic
- if ($gatherstatus(start)) && ($checkrematch) { var %id = $ifmatch | whatcmd rematch %id } | else { whatcmd unmute $mainchan }
- }
- alias mixteams { window -c @players
- ;;SPECIAL;;
- writeini -n $gfile(gatherstatus.ini) $1 start_time $date $time | writeini -n $gfile(gatherservers.ini) $1 cs_pw $cs_pw | if ($vtset($1)) { create.vt $1 }
- window -eh1 @players | var %i = 1, %team = $r(1,2) | while (%i <= $ini($gfile(players.ini),$1,0)) {
- var %x = $ini($gfile(players.ini),$1,%i), %p = $getpoints(%x), %exp = $ex_nr($round(%p,2))
- if (!$istack($1,%x)) { aline @players %x %exp }
- inc %i
- }
- var %i = 1, %t_p = 0, %ct_p = 0, %t_pl = 0, %ct_pl = 0, %players = $ini($gfile(players.ini),$1,0), %slots = $iif($readini($gfile(gatherstatus.ini),$1,slots),$ifmatch,%players), %teams = $round($calc(%slots /2),0), %t, %ct
- while ($ini($gfile(stacks.ini),$1,%i)) { var %x = $ifmatch, %p = $readini($gfile(stacks.ini),$1,%x), %n = $numtok(%p,32)
- if (%i == 1) {
- if (%team == 1) {
- var %a = 1 | while ($gettok(%p,%a,32)) { var %b = $ifmatch, %pp = $round($getpoints(%b),2)
- var %t = $iif(%t,$+(%t,$chr(44))) $anick(%b), %t_p = $calc(%t_p + %pp) | writeini -n $gfile(terrorist.ini) $1 %b %b | inc %t_pl | inc %a
- }
- }
- else {
- var %a = 1 | while ($gettok(%p,%a,32)) { var %b = $ifmatch, %pp = $round($getpoints(%b),2)
- var %ct = $iif(%ct,$+(%ct,$chr(44))) $anick(%b), %ct_p = $calc(%ct_p + %pp) | writeini -n $gfile(counter.ini) $1 %b %b | inc %ct_pl | inc %a
- }
- }
- }
- elseif (%team == 1) {
- if ($calc(%n + %ct_pl) <= %teams) {
- var %a = 1 | while ($gettok(%p,%a,32)) { var %b = $ifmatch, %pp = $round($getpoints(%b),2)
- var %ct = $iif(%ct,$+(%ct,$chr(44))) $anick(%b), %ct_p = $calc(%ct_p + %pp) | writeini -n $gfile(counter.ini) $1 %b %b | inc %ct_pl | inc %a
- }
- }
- else {
- var %a = 1 | while ($gettok(%p,%a,32)) { var %b = $ifmatch, %pp = $round($getpoints(%b),2)
- var %t = $iif(%t,$+(%t,$chr(44))) $anick(%b), %t_p = $calc(%t_p + %pp) | writeini -n $gfile(terrorist.ini) $1 %b %b | inc %t_pl | inc %a
- }
- }
- }
- elseif ($calc(%n + %t_pl) <= %teams) {
- var %a = 1 | while ($gettok(%p,%a,32)) { var %b = $ifmatch, %pp = $round($getpoints(%b),2)
- var %t = $iif(%t,$+(%t,$chr(44))) $anick(%b), %t_p = $calc(%t_p + %pp) | writeini -n $gfile(terrorist.ini) $1 %b %b | inc %t_pl | inc %a
- }
- }
- else {
- var %a = 1 | while ($gettok(%p,%a,32)) { var %b = $ifmatch, %pp = $round($getpoints(%b),2)
- var %ct = $iif(%ct,$+(%ct,$chr(44))) $anick(%b), %ct_p = $calc(%ct_p + %pp) | writeini -n $gfile(counter.ini) $1 %b %b | inc %ct_pl | inc %a
- }
- }
- inc %i
- }
- filter -twce 2 32 @players @players | var %i = 1 | while ($line(@players,%i)) {
- var %x = $ifmatch, %steamid = $gettok(%x,1,32), %auth = $gauth(%steamid), %p = $round($gettok(%x,2,32),2)
- if (%i == 1) && (!%ct) && (!%t) {
- if (%team == 1) { var %t = $iif(%t,$+(%t,$chr(44))) $anick(%auth), %t_p = $calc(%t_p + %p) | writeini -n $gfile(terrorist.ini) $1 %steamid %steamid | inc %t_pl }
- else { var %ct = $iif(%ct,$+(%ct,$chr(44))) $anick(%auth), %ct_p = $calc(%ct_p + %p) | writeini -n $gfile(counter.ini) $1 %steamid %steamid | inc %ct_pl }
- }
- elseif (%t_p >= %ct_p) {
- if (%ct_pl < %teams) { var %ct = $iif(%ct,$+(%ct,$chr(44))) $anick(%auth), %ct_p = $calc(%ct_p + %p) | writeini -n $gfile(counter.ini) $1 %steamid %steamid | inc %ct_pl }
- else { var %t = $iif(%t,$+(%t,$chr(44))) $anick(%auth), %t_p = $calc(%t_p + %p) | writeini -n $gfile(terrorist.ini) $1 %steamid %steamid | inc %t_pl }
- }
- elseif (%t_pl < %teams) { var %t = $iif(%t,$+(%t,$chr(44))) $anick(%auth), %t_p = $calc(%t_p + %p) | writeini -n $gfile(terrorist.ini) $1 %steamid %steamid | inc %t_pl }
- else { var %ct = $iif(%ct,$+(%ct,$chr(44))) $anick(%auth), %ct_p = $calc(%ct_p + %p) | writeini -n $gfile(counter.ini) $1 %steamid %steamid | inc %ct_pl } | inc %i
- }
- window -c @players | var %ct_pts = $round(%ct_p,0), %t_pts = $round(%t_p,0), %total = $calc(%ct_pts + %t_pts), %procent = $calc(100 / %total), %ct_win = $round($calc(%procent * %ct_pts),0), %t_win = $round($calc(%procent * %t_pts),0)
- whatcmd $meorsay $mainchan $logo $col(04,Terrorist) $+ : $iif(%t,$ifmatch,0) $split Win: $col(07,$iif(%t_win,$ifmatch,0)) $+ $col(14,$chr(37)) $logo | whatcmd $meorsay $mainchan $logo $col(11,CounterTerrorist) $+ : $iif(%ct,$ifmatch,0) $split Win: $col(07,$iif(%ct_win,$ifmatch,0)) $+ $col(14,$chr(37)) $logo
- var %voice = $readini($gfile(gatherservers.ini),$1,voice), %vtip = $readini($gfile(gatherservers.ini),$1,vt_ip), %voiceip = $readini($gfile(gatherservers.ini),$1,voice_ip) | temppw $1
- if ((%voice == Ventrilo) && (%vtip) && (%vtip != n/a)) || ((%voice) && (%voice != n/a) && (%voiceip) && (%voiceip != n/a)) {
- var %i = 1 | while (%i <= $ini($gfile(players.ini),$1,0)) { msgnick $1 $ini($gfile(players.ini),$1,%i) | inc %i }
- ;;SPECIAL;;
- whatcmd $meorsay $mainchan $logo You have $iif($timetojoin.nr isnum,$duration($timetojoin.nr),$timetojoin.nr time) to join the server $split Server $+($chr(35),,$serverid($1),) $logo $iif($readini($gfile(gatherservers.ini),$1,text),$ifmatch $logo)
- }
- else {
- if ($tempplayers($1)) {
- var %i = 1 | while ($ini($gfile(players.ini),$1,%i)) { var %x = $ifmatch | if (STEAM_T:E:MP* iswm %x) { msgnick $1 %x } | inc %i }
- }
- whatcmd $meorsay $mainchan $logo Console: connect $1 $+ ;password $readini($gfile(gatherservers.ini),$1,cs_pw) $logo $iif($readini($gfile(gatherservers.ini),$1,text),$ifmatch $logo)
- ;;SPECIAL;;
- whatcmd $meorsay $mainchan $logo You have $iif($timetojoin.nr isnum,$duration($timetojoin.nr),$timetojoin.nr time) to join the server $split Server $+($chr(35),,$serverid($1),) $logo
- }
- whatcmd timetojoin $1 | whatcmd removeip $1 | if ($gatheradvtjek) { whatcmd $meorsay $mainchan $logo $readini($gfile(gatherinfo.ini),adv,$gatheradv) $logo }
- if ($readini($gfile(gatherservers.ini),$1,gotv)) { var %gotv = $ifmatch | whatcmd $meorsay $mainchan $logo GOTV: %gotv $logo }
- whatcmd settopic
- if ($gatherstatus(start)) && ($checkrematch) { var %id = $ifmatch | whatcmd rematch %id } | else { whatcmd unmute $mainchan }
- }
- alias newteams {
- remini -n $gfile(counter.ini) $1 | remini -n $gfile(terrorist.ini) $1 | window -eh1 @newteams
- var %i = 1, %players = $ini($gfile(players.ini),$1,0), %slots = $iif($readini($gfile(gatherstatus.ini),$1,slots),$ifmatch,%players) | while (%i <= %players) {
- var %x = $ini($gfile(players.ini),$1,%i), %p = $getpoints(%x) | aline @newteams %x $ex_nr(%p) | inc %i
- }
- var %i = 1, %team = $rand(1,2), %split = $round($calc(%slots / 2),0), %newt = $null, %newct = $null, %ct_p = 0, %t_p = 0 | while (%i <= $ini($gfile(newteams.ini),$1,0)) {
- var %x = $ini($gfile(newteams.ini),$1,%i), %g = 1, %lan = $ini($gfile(newteams.ini),%x,0), %ct = $ini($gfile(counter.ini),$1,0), %t = $ini($gfile(terrorist.ini),$1,0) | while (%g <= %lan) {
- var %steamid = $ini($gfile(newteams.ini),%x,%g), %p = $round($getpoints(%steamid),2), %ctnow = $ini($gfile(counter.ini),$1,0), %tnow = $ini($gfile(terrorist.ini),$1,0)
- if (%team == 1) {
- if ($calc(%lan + %t) <= %split) { var %t_p = $calc(%t_p + %p), %newt = %newt $anick($gauth(%steamid)) | writeini -n $gfile(terrorist.ini) $1 %steamid %steamid }
- elseif ($calc(%lan + %ct) <= %split) { var %team = 2, %ct_p = $calc(%ct_p + %p), %newct = %newct $anick($gauth(%steamid)) | writeini -n $gfile(counter.ini) $1 %steamid %steamid }
- elseif (%tnow < %split) { var %t_p = $calc(%t_p + %p), %newt = %newt $anick($gauth(%steamid)) | writeini -n $gfile(terrorist.ini) $1 %steamid %steamid }
- else { var %team = 2, %ct_p = $calc(%ct_p + %p), %newct = %newct $anick($gauth(%steamid)) | writeini -n $gfile(counter.ini) $1 %steamid %steamid }
- }
- elseif ($calc(%lan + %ct) <= %split) { var %ct_p = $calc(%ct_p + %p), %newct = %newct $anick($gauth(%steamid)) | writeini -n $gfile(counter.ini) $1 %steamid %steamid }
- elseif ($calc(%lan + %t) <= %split) { var %team = 1, %t_p = $calc(%t_p + %p), %newt = %newt $anick($gauth(%steamid)) | writeini -n $gfile(terrorist.ini) $1 %steamid %steamid }
- elseif (%ctnow < %split) { var %ct_p = $calc(%ct_p + %p), %newct = %newct $anick($gauth(%steamid)) | writeini -n $gfile(counter.ini) $1 %steamid %steamid }
- else { var %team = 1, %t_p = $calc(%t_p + %p), %newt = %newt $anick($gauth(%steamid)) | writeini -n $gfile(terrorist.ini) $1 %steamid %steamid } | inc %g
- }
- inc %i
- }
- filter -twce 2 32 @newteams @newteams | var %i = 1, %teams = $calc(%slots /2) | while (%i <= $line(@newteams,0)) {
- var %ct = $ini($gfile(counter.ini),$1,0), %t = $ini($gfile(terrorist.ini),$1,0), %x = $line(@newteams,%i), %sid = $gettok(%x,1,32), %p = $round($gettok(%x,2,32),2)
- if (!$readini($gfile(counter.ini),$1,%sid)) && (!$readini($gfile(terrorist.ini),$1,%sid)) {
- if (%t_p >= %ct_p) {
- if (%ct < %teams) { var %newct = %newct $anick($gauth(%sid)), %ct_p = $calc(%ct_p + %p) | writeini -n $gfile(counter.ini) $1 %sid %sid }
- else { var %newt = %newt $anick($gauth(%sid)), %t_p = $calc(%t_p + %p) | writeini -n $gfile(terrorist.ini) $1 %sid %sid }
- }
- else {
- if (%t < %teams) { var %newt = %newt $anick($gauth(%sid)), %t_p = $calc(%t_p + %p) | writeini -n $gfile(terrorist.ini) $1 %sid %sid }
- else { var %newct = %newct $anick($gauth(%sid)), %ct_p = $calc(%ct_p + %p) | writeini -n $gfile(counter.ini) $1 %sid %sid }
- }
- }
- inc %i
- }
- window -c @newteams | resetnewteams $1 | .timer 1 1 queryteams $1 newteams
- var %ct_pts = $round(%ct_p,0), %t_pts = $round(%t_p,0), %total = $calc(%ct_pts + %t_pts), %procent = $calc(100 / %total), %ct_win = $round($calc(%procent * %ct_pts),0), %t_win = $round($calc(%procent * %t_pts),0)
- whatcmd $meorsay $mainchan $logo There was found people at LAN on server $serverid($1) $logo | whatcmd $meorsay $mainchan $logo $col(04,Terrorist) $+ : $iif(%newt,$ifmatch,0) $split Win: $col(07,$iif(%t_win,$ifmatch,0)) $+ $col(14,$chr(37)) $logo
- whatcmd $meorsay $mainchan $logo $col(11,CounterTerrorist) $+ : $iif(%newct,$ifmatch,0) $split Win: $col(07,$iif(%ct_win,$ifmatch,0)) $+ $col(14,$chr(37)) $logo | whatcmd $meorsay $mainchan $logo Use .send to recieve info to ur team! $logo
- }
- alias timetojoin { var %i = 1, %tid = $calc($ctime + $timetojoin.nr), %gfile = $gfile(players.ini) | while (%i <= $ini(%gfile,$1,0)) { var %x = $ini(%gfile,$1,%i) | writeini -n %gfile $1 %x $iif($timetojoin.nr isnum,%tid,$timetojoin.nr) | inc %i } | .timer 1 0 gathertimeout $1 }
- alias timetojoin.nr {
- if ($gatherinfo(timetojoin)) { var %nr = $ifmatch | return $calc(60 * %nr) }
- ;;SPECIAL;;
- if (#GJI == $mainchan) { return Unlimited }
- if (#CSGO.Swe == $mainchan) || (#fragportal == $mainchan) { return 300 }
- if (#signfrag.* iswm $mainchan) { return 420 }
- return 600
- }
- alias cs_pw {
- if ($readini($gfile(gatherinfo.ini),global,password)) { return $ifmatch }
- ;;SPECIAL;;
- if (#signfrag.* iswm $mainchan) { return ghu }
- if (#gamebase.csgo == $mainchan) { return gb }
- if (#invite.norge == $mainchan) { return gather }
- if (#go.zoctai == $mainchan) { return zoctai }
- if (#gatherzone == $mainchan) { return gzone }
- if (#pro.zoctai == $mainchan) { return zoctai }
- if (#denova.play == $mainchan) { return gth }
- if (#gather.fb == $mainchan) { return fbgather }
- if (#csgo.ee == $mainchan) { return eesti }
- if (#esau == $mainchan) { return stream }
- if (#fragportal == $mainchan) { return fp }
- if (#zegather == $mainchan) { return game }
- if (#godorhuman == $mainchan) { return godorhuman }
- if (#kosegather == $mainchan) { return snus }
- if (#rasta.gather == $mainchan) { return ukg }
- if (#gg.invite == $mainchan) { return wrestling }
- if (#go.gathers == $mainchan) { return lefedora }
- return war
- }
- ;#################################### Aliases ##########################################;
- alias winrardir { return "C:\Programmer\WinRAR\WinRAR.exe" }
- alias hltvdir { return C:\HLServer\HLTV\cstrike\ }
- alias isinpool { var %i = 1 | while (%i <= $ini($gfile(players.ini),$1,0)) { var %x = $ini($gfile(players.ini),$1,%i), %n = $gnick(%x) | if ($2 isin %n) { return %x } | inc %i } }
- alias claoe {
- if ($gatherstatus(accept)) {
- var %accept = $ifmatch, %ip = $gatherstatus(ip), %cl = $gatherstatus(%ip,challenger), %map = $gatherstatus(%ip,map), %region = $gatherstatus(%ip,region), %x = $timer(challenge).reps, %d = $timer(challenge).delay, %s = $timer(challenge).secs, %t = $iif(%x > 1,$calc((%x -1) * %d + %s),%s) | set -z %tmp.claoe 600 | inc -z %glist 10
- mode $1 -N | notice $1 $logo $anick(%cl) has challenged $iif(%accept = All,You?,$anick(%accept) $+ ) $split $iif($gatherinfo(regions),Region: $+(,%region,) $split) Map: %map $+ $logo $iif(%accept == All,Anyone can use .accept ,Use .accept or !reject) $col(14,$chr(40)) $+ $duration(%t) $+ $col(14,$chr(41)) $logo | mode $1 +N
- }
- }
- alias aoe {
- if ($me isop $1) { var %mode = 0
- if (!$gatherstatus(accept)) && ($gatherstatus(Signup)) { var %mode = 1, %ip = $ifmatch, %map = $gatherstatus(%ip,map), %region = $gatherstatus(%ip,region), %slots = $gatherstatus(%ip,slots), %signs = $gatherstatus(%ip,added), %admin = $gatherstatus(%ip,admin), %players = %signs, %type = $gatherstatus(%ip,type)
- set -z %tmp.aoe 120 | mode $1 -N | notice $1 $logo Gather signup $split Admin: $anick($gauth(%admin)) $split $iif($gatherinfo(regions),Region: $+(,%region,) $split) Map: %map $split Signed: $iif((%type == Challenge) && (($unlim(pool)) || (($unlim(noon)) && ($time < 12))),$+($iif(%players >= %slots,$col(09,%players),$col(04,%players))),$+(%players,/,%slots)) $logo | inc -z %glist 6
- }
- if ($gatherstatus(sub)) {
- if (!%mode) { mode $1 -N } | var %i = 1, %mode = 1 | while (%i <= $ini($gfile(gatherservers.ini),0)) { var %ip = $ini($gfile(gatherservers.ini),%i)
- if ($serverstatus(%ip,sub)) {
- var %ct = $iif($readini($gfile(gatherstatus.ini),%ip,ct_subs),$ifmatch,0), %t = $iif($readini($gfile(gatherstatus.ini),%ip,t_subs),$ifmatch,0), %subs = $calc(%ct + %t)
- if (%subs) { var %s.ct = $score(%ip,ct), %s.t = $score(%ip,t), %map = $gatherstatus(%ip,map), %region = $gatherstatus(%ip,region) | inc -z %glist 6 | set -z %tmp.aoe 150
- notice $1 $logo Substitute(s): %subs $+ $split $iif($gatherinfo(regions),Region: $+(,%region,) $split) Map: %map $split $col(11,CT) $+ : %s.ct $col(04,T) $+ : %s.t $split Use: .addsub %i - to sign as an substitute $logo
- }
- }
- inc %i
- }
- }
- if (%mode) { mode $1 +N } | else { set -z %tmp.aoe 10 | $meorsay $1 $logo There is no signup at the moment, start one with .sg [map] or .cl [map] $logo }
- }
- }
- alias setmynick { if ($me != $mynick) { whatcmd nick $mynick | if (!$timer(mynick)) { .timermynick 1 60 setmynick } } | elseif ($timer(mynick)) { .timermynick off } }
- raw 433:*:{ var %znick = $+($mynick,%mynick) | if ($2 == $mynick) || ($2 == %znick) { if ($mynick !isin $me) { set -u120 %mynick $iif(%mynick,$calc(%mynick +1),2) | .timersetmynick 1 10 whatcmd nick $+($mynick,%mynick) } | .timermynick 1 300 setmynick } }
- alias Qbot {
- if ($network == GameSurge) { return ChanServ }
- if ($network == Aitvaras) { return ChanServ }
- if ($network == GRNet) { return ChanServ }
- return Q
- }
- alias Qaddr {
- if ($network == GameSurge) { return *!*@*.user.gamesurge }
- if ($network == Aitvaras) { ;return *!*@* }
- if ($network == GRNet) { ;return *!*@* }
- return *!*@*.users.quakenet.org
- }
- alias Qhidden {
- if ($network == GameSurge) { return *!*@*.user.gamesurge }
- if ($network == Aitvaras) { return *!*@* }
- if ($network == GRNet) { return *!*@* }
- return *!*@*.users.quakenet.org
- }
- alias Qauth {
- if ($network == GameSurge) { return .authserv AUTH }
- if ($network == Aitvaras) { return .msg NickServ IDENTIFY }
- if ($network == GRNet) { return .msg NickServ IDENTIFY }
- return .msg Q@CServe.quakenet.org AUTH
- }
- alias mainpriv { return $mainchan $privchan $ownerchan }
- alias authme { authing }
- alias authbot { authing }
- alias authing {
- if ($readini($gfile(gatherinfo.ini),auth,user)) && ($readini($gfile(gatherinfo.ini),auth,pass)) {
- if ($network == Aitvaras) { mode $me +xB } | else { mode $me +x }
- if ($network == GRNet) {
- [ $Qauth ] $readini($gfile(gatherinfo.ini),auth,pass)
- }
- else {
- [ $Qauth ] $readini($gfile(gatherinfo.ini),auth,user) $readini($gfile(gatherinfo.ini),auth,pass)
- }
- }
- .timer 1 5 gatherchans | .timer 1 10 setmynick
- }
- on *:NOTICE:*:*:{
- if ($nick == $Qbot) {
- if (*only available to authed users* iswm $1-) {
- if ($timer(gatherchans)) { .timergatherchans off } | if ($timer(gatherchans2)) { .timergatherchans2 off }
- if ($timer(mynick)) { .timermynick off } | if ($timer(setmynick)) { .timersetmynick off }
- .timerauthing 1 300 authing
- }
- elseif (*Too many users AUTH'd to this account* iswm $1-) {
- if ($timer(gatherchans)) { .timergatherchans off } | if ($timer(gatherchans2)) { .timergatherchans2 off }
- if ($timer(mynick)) { .timermynick off } | if ($timer(setmynick)) { .timersetmynick off }
- gatherchans | .timer 1 300 authing
- }
- }
- }
- alias gatherchans {
- if ($Qhidden !iswm $address($me,2)) && ($network != Aitvaras && $network != GRNet) { .timergatherchans 1 2 gatherchans2 | return }
- if ($me !ison $mainchan) { whatcmd join $mainchan | .timergatherchans 1 20 gatherchans2 }
- if ($me !ison $privchan) { whatcmd join $privchan | .timergatherchans 1 20 gatherchans2 }
- if ($me !ison $ownerchan) { whatcmd join $ownerchan pw | .timergatherchans 1 20 gatherchans2 }
- }
- alias gatherchans2 {
- if ($readini($gfile(gatherinfo.ini),auth,user)) && ($readini($gfile(gatherinfo.ini),auth,pass)) {
- if ($me !ison $mainchan) { .timerqinvite 1 0 whatcmd msg $Qbot invite | .timergatherchans 1 60 gatherchans }
- if ($me !ison $privchan) { .timerqinvite 1 0 whatcmd msg $Qbot invite | .timergatherchans 1 60 gatherchans }
- if ($me !ison $ownerchan) { .timerqinvite 1 0 whatcmd msg $Qbot invite | .timergatherchans 1 60 gatherchans }
- }
- else { .timergatherchans 1 30 gatherchans }
- }
- alias noticetype {
- var %nick = $1, %chan = $iif($2,$ifmatch,$mainchan) | if ($me !isreg %chan) && (%nick ison %chan) && ($network == QuakeNet) { return cnotice %nick %chan } | return notice %nick
- }
- alias msgtype {
- var %nick = $1, %chan = $iif($2,$ifmatch,$mainchan) | if ($me !isreg %chan) && (%nick ison %chan) && ($network == QuakeNet) { return cprivmsg %nick %chan } | return msg %nick
- }
- alias msgnick {
- if (*STEAM_*:*:* iswm $2) {
- var %steamid = $2, %auth = $gauth(%steamid), %nick = $gnick(%auth), %admin = 0, %t = $col(04,Terrorist), %ct = $col(11,CounterTerrorist), %vtip = $iif($readini($gfile(gatherservers.ini),$1,vt_ip),$ifmatch,n/a), %voiceip = $iif($readini($gfile(gatherservers.ini),$1,voice_ip),$ifmatch,n/a)
- if ($read($gfile(authed.dat),w,* %auth *)) || ($read($gfile(authed.dat),w,* %steamid)) { var %msgtype = $msgtype(%nick), %voice = $readini($gfile(gatherservers.ini),$1,voice), %id = $serverid($1), %game = $gatherinfo(game), %room = %game Gather $+($chr(35),%id)
- if ($admin($+($chr(35),%auth)) >= 8) { var %admin = %auth } | if (!$sameteam($score($1,total))) { var %ct = $col(04,Terrorist) - only INGAME, %t = $col(11,CounterTerrorist) - only INGAME }
- if (STEAM_T:E:MP* iswm $2) {
- if (!$readini($gfile(tempreg.ini),$1,$2)) { writeini -n $gfile(tempreg.ini) $1 $2 $rand(1123,9889) }
- whatcmd %msgtype $logo Remember to authenticate with the bot ingame - as soon as you join the server! $split Console: say .reg $readini($gfile(tempreg.ini),$1,$2) $logo
- }
- if (%voice == Ventrilo) && (%vtip) && (%vtip != n/a) {
- if ($readini($gfile(counter.ini),$1,%steamid)) {
- whatcmd %msgtype $logo Team %ct $logo Console: connect $1 $+ ;password $readini($gfile(gatherservers.ini),$1,cs_pw) $logo Ventrilo: $replace(%vtip,$chr(58),$chr(32)) $split Pw: $iif($readini($gfile(gatherservers.ini),$1,vt_pw),$ifmatch,n/a) $iif($vtset($1),$split Room: %room $split CT Room Pw: $col(11,$iif($readini($gfile(gatherservers.ini),$1,vt_ct),$ifmatch,n/a)) $iif(%admin >= 8,$split T Room Pw: $col(04,$iif($readini($gfile(gatherservers.ini),$1,vt_t),$ifmatch,n/a),))) $logo $iif($readini($gfile(gatherservers.ini),$1,text),$ifmatch $logo)
- }
- elseif ($readini($gfile(terrorist.ini),$1,%steamid)) {
- whatcmd %msgtype $logo Team %t $logo Console: connect $1 $+ ;password $readini($gfile(gatherservers.ini),$1,cs_pw) $logo Ventrilo: $replace(%vtip,$chr(58),$chr(32)) $split Pw: $iif($readini($gfile(gatherservers.ini),$1,vt_pw),$ifmatch,n/a) $iif($vtset($1),$split Room: %room $split T Room Pw: $col(04,$iif($readini($gfile(gatherservers.ini),$1,vt_t),$ifmatch,n/a)) $iif(%admin >= 8,$split CT Room Pw: $col(11,$iif($readini($gfile(gatherservers.ini),$1,vt_ct),$ifmatch,n/a),))) $logo $iif($readini($gfile(gatherservers.ini),$1,text),$ifmatch $logo)
- }
- elseif ($readini($gfile(players.ini),$1,%steamid)) || (%admin != 0) {
- whatcmd %msgtype $logo Console: connect $1 $+ ;password $readini($gfile(gatherservers.ini),$1,cs_pw) $logo Ventrilo: $replace(%vtip,$chr(58),$chr(32)) $split Pw: $iif($readini($gfile(gatherservers.ini),$1,vt_pw),$ifmatch,n/a) $iif($vtset($1),$split Room: %room $split CT Room Pw: $col(11,$iif($readini($gfile(gatherservers.ini),$1,vt_ct),$ifmatch,n/a)) $split T Room Pw: $col(04,$iif($readini($gfile(gatherservers.ini),$1,vt_t),$ifmatch,n/a))) $logo $iif($readini($gfile(gatherservers.ini),$1,text),$ifmatch $logo)
- }
- }
- elseif (%voice) && (%voice != n/a) && (%voiceip) && (%voiceip != n/a) {
- if ($readini($gfile(counter.ini),$1,%steamid)) {
- whatcmd %msgtype $logo Team %ct $logo Console: connect $1 $+ ;password $readini($gfile(gatherservers.ini),$1,cs_pw) $logo %voice $+ : $readini($gfile(gatherservers.ini),$1,voice_ip) $split Pw: $iif($readini($gfile(gatherservers.ini),$1,voice_pw),$ifmatch,n/a) $logo $iif($readini($gfile(gatherservers.ini),$1,text),$ifmatch $logo)
- }
- elseif ($readini($gfile(terrorist.ini),$1,%steamid)) {
- whatcmd %msgtype $logo Team %t $logo Console: connect $1 $+ ;password $readini($gfile(gatherservers.ini),$1,cs_pw) $logo %voice $+ : $readini($gfile(gatherservers.ini),$1,voice_ip) $split Pw: $iif($readini($gfile(gatherservers.ini),$1,voice_pw),$ifmatch,n/a) $logo $iif($readini($gfile(gatherservers.ini),$1,text),$ifmatch $logo)
- }
- elseif ($readini($gfile(players.ini),$1,%steamid)) || (%admin != 0) {
- whatcmd %msgtype $logo Console: connect $1 $+ ;password $readini($gfile(gatherservers.ini),$1,cs_pw) $logo %voice $+ : $readini($gfile(gatherservers.ini),$1,voice_ip) $split Pw: $iif($readini($gfile(gatherservers.ini),$1,voice_pw),$ifmatch,n/a) $logo $iif($readini($gfile(gatherservers.ini),$1,text),$ifmatch $logo)
- }
- }
- elseif ($readini($gfile(counter.ini),$1,%steamid)) { whatcmd %msgtype $logo Team %ct $logo Console: connect $1 $+ ;password $readini($gfile(gatherservers.ini),$1,cs_pw) $logo $iif($readini($gfile(gatherservers.ini),$1,text),$ifmatch $logo) }
- elseif ($readini($gfile(terrorist.ini),$1,%steamid)) { whatcmd %msgtype $logo Team %t $logo Console: connect $1 $+ ;password $readini($gfile(gatherservers.ini),$1,cs_pw) $logo $iif($readini($gfile(gatherservers.ini),$1,text),$ifmatch $logo) }
- elseif ($readini($gfile(players.ini),$1,%steamid)) || (%admin != 0) { whatcmd %msgtype $logo Console: connect $1 $+ ;password $readini($gfile(gatherservers.ini),$1,cs_pw) $logo $iif($readini($gfile(gatherservers.ini),$1,text),$ifmatch $logo) }
- }
- }
- }
- alias logit {
- var %txt = $+($replace($1,$chr(58),$chr(45)),.log), %id = $+($chr(35),$serverid($1))
- .timer -o 1 0 write %txt $+($chr(91),$date,$chr(93),$chr(91),$time,$chr(93),$chr(91),%id,$chr(93)) $iif($2-,$ifmatch,---------------)
- }
- alias logtop {
- var %txt = $+($replace($1,$chr(58),$chr(45)),.log), %id = $+($chr(35),$serverid($1))
- .timer -o 1 0 write -il1 %txt $+($chr(91),$date,$chr(93),$chr(91),$time,$chr(93),$chr(91),%id,$chr(93)) $iif($2-,$ifmatch,---------------)
- }
- alias resetlog { var %txt = $+($replace($1,$chr(58),$chr(45)),.log) | if ($isfile(%txt)) { .remove %txt } }
- alias savelog {
- var %dir = gatherlogs\, %id = $replace($1,$chr(58),$chr(45)), %log = $iif($2,$ifmatch,%id), %txt = $+(%id,.log), %newtxt = $+(%dir,%log,.log), %i = 2
- if (!$isdir(%dir)) { mkdir %dir }
- if ($isfile(%txt)) {
- while ($isfile(%newtxt)) { var %newtxt = $+(%dir,%log,_,%i,.log) | inc %i }
- logtop $1 | logtop $1 Saved on $day $+ , $date - $time | logtop $1 | .rename %txt %newtxt | .timer 1 10 upcslog %log
- }
- }
- alias logit2 {
- var %txt = $+(rcon_,$replace($1,$chr(58),$chr(45)),.log), %id = $+($chr(35),$serverid($1))
- .timer -o 1 0 write %txt $+($chr(91),$date,$chr(93),$chr(91),$time,$chr(93),$chr(91),%id,$chr(93)) $iif($2-,$ifmatch,---------------)
- }
- alias logtop2 {
- var %txt = $+(rcon_,$replace($1,$chr(58),$chr(45)),.log), %id = $+($chr(35),$serverid($1))
- .timer -o 1 0 write -il1 %txt $+($chr(91),$date,$chr(93),$chr(91),$time,$chr(93),$chr(91),%id,$chr(93)) $iif($2-,$ifmatch,---------------)
- }
- alias resetlog2 { var %txt = $+(rcon_,$replace($1,$chr(58),$chr(45)),.log) | if ($isfile(%txt)) { .remove %txt } }
- alias savelog2 {
- var %dir = gatherlogs\, %id = $replace($1,$chr(58),$chr(45)), %log = $iif($2,$ifmatch,%id), %txt = $+(rcon_,%id,.log), %newtxt = $+(%dir,%log,.log), %i = 2
- if (!$isdir(%dir)) { mkdir %dir }
- if ($isfile(%txt)) {
- while ($isfile(%newtxt)) { var %newtxt = $+(%dir,%log,_,%i,.log) | inc %i }
- logtop2 $1 | logtop2 $1 Saved on $day $+ , $date - $time | logtop2 $1 | .rename %txt %newtxt
- }
- }
- alias tempauth {
- var %auth = tempauth, %num = 1, %tempauth = $+(%auth,%num)
- while ($read($gfile(authed.dat),w,* %tempauth *)) || ($read($gfile(gatherusers.dat),s,%tempauth)) { inc %num | var %tempauth = $+(%auth,%num) }
- return %tempauth
- }
- alias tempsteamid {
- var %steamid = STEAM_T:E:MP, %num = $rand(1123,9889) %tempsteamid = $+(%steamid,%num)
- while ($read($gfile(authed.dat),w,* %tempsteamid)) || ($read($gfile(gatherusers.dat),w,* %tempsteamid)) { var %num = $rand(1123,9889), %tempsteamid = $+(%steamid,%num) }
- return %tempsteamid
- }
- alias temppw {
- var %ipp = $1, %i = 1
- if ($2) {
- while ($ini($gfile(tempreg.ini),%ipp,%i)) { var %x = $ifmatch
- if ($2 == $readini($gfile(tempreg.ini),%ipp,%x)) { return %x }
- inc %i
- }
- return $false
- }
- if ($tempplayers(%ipp)) {
- while ($ini($gfile(players.ini),%ipp,%i)) { var %x = $ifmatch
- if (STEAM_T:E:MP* iswm %x) && (!$readini($gfile(tempreg.ini),%ipp,%x)) { writeini -n $gfile(tempreg.ini) %ipp %x $rand(1123,9889) }
- inc %i
- }
- }
- }
- alias tempplayers {
- var %ipp = $1, %i = 1, %players = $gfile(players.ini) | while ($ini(%players,%ipp,%i)) {
- var %x = $ifmatch | if (STEAM_T:E:MP* iswm %x) { return $true } | inc %i
- }
- return $false
- }
- alias tempcheck {
- var %ipp = $1 | set -u10 %tempcheck. [ $+ [ %ipp ] ] 1 | rconsend %ipp status
- }
- alias getpoints {
- var %id = $1, %played = $readini($gfile(gatherstats.ini),%id,Played), %points = $readini($gfile(gatherstats.ini),%id,Points), %xpoints = $readini($gfile(gatherstats.ini),%id,xPoints)
- if (%played >= 5) && (%points) { return %points } | elseif (%xpoints) { return %xpoints } | else { return $iif(%points,$ifmatch,1000) }
- }
- alias rankstatus {
- if ($1 !isnum) { return $col(04,Unknown) }
- if ($1 < 500) { return $col(04,Quit CS) }
- if ($1 < 600) { return $col(04,Bot) }
- if ($1 < 700) { return $col(04,Terrible) }
- if ($1 < 800) { return $col(07,Newbie) }
- if ($1 < 900) { return $col(07,Bad) }
- if ($1 < 1000) { return $col(07,Normal) }
- if ($1 < 1100) { return $col(03,Beginner) }
- if ($1 < 1300) { return $col(03,Good) }
- if ($1 < 1400) { return $col(08,Really good) }
- if ($1 < 1500) { return $col(10,Tryharder) }
- if ($1 < 1600) { return $col(04,Hacker) }
- if ($1 < 1700) { return $col(13,Godlike) }
- if ($1 < 1800) { return $col(04,Incredible) }
- if ($1 < 2000) { return $col(08,No life) }
- return $col(12,Pro)
- }
- alias setplus { if ($1 > 0) { return $+(+,$1) } | return $1 }
- alias setbob { return $+($col(14,$chr(40)),$1,/,$2,$col(14,$chr(41))) }
- alias setbob2 { return $+($col(14,$chr(40)),$1-,$col(14,$chr(41))) }
- alias setpct { return $+($col(07,$round($1,2)),$col(14,$chr(37))) }
- alias setpct2 { return $setbob2($setpct($1)) }
- alias setdays { if ($1 > 1000) { return $round($calc($1 /24),2) dage } | return $round($1,2) timer }
- alias removeip { if ($readini($gfile(gatherstatus.ini),info,ip) == $1) { remini -n $gfile(gatherstatus.ini) info } }
- alias chanmode { var %m = $left($2,1), %mo = $right($2,-1) | if ($me isop $1) && (((%m == -) && (%mo isincs $chan($1).mode)) || ((%m == +) && (%mo !isincs $chan($1).mode))) { mode $1 $+(%m,%mo) } }
- alias admincol { if ($gatherinfo(color_ $+ $adminid($1))) { return $ifmatch } | if ($1 isnum 10) { return 11 } | if ($1 isnum 9) { return 10 } | if ($1 isnum 8) { return 09 } | if ($1 isnum 5-7) { return 07 } | return }
- alias adminid { if ($1 isnum 10) { return Headadmin } | if ($1 isnum 9) { return Gatheradmin } | if ($1 isnum 8) { return Tryadmin } | if ($1 isnum 7) { return VIP } | if ($1 isnum 6) { return $iif(#gold == $mainchan,Donator,Sponsor) } | return 0 }
- alias admintype { if ($1 == Headadmin) { return 10 } | if ($1 == Gatheradmin) { return 9 } | if ($1 == Tryadmin) { return 8 } | if ($1 == VIP) { return 7 } | if ($1 == $iif(#gold == $mainchan,Donator,Sponsor)) { return 6 } | return 0 }
- alias upleft { return $+($upper($left($1,1)),$lower($right($1,-1))) }
- ;;SPECIAL;;
- alias cmd_tr {
- var %tr = $left($1,1), %cmd = $right($lower($gettok($1,1,32)),-1), %tr2 = $gettok($1,1,32), %cmd2 = $c_cmd($lower($gettok($1,2,32)))
- if ($istok(. $iif(#signfrag.* !iswm $mainchan,! - ?),%tr,32)) {
- if (%tmp.antiflood. [ $+ [ %cmd ] ] >= 5) && (!$istok(add sign,%cmd,32)) { inc -z %tmp.antiflood. [ $+ [ %cmd ] ] 3 | return 0 } | inc -z %tmp.antiflood. [ $+ [ %cmd ] ] 2 | return $iif(%cmd,%cmd,0)
- }
- elseif (%tr2 == $me) || (%tr2 == $gatherinfo(game)) { var %cmd = %cmd2
- if (%tmp.antiflood. [ $+ [ %cmd ] ] >= 5) && (!$istok(add sign,%cmd,32)) { inc -z %tmp.antiflood. [ $+ [ %cmd ] ] 3 | return 0 } | inc -z %tmp.antiflood. [ $+ [ %cmd ] ] 2 | return $iif(%cmd,%cmd,0)
- }
- return 0
- }
- alias c_cmd { return $remove($1,.,!,?,-) }
- alias c_text { return $replace($2-,:me:,$me,:gatherbot:,$me,:N:,$1,:NICK:,$1,:L:,$+(,$logo),:LOGO:,$+(,$logo),:S:,$split,:SPLIT:,$split,:K:,,:U:,,:B:,,:O:,,:END:,$col(end)) }
- alias r_text { return $replace($1-,$me,:me:,$logo,:LOGO:,$split,:SPLIT:,,:K:,,:U:,,:B:,,:O:) }
- ;;SPECIAL;;
- alias cmd_ingame { var %tr = $left($1,1), %cmd = $right($1,-1) | if ($istok(. $iif(#signfrag.* !iswm $mainchan,! - ?),%tr,32)) { return $iif(%cmd,%cmd,0) } | return 0 }
- alias ex_nr {
- var %l = $left($1,1), %num = $iif(%l == $chr(45),$right($1,-1),$1), %i = $len($gettok(%num,1,46)), %x = $len($gettok(%num,2,46)), %i = $calc(10 - %i), %x = $calc(2 - %x)
- return $+($iif(%l == $chr(45),$chr(45)),$str(0,%i),$gettok(%num,1,46),$chr(46),$gettok(%num,2,46),$str(0,%x))
- }
- alias bantime {
- if ($gatherinfo(leaveban_ $+ $1)) { var %nr = $ifmatch | return $calc(%nr * 60 * 60 + $ctime) }
- var %x = $calc($1 - 1) | while (%x >= 5) { if ($gatherinfo(leaveban_ $+ %x)) { var %nr = $ifmatch | return $calc(%nr * 60 * 60 + $ctime) } | dec %x }
- ;;SPECIAL;;
- if ($1 isnum 1) {
- if (#signfrag.* iswm $mainchan) { return $calc(1800 + $ctime) }
- if (#fragportal == $mainchan) { return $calc(3600 + $ctime) }
- return $calc(18000 + $ctime)
- }
- if ($1 isnum 2) {
- if (#signfrag.* iswm $mainchan) { return $calc(10800 + $ctime) }
- if (#fragportal == $mainchan) { return $calc(7200 + $ctime) }
- return $calc(36000 + $ctime)
- }
- if ($1 isnum 3) {
- if (#signfrag.* iswm $mainchan) { return $calc(21600 + $ctime) }
- if (#fragportal == $mainchan) { return $calc(18000 + $ctime) }
- return $calc(86400 + $ctime)
- }
- if ($1 isnum 4) {
- if (#signfrag.* iswm $mainchan) { return $calc(86400 + $ctime) }
- if (#fragportal == $mainchan) { return $calc(36000 + $ctime) }
- return $calc(172800 + $ctime)
- }
- if ($1 >= 5) {
- if (#signfrag.* iswm $mainchan) { return $calc(172800 + $ctime) }
- if (#fragportal == $mainchan) { return $calc(86400 + $ctime) }
- return $calc(259200 + $ctime)
- }
- if ($gatherinfo(leaveban_1)) { var %nr = $ifmatch | return $calc(%nr * 60 * 60 + $ctime) }
- if (#signfrag.* iswm $mainchan) { return $calc(1800 + $ctime) }
- if (#fragportal == $mainchan) { return $calc(3600 + $ctime) }
- return $calc(18000 + $ctime)
- }
- alias bancheck {
- if ($2 == leaver) || ($2 == leave) { var %t = $iif($readini($gfile(gatherstats.ini),$3,Leavebans),$ifmatch,1), %g = Leave Ban ( $+ %t $+ ), %t = $bantime(%t) }
- elseif ($2 == lamer) || ($2 == lame) { var %g = Lame Ban, %t = $iif($gatherinfo(lameban),$calc($ifmatch * 60 * 60 + $ctime),$calc(259200 + $ctime)) }
- elseif ($2 == perm) || ($2 == permanent) || ($2 == permenent) { var %g = Admin Ban, %t = Permanent } | elseif ($2 == cheater) || ($2 == cheat) { var %g = Cheater, %t = Permanent }
- elseif ($2 == egen) || ($2 == adminban) || ($2 == admin) && ($3 isnum) { var %g = Admin Ban, %t = $calc($calc((60 * 60) * $3) + $ctime) }
- else { return $false } | if ($1 == check) { return $true } | elseif ($1 == grund) || ($1 == type) { return %g } | elseif ($1 == tid) || ($1 == time) { return %t }
- }
- alias gatheradvtjek { if ($readini($gfile(gatherinfo.ini),adv,line1)) { return $true } | return $false }
- alias gatheradv {
- var %x = $iif($readini($gfile(gatherinfo.ini),previous,adv),$ifmatch,1)
- if (!$readini($gfile(gatherinfo.ini),previous,adv)) || (%x >= $ini($gfile(gatherinfo.ini),adv,0)) { writeini -n $gfile(gatherinfo.ini) previous adv 1 | return line1 }
- var %x = $calc(%x +1) | writeini -n $gfile(gatherinfo.ini) previous adv %x | return $+(line,%x)
- }
- alias gatherbans {
- var %i = 1, %x = $ini($gfile(gatherbans.ini),0), %m, %unban
- while (%i <= %x) { var %b = $ini($gfile(gatherbans.ini),%i), %t = $readini($gfile(gatherbans.ini),%b,tid)
- if (%t isnum) && (%t <= $ctime) {
- remini -n $gfile(gatherbans.ini) %b | var %nick = $anick(%b), %unban = 1
- if ($me ison $mainchan) { whatcmd $meorsay $mainchan $logo Gather ban on $iif(%nick,%nick,%b) has expired and can now play/start gathers on $mainchan again $logo }
- elseif ($me ison $privchan) { whatcmd $meorsay $privchan $logo Gather ban on $iif(%nick,%nick,%b) has expired and can now play/start gathers on $mainchan again $logo }
- if ($gatherinfo(php.exe)) { writeini -n $gfile($php.ini) unbans %b %b | .timerphp.exe -o 1 0 run $+(",$php.exe,") -f $+(",$mircdir,$gfile($php.file),") }
- }
- elseif (%t isnum) && ((%t < %m) || (!%m)) { var %m = %t, %w = %b }
- inc %i
- }
- var %i = 1, %x = $ini($gfile(teambans.ini),0)
- while (%i <= %x) { var %b = $ini($gfile(teambans.ini),%i), %t = $readini($gfile(teambans.ini),%b,tid)
- if (%t isnum) && (%t <= $ctime) {
- remini -n $gfile(teambans.ini) %b
- if ($me ison $mainchan) { whatcmd $meorsay $mainchan $logo Gather ban on team %b has expired and can now play/start gathers on $mainchan again $logo }
- elseif ($me ison $privchan) { whatcmd $meorsay $privchan $logo Gather ban on team %b has expired and can now play/start gathers on $mainchan again $logo }
- }
- elseif (%t isnum) && ((%t < %m) || (!%m)) { var %m = %t, %w = %b }
- inc %i
- }
- if (%m) && ($calc(%m - $ctime) < 500) { .timergatherbans -o 1 $calc(%m - $ctime +1) gatherbans } | else { .timergatherbans -o 0 300 gatherbans }
- if ($gatherinfo(mysql.exe)) && (%unban) { writeini -n $gfile(upload.ini) bans steamid all | .timer -o 1 0 run -p $+(",$mircdir,$gdir,MySQL.exe,") }
- }
- alias gatherdemotes {
- var %i = 1, %gfile = $gfile(gatherinfo.ini), %m, %promote
- while ($ini(%gfile,noleader,%i)) {
- var %s = $ifmatch, %n = $readini(%gfile,noleader,%s), %by = $gettok(%n,1,32), %date = $gettok(%n,2-,32), %time = $calc(3600 * 24 * 7), %ctime = $calc($ctime - $ctime(%date)), %left = $calc(%time - %ctime)
- if (%time <= %ctime) {
- remini -n %gfile noleader %s | var %promote = $iif(%promote,$+(%promote,$chr(44))) $iif($anick(%s),$ifmatch,%s)
- }
- elseif (%left > 0) && ((%left < %m) || (!%m)) { var %m = %left }
- inc %i
- }
- if (%promote) {
- if ($me ison $mainchan) { whatcmd $meorsay $mainchan $logo $iif($numtok(%promote,32) > 1,Demotes,Demote) on %promote has expired and can now be challenged/challenge others on $mainchan again $logo }
- elseif ($me ison $privchan) { whatcmd $meorsay $privchan $logo $iif($numtok(%promote,32) > 1,Demotes,Demote) on %promote has expired and can now be challenged/challenge others on $mainchan again $logo }
- }
- if (%m) && (%m < 500) { .timergatherdemotes -o 1 $calc(%m +1) gatherdemotes } | else { .timergatherdemotes -o 0 300 gatherdemotes }
- }
- alias gatherkickban {
- if ($readini($gfile(counter.ini),$1,$2)) { remini -n $gfile(counter.ini) $1 $2 | var %team = ct } | if ($readini($gfile(terrorist.ini),$1,$2)) { remini -n $gfile(terrorist.ini) $1 $2 | var %team = t }
- if ($readini($gfile(players.ini),$1,$2)) { remini -n $gfile(players.ini) $1 $2 | if (!$sameteam($score($1,total))) { fastsub $1 $iif(%team == ct,t,ct) 1 } | else { fastsub $1 %team 1 } }
- if (!$readini($gfile(gatherbans.ini),$2,tid)) {
- writeini -n $gfile(gatherbans.ini) $2 admin :gatherbot: | writeini -n $gfile(gatherbans.ini) $2 tid $iif($gatherinfo(kickban),$calc($ifmatch * 60 * 60 + $ctime),$calc(86400 + $ctime)) | writeini -n $gfile(gatherbans.ini) $2 type Kicked Ban
- writeini -n $gfile(gatherbans.ini) $2 grund You have been kicked ingame by an admin [Admin: $gauth($3) $+ $chr(93) | writeini -n $gfile(gatherbans.ini) $2 date $ctime
- if ($gatherinfo(php.exe)) { writeini -n $gfile($php.ini) bans $2 $2 | .timerphp.exe -o 1 0 run $+(",$php.exe,") -f $+(",$mircdir,$gfile($php.file),") }
- if ($gatherinfo(mysql.exe)) { writeini -n $gfile(upload.ini) bans steamid $2 | .timer -o 1 0 run -p $+(",$mircdir,$gdir,MySQL.exe,") }
- whatcmd $meorsay $mainchan $logo $anick($gauth($2)) got a kick ban, since he got kicked from server $serverid($1) $split Admin: $anick($gauth($3)) $logo
- .timer 1 0 gatherbans
- }
- }
- alias gathertimeout {
- if (!$sock($+($srcon.prefix, $1))) || ($istok(Free Offline Error Ended,$gatherstatus($1),32)) { return }
- var %gplayers = $gfile(players.ini), %gatherbans = $gfile(gatherbans.ini), %joined = $gfile(joined.ini), %gatherstatus = $gfile(gatherstatus.ini), %counter = $gfile(counter.ini), %terrorist = $gfile(terrorist.ini)
- var %i = 1, %min = 0, %ct = 0, %t = 0, %ct.s = $score($1,ct), %t.s = $score($1,t), %status = $serverstatus($1,clean), %admin = $readini(%gatherstatus,$1,gatheradmin), %ban = 0
- while (%i <= $ini(%gplayers,$1,0)) {
- var %x = $ini(%gplayers,$1,%i), %tid = $readini(%gplayers,$1,%x)
- if (!$readini(%joined,$1,%x)) && (%tid <= $ctime) { remini -n $gfile(players.ini) $1 %x | writeini -n $gfile(leavers.ini) $1 %x %x
- if ($readini(%counter,$1,%x)) { remini -n %counter $1 %x | inc %ct } | if ($readini(%terrorist,$1,%x)) { remini -n %terrorist $1 %x | inc %t }
- var %gamestats = $gamestatsini($1), %gpoints = $iif($readini(%gamestats,%x,Points),$ifmatch,0) | writeini -n %gamestats $1 Points %gpoints
- if ($gatherinfo(leavebans)) && (!$readini(%gatherbans,%x,tid)) { var %gatherstats = $gfile(gatherstats.ini), %ban = 1
- writeini -n %gatherstats %x Bans $calc($readini($gfile(gatherstats.ini),%x,bans) +1) | writeini -n %gatherstats %x Leavebans $calc($readini(%gatherstats,%x,leavebans) +1)
- writeini -n %gatherbans %x admin :gatherbot: | writeini -n %gatherbans %x tid $bancheck(tid,leaver,%x) | writeini -n %gatherbans %x type $bancheck(grund,leaver,%x)
- writeini -n %gatherbans %x grund Was not ingame before the time limit expired [Admin: $iif($gauth(%admin),$ifmatch,:gatherbot:) $+ $chr(93) | writeini -n $gfile(gatherbans.ini) %x date $ctime
- rconsend $1 say $gnick($gauth(%x)) got a leaver ban
- whatcmd $meorsay $mainchan $logo $anick($gauth(%x)) got a leaver ban, since he was not ingame on server $serverid($1) $split Gatheradmin: $anick($gauth(%admin)) $logo
- if ($gatherinfo(php.exe)) { writeini -n $gfile($php.ini) bans %x %x | .timerphp.exe -o 1 0 run $+(",$php.exe,") -f $+(",$mircdir,$gfile($php.file),") }
- }
- }
- else { inc %i | if (!$readini(%joined,$1,%x)) && (%tid isnum) && ((%tid < %min) || (!%min)) { var %min = %tid } }
- }
- if ($gatherinfo(mysql.exe)) && (%ban) { writeini -n $gfile(upload.ini) bans steamid all | .timer -o 1 0 run -p $+(",$mircdir,$gdir,MySQL.exe,") }
- if (%min) { .timertimeout. [ $+ [ $1 ] ] 1 $calc(%min - $ctime +1) gathertimeout $1 }
- if (%ct) || (%t) {
- gatherbans
- if (%t) { writeini -n %gatherstatus $1 t_subs $calc($readini(%gatherstatus,$1,t_subs) + %t) }
- if (%ct) { writeini -n %gatherstatus $1 ct_subs $calc($readini(%gatherstatus,$1,ct_subs) + %ct) }
- var %subs = $calc(%ct + %t) | rconsend $1 say Now searching for %subs sub(s) | submsg $1
- }
- if (!$readini(%gplayers,$1,%admin)) {
- var %i = 1 | while (%i <= $ini(%gplayers,$1,0)) { var %newadmin = $ini(%gplayers,$1,%i), %newauth = $gauth(%newadmin)
- if ($admin($+($chr(35),%newauth)) >= 8) { writeini -n %gatherstatus $1 gatheradmin %newadmin | rconsend $1 say New admin: $gnick($gauth(%newadmin)) | var %newadmin = found, %i = $ini(%gplayers,$1,0) } | inc %i
- }
- if (%newadmin != found) { var %newadmin = $ini(%gplayers,$1,1)
- if (%newadmin) { writeini -n %gatherstatus $1 gatheradmin %newadmin | rconsend $1 say New admin: $gnick($gauth(%newadmin)) }
- }
- }
- }
- alias ipbanned {
- if (!$1) { return $false }
- if ($readini($gfile(gatherbans.ini),$1,admin)) { return $1 }
- var %i = 1, %gatherbans = $gfile(gatherbans.ini) | while (%i <= $ini(%gatherbans,0)) { var %id = $ini(%gatherbans,%i), %ip = $readini($gfile(userdata.ini),%id,ipaddress) | if ($1 == %ip) { return %id } | inc %i }
- return $false
- }
- alias gatherleaver { var %ctimer = $+($1,.,$2)
- if ($timer(%ctimer).reps) {
- var %x = $ifmatch, %d = $timer(%ctimer).delay, %s = $timer(%ctimer).secs, %t = $iif(%x > 1,$calc((%x -1) * %d + %s),%s)
- whatcmd $meorsay $mainchan $logo Searching after a replace for $anick($2) on Server $+($chr(35),$serverid($1)) $logo Use .replace $+(<,$chr(35),$gauth($2),/,$2,>) within $duration(%t) $logo
- }
- elseif ($3) {
- var %sub = $iif($3 == ct,ct_subs,t_subs) | writeini -n $gfile(gatherstatus.ini) $1 %sub $calc($readini($gfile(gatherstatus.ini),$1,%sub) + 1)
- writeini -n $gfile(gatherstats.ini) $2 Bans $calc($readini($gfile(gatherstats.ini),$2,bans) +1) | writeini -n $gfile(gatherstats.ini) $2 Leavebans $calc($readini($gfile(gatherstats.ini),$2,leavebans) +1)
- writeini -n $gfile(gatherbans.ini) $2 admin :gatherbot: | writeini -n $gfile(gatherbans.ini) $2 tid $bancheck(tid,leaver,$2) | writeini -n $gfile(gatherbans.ini) $2 type $bancheck(grund,leaver,$2)
- writeini -n $gfile(gatherbans.ini) $2 grund No replace was found within 2 minutes | writeini -n $gfile(gatherbans.ini) $2 date $ctime
- if ($gatherinfo(php.exe)) { writeini -n $gfile($php.ini) bans $2 $2 | .timerphp.exe -o 1 0 run $+(",$php.exe,") -f $+(",$mircdir,$gfile($php.file),") }
- if ($gatherinfo(mysql.exe)) { writeini -n $gfile(upload.ini) bans steamid $2 | .timer -o 1 0 run -p $+(",$mircdir,$gdir,MySQL.exe,") }
- whatcmd $meorsay $mainchan $logo $anick($2) got a leaver ban, since no replace was found within 2 minutes $logo
- gatherbans | submsg $1
- }
- }
- alias gatherleavers {
- var %i = 1, %admin = $readini($gfile(gatherstatus.ini),$1,gatheradmin), %ban = 0
- while (%i <= $ini($gfile(players.ini),$1,0)) {
- var %z = $ini($gfile(players.ini),$1,%i)
- if (!$readini($gfile(joined.ini),$1,%z)) {
- remini -n $gfile(players.ini) $1 %z
- if ($readini($gfile(counter.ini),$1,%z)) { remini -n $gfile(counter.ini) $1 %z }
- if ($readini($gfile(terrorist.ini),$1,%z)) { remini -n $gfile(terrorist.ini) $1 %z }
- if ($gatherinfo(leavebans)) && (!$readini($gfile(gatherbans.ini),%z,tid)) {
- var %ban = 1
- writeini -n $gfile(gatherstats.ini) %z Bans $calc($readini($gfile(gatherstats.ini),%z,bans) +1) | writeini -n $gfile(gatherstats.ini) %z Leavebans $calc($readini($gfile(gatherstats.ini),%z,leavebans) +1)
- writeini -n $gfile(gatherbans.ini) %z admin :gatherbot: | writeini -n $gfile(gatherbans.ini) %z tid $bancheck(tid,leaver,%z) | writeini -n $gfile(gatherbans.ini) %z type $bancheck(grund,leaver,%z)
- writeini -n $gfile(gatherbans.ini) %z grund Was not ingame while checking for leavers [Admin: $iif($gauth(%admin),$ifmatch,:gatherbot:) $+ $chr(93)
- writeini -n $gfile(gatherbans.ini) %z date $ctime | writeini -n $gfile(leavers.ini) $1 %z %z
- whatcmd $meorsay $mainchan $logo $anick($gauth(%z)) got a leaver ban, since he was not ingame while .needsub on server $serverid($1) $iif(%admin,$split Gatheradmin: $anick($gauth(%admin)),) $logo
- .timeryes 1 0 gatherbans
- if ($gatherinfo(php.exe)) { writeini -n $gfile($php.ini) bans %z %z | .timerphp.exe -o 1 0 run $+(",$php.exe,") -f $+(",$mircdir,$gfile($php.file),") }
- }
- }
- else { inc %i }
- }
- if ($gatherinfo(mysql.exe)) && (%ban) { writeini -n $gfile(upload.ini) bans steamid all | .timer -o 1 0 run -p $+(",$mircdir,$gdir,MySQL.exe,") }
- if (!$readini($gfile(players.ini),$1,%admin)) {
- var %i = 1 | while (%i <= $ini($gfile(players.ini),$1,0)) { var %newadmin = $ini($gfile(players.ini),$1,%i), %newauth = $gauth(%newadmin)
- if ($admin($+($chr(35),%newauth)) >= 8) { writeini -n $gfile(gatherstatus.ini) $1 gatheradmin %newadmin | rconsend $1 say New admin: $gnick($gauth(%newadmin)) | var %newadmin = found, %i = $ini($gfile(players.ini),$1,0) } | inc %i
- }
- if (%newadmin != found) { var %newadmin = $ini($gfile(players.ini),$1,1)
- if (%newadmin) { writeini -n $gfile(gatherstatus.ini) $1 gatheradmin %newadmin | writeini -n $gfile(gatherstatus.ini) $1 type Public | rconsend $1 say New admin: $gnick($gauth(%newadmin)) }
- }
- }
- }
- alias tjeksteamid {
- var %id = $upper($strip($1)), %tjek = $gettok(%id,1,95)
- if (%tjek != STEAM) { var %id = $+(STEAM_,%id) }
- if ($gatherinfo(game) == CS:GO) { var %id = $replace(%id,STEAM_0,STEAM_1) }
- var %tjek = $gettok(%id,2-,95), %check = $gettok(%tjek,1,58), %check2 = $gettok(%tjek,2,58), %check3 = $gettok(%tjek,3,58)
- if (%check !isnum) || (%check2 !isnum) || (%check3 !isnum) { return $false }
- if (!$regex(%id,\STEAM_[0-1]{1}:[0-1]{1}:[0-9][0-9][0-9]+)) { return $false }
- if ($gatherinfo(game) == CS:GO) && (!$regex(%id,\STEAM_[1]{1}:[0-1]{1}:[0-9][0-9][0-9]+)) { return $false }
- return %id
- }
- alias findsid { var %i = 1 | while (%i <= $ini($gfile(gatherservers.ini),0)) { var %ip = $ini($gfile(gatherservers.ini),%i)) | if ($readini($gfile(players.ini),%ip,$1)) { if ($serverstatus(%ip,ingame)) { return %ip } } | inc %i } | return $false }
- alias findteam { var %i = 1 | while (%i <= $ini($gfile(gatherservers.ini),0)) { var %ip = $ini($gfile(gatherservers.ini),%i)) | if ($readini($gfile(players.ini),%ip,$1)) { if ($serverstatus(%ip,ingame)) { return $iif($readini($gfile(counter.ini),%ip,$1),CT,TERRORIST) } } | inc %i } | return $false }
- alias findlastnick {
- var %i = 1, %readn = 1, %ids
- while ($read($gfile(userdata.ini),w,$+(lastnick=,$1),%readn)) {
- var %readn = $calc($readn +1), %x = $calc(%readn -2), %id
- while (!%id) { var %line = $read($gfile(userdata.ini),%x) | dec %x
- if (*STEAM_*:*:* iswm %line) { var %id = $remove(%line,$chr(91),$chr(93)), %ids = %ids %id }
- }
- if ($numtok(%ids,32) > 30) { return %ids }
- }
- return $iif(%ids,%ids,0)
- }
- alias findlastnick {
- if ($read($gfile(userdata.ini),w,$+(lastnick=,$1))) {
- var %i = $calc($readn -1), %id | while (!%id) { var %line = $read($gfile(userdata.ini),%i) | dec %i
- if (*STEAM_*:*:* iswm %line) { var %id = $remove(%line,$chr(91),$chr(93)) | return %id }
- }
- return %id
- }
- return 0
- }
- alias findingame {
- var %i = 1, %readn = 1, %ids
- while ($read($gfile(userdata.ini),w,$+(ingamenick=,$1),%readn)) {
- var %readn = $calc($readn +1), %x = $calc(%readn -2), %id
- while (!%id) { var %line = $read($gfile(userdata.ini),%x) | dec %x
- if (*STEAM_*:*:* iswm %line) { var %id = $remove(%line,$chr(91),$chr(93)), %ids = %ids %id }
- }
- if ($numtok(%ids,32) > 30) { return %ids }
- }
- return $iif(%ids,%ids,0)
- }
- alias findingame {
- if ($read($gfile(userdata.ini),w,$+(ingamenick=,$1-))) {
- var %i = $calc($readn -1), %id | while (!%id) { var %line = $read($gfile(userdata.ini),%i) | dec %i
- if (*STEAM_*:*:* iswm %line) { var %id = $remove(%line,$chr(91),$chr(93)) | return %id }
- }
- return %id
- }
- return 0
- }
- alias findip {
- if ($read($gfile(userdata.ini),w,$+(ipaddress=,$1-))) {
- var %i = $calc($readn -1), %id | while (!%id) { var %line = $read($gfile(userdata.ini),%i) | dec %i
- if (*STEAM_*:*:* iswm %line) { var %id = $remove(%line,$chr(91),$chr(93)) | return %id }
- }
- return %id
- }
- return 0
- }
- alias findmap {
- if ($1) && ($1 !isnum) {
- if ($readini($gfile(gatherinfo.ini),maps,$1)) || ($ini($gfile(gatherinfo.ini),maps,$1)) { return $lower($1) }
- var %i = 1 | while (%i <= $ini($gfile(gatherinfo.ini),maps,0)) { var %x = $ini($gfile(gatherinfo.ini),maps,%i) | if ($+(*_,$1) iswm %x) || ($+(*_,$1,_*) iswm %x) { return %x } | inc %i }
- }
- return 0
- }
- alias serverid {
- if ($1 == check) { if ($2 isnum) && ($ini($gfile(gatherservers.ini),$2)) { return $true } | return $false }
- elseif ($1 == get) { if ($2 isnum) && ($ini($gfile(gatherservers.ini),$2)) { return $ini($gfile(gatherservers.ini),$2) } | return 0 }
- var %i = 1 | while (%i <= $ini($gfile(gatherservers.ini),0)) { if ($ini($gfile(gatherservers.ini),%i) == $1) { return %i } | inc %i } | return 0
- }
- alias serveridd {
- var %i = 1 | while (%i <= $ini($gfile(gatherservers.ini),0)) { if ($ini($gfile(gatherservers.ini),%i) == $1) { return $+($chr(35),%i) } | inc %i } | return $1
- }
- alias massop { if ($me isop $1) { var %i = 2, %x = $nick($1,0) | while (%i <= %x) { var %nick = $nick($1,%i) | if (%nick != $Qbot) && (%nick != S) && (%nick != $me) && ($nick !isop $1) { $iif($script(pushmode.mrc),pushmode -l,putmode) $1 +o %nick } | inc %i } } }
- alias massdeop { if ($me isop $1) { var %i = 2, %x = $nick($1,0) | while (%i <= %x) { var %nick = $nick($1,%i) | if (%nick != $Qbot) && (%nick != S) && (%nick != $me) && ($nick isop $1) { $iif($script(pushmode.mrc),pushmode -l,putmode) $1 -o %nick } | inc %i } } }
- alias putmode {
- var %m2 = $null, %chan = $1, %mo = $left($2,1), %de = $gettok($gettok($right($2,-1),1,45),1,43), %nicks = $gettok($3-,1- $len(%de),32), %i = 1, %x = next, %time = 800 | while (%x == next) {
- if ($timer(putmode [ $+ [ %i ] ]).com) {
- var %timer = $ifmatch, %c = $gettok(%timer,2,32), %m = $left($gettok(%timer,3,32),1), %d = $right($gettok(%timer,3,32),-1), %n = $gettok(%timer,4-,32), %y = 1, %yy = %nicks
- while (%y <= $numtok(%yy,32)) { var %yn = $gettok(%yy,%y,32) | if ($istok(%n,%yn,32)) { var %nicks = $remtok(%nicks,%yn,32), %de = $right(%de,-1) } | inc %y }
- if (!%nicks) || (!%de) { var %x = end } | elseif (%chan == %c) && (%mo == %m) && ($calc($len(%de) + $len(%d)) <= 5) { .timerputmode [ $+ [ %i ] ] -m 1 %time whatcmd mode %c $+(%m,%d,%de) %n %nicks | var %x = found }
- }
- else { .timerputmode [ $+ [ %i ] ] -m 1 %time whatcmd mode $1- | var %x = found } | if (%time < 2000) { inc %time 800 } | else { inc %time 1200 } | inc %i
- }
- }
- alias newsteamid {
- var %i = 1 | while (%i <= $ini($gfile(gatherservers.ini),0)) { var %ipp = $ini($gfile(gatherservers.ini),%i), %gamestats = $gamestatsini(%ipp)
- if ($readini($gfile(gatherstatus.ini),%ipp,gatheradmin) == $1) { writeini -n $gfile(gatherstatus.ini) %ipp gatheradmin $2 }
- if ($readini($gfile(gatherstatus.ini),%ipp,challenger) == $1) { writeini -n $gfile(gatherstatus.ini) %ipp challenger $2 }
- if ($readini($gfile(gatherstatus.ini),%ipp,challenged) == $1) { writeini -n $gfile(gatherstatus.ini) %ipp challenged $2 }
- if ($readini($gfile(players.ini),%ipp,$1)) { remini -n $gfile(players.ini) %ipp $1 | writeini -n $gfile(players.ini) %ipp $2 $2 }
- if ($readini($gfile(counter.ini),%ipp,$1)) { var %s = $ifmatch | remini -n $gfile(counter.ini) %ipp $1 | writeini -n $gfile(counter.ini) %ipp $2 %s }
- if ($readini($gfile(terrorist.ini),%ipp,$1)) { var %s = $ifmatch | remini -n $gfile(terrorist.ini) %ipp $1 | writeini -n $gfile(terrorist.ini) %ipp $2 %s }
- if ($readini($gfile(joined.ini),%ipp,$1)) { var %s = $ifmatch | remini -n $gfile(joined.ini) %ipp $1 | writeini -n $gfile(joined.ini) %ipp $2 %s }
- if ($ini(%gamestats,$1)) { var %x = 1 | while (%x <= $ini(%gamestats,$1,0)) { var %s = $ini(%gamestats,$1,%x), %r = $readini(%gamestats,$1,%s) | writeini -n %gamestats $2 %s %r | inc %x } | remini -n %gamestats $1 }
- inc %i
- }
- if ($read(ingamenicks.dat,s,$1)) { var %ingame = $gettok($ifmatch,2-,32) | write -ds $+ $1 ingamenicks.dat | write ingamenicks.dat $2 %ingame }
- if ($read($gfile(gatherusers.dat),w,* $1)) { var %auth = $gettok($ifmatch,1,32) | write -ds $+ %auth $gfile(gatherusers.dat) | write $gfile(gatherusers.dat) %auth $2 }
- if ($read($gfile(authed.dat),w,* $1)) { var %nick = $gettok($ifmatch,1,32), %auth = $gettok($ifmatch,2,32) | write -ds $+ %nick $gfile(authed.dat) | write $gfile(authed.dat) %nick %auth $2 }
- if ($ini($gfile(userdata.ini),$1)) { var %x = 1 | while (%x <= $ini($gfile(userdata.ini),$1,0)) { var %s = $ini($gfile(userdata.ini),$1,%x), %r = $readini($gfile(userdata.ini),$1,%s) | writeini -n $gfile(userdata.ini) $2 %s %r | inc %x } | remini -n $gfile(userdata.ini) $1 }
- if ($ini($gfile(wepstats.ini),$1)) { var %x = 1 | while (%x <= $ini($gfile(wepstats.ini),$1,0)) { var %s = $ini($gfile(wepstats.ini),$1,%x), %r = $readini($gfile(wepstats.ini),$1,%s) | writeini -n $gfile(wepstats.ini) $2 %s %r | inc %x } | remini -n $gfile(wepstats.ini) $1 }
- if ($ini($gfile(hitstats.ini),$1)) { var %x = 1 | while (%x <= $ini($gfile(hitstats.ini),$1,0)) { var %s = $ini($gfile(hitstats.ini),$1,%x), %r = $readini($gfile(hitstats.ini),$1,%s) | writeini -n $gfile(hitstats.ini) $2 %s %r | inc %x } | remini -n $gfile(hitstats.ini) $1 }
- if ($ini($gfile(gatherstats.ini),$1)) { var %x = 1 | while (%x <= $ini($gfile(gatherstats.ini),$1,0)) { var %s = $ini($gfile(gatherstats.ini),$1,%x), %r = $readini($gfile(gatherstats.ini),$1,%s) | writeini -n $gfile(gatherstats.ini) $2 %s %r | inc %x } | remini -n $gfile(gatherstats.ini) $1 }
- if ($ini($gfile(clutchstats.ini),$1)) { var %x = 1 | while (%x <= $ini($gfile(clutchstats.ini),$1,0)) { var %s = $ini($gfile(clutchstats.ini),$1,%x), %r = $readini($gfile(clutchstats.ini),$1,%s) | writeini -n $gfile(clutchstats.ini) $2 %s %r | inc %x } | remini -n $gfile(clutchstats.ini) $1 }
- if ($ini($gfile(gatherbans.ini),$1)) { var %x = 1 | while (%x <= $ini($gfile(gatherbans.ini),$1,0)) { var %s = $ini($gfile(gatherbans.ini),$1,%x), %r = $readini($gfile(gatherbans.ini),$1,%s) | writeini -n $gfile(gatherbans.ini) $2 %s %r | inc %x } | remini -n $gfile(gatherbans.ini) $1 }
- return $true
- }
- alias votemap {
- if (($gatherstatus(signup)) || ($gatherstatus(pick))) { var %ip = $gatherstatus(ip), %id = $serverid(%ip), %votemap = $+(votemap_,%id), %map = $gatherstatus(%ip,map)
- if ($ini($gfile(voting.ini),%votemap)) {
- if ($timer(votemap).reps >= 1) {
- whatcmd $meorsay $iif($me ison $1,$1,$mainchan) $logo Votemap in progress $logo Use: .vote <map> - to vote for a map $split Example: .vote %map $+ $logo
- }
- else {
- if ($ini($gfile(voting.ini),mapresult,0)) { remini -n $gfile(voting.ini) mapresult }
- var %i = 1 | while (%i <= $ini($gfile(voting.ini),%votemap,0)) {
- var %x = $ini($gfile(voting.ini),%votemap,%i), %r = $readini($gfile(voting.ini),%votemap,%x) | writeini -n $gfile(voting.ini) mapresult %r $calc($readini($gfile(voting.ini),mapresult,%r) +1) | inc %i
- }
- var %i = 1, %last = 0, %lastnr = 0, %votes = 0, %maps | while (%i <= $ini($gfile(voting.ini),mapresult,0)) {
- var %x = $ini($gfile(voting.ini),mapresult,%i), %r = $readini($gfile(voting.ini),mapresult,%x), %votes = $calc(%votes + %r), %maps = $iif(%maps,$ifmatch $split) $+(%x,:) %r
- if (%r > %lastnr) { var %last = %x, %lastnr = %r } | elseif (%r == %lastnr) { var %last = 0 } | inc %i
- }
- if ($ini($gfile(voting.ini),%votemap)) { remini -n $gfile(voting.ini) %votemap }
- if ($ini($gfile(voting.ini),mapresult,0)) { remini -n $gfile(voting.ini) mapresult }
- if (%maps) {
- if (%last) { var %total = $calc(100 / %votes), %pct = $round($calc(%total * %lastnr),2)
- if (%last != %map) {
- writeini -n $gfile(gatherstatus.ini) %ip map %last
- whatcmd $meorsay $iif($me ison $1,$1,$mainchan) $logo Votemap is over $logo %maps $logo Changing map from %map to %last $+ $+ $col(14,$chr(40),07) $+ %pct $+ $col(14,$+($chr(37),$chr(41))) with most votes $logo
- }
- else {
- whatcmd $meorsay $iif($me ison $1,$1,$mainchan) $logo Votemap is over $logo %maps $logo Since there is most votes on the current map, it stays %last $+ $+ $col(14,$chr(40),07) $+ %pct $+ $col(14,$+($chr(37),$chr(41))) with most votes $logo
- }
- }
- else { whatcmd $meorsay $iif($me ison $1,$1,$mainchan) $logo Votemap is over $logo %maps $logo Since there is no map with most votes, map stays on %map $+ $logo }
- }
- else { whatcmd $meorsay $iif($me ison $1,$1,$mainchan) $logo Votemap is over $logo Since there has been no votes, map stays on %map $+ $logo }
- }
- }
- elseif ($timer(votemap)) { .timervotemap off }
- }
- else {
- if ($timer(votemap)) { .timervotemap off }
- var %i = 1 | while ($serverid(get,%i)) { var %ip = $ifmatch, %votemap = $+(votemap_,%i) | if ($ini($gfile(voting.ini),%votemap)) { remini -n $gfile(voting.ini) %votemap } | inc %i }
- }
- }
- ;#################################### Alias to search for subsitutes ##########################################;
- alias needsub {
- var %i = 1, %x = $ini($gfile(players.ini),$1,0), %ct = 0, %t = 0 | while (%i <= %x) {
- var %z = $ini($gfile(players.ini),$1,%i) | if (!$readini($gfile(joined.ini),$1,%z)) { if ($readini($gfile(counter.ini),$1,%z)) { inc %ct } | elseif ($readini($gfile(terrorist.ini),$1,%z)) { inc %t } } | inc %i
- }
- if (%ct) || (%t) {
- if (%t) { writeini -n $gfile(gatherstatus.ini) $1 t_subs $calc($readini($gfile(gatherstatus.ini),$1,t_subs) + %t) }
- if (%ct) { writeini -n $gfile(gatherstatus.ini) $1 ct_subs $calc($readini($gfile(gatherstatus.ini),$1,ct_subs) + %ct) }
- var %subs = $calc(%ct + %t) | rconsend $1 say Now searching for %subs sub(s) | if (!$timer(submsg)) { submsg $1 } | gatherleavers $1
- }
- else { rconsend $1 say There is no one to search sub for }
- }
- alias subtjek {
- var %x = $ini($gfile(players.ini),$1,0), %ct = $ini($gfile(counter.ini),$1,0), %t = $ini($gfile(terrorist.ini),$1,0), %i = $calc(%ct + %t), %slots = $iif($readini($gfile(gatherstatus.ini),$1,slots),$ifmatch,%x), %total = $calc(%ct + %t)
- if ($1) && ($calc(%slots - %total - $calc($readini($gfile(gatherstatus.ini),$1,ct_subs) + $readini($gfile(gatherstatus.ini),$1,t_subs))) >= 1) { return $true } | return $false
- }
- alias seeksub {
- if ($subtjek($1)) {
- var %ct = $ini($gfile(counter.ini),$1,0), %t = $ini($gfile(terrorist.ini),$1,0), %i = $calc(%ct + %t), %slots = $iif($readini($gfile(gatherstatus.ini),$1,slots),$ifmatch,$ini($gfile(players.ini),$1,0)), %ct.s = 0, %t.s = 0
- while (%i < %slots) { if (%ct < %t) { inc %ct.s } | else { inc %t.s } | inc %i } | if (%ct.s) || (%t.s) {
- if (%t.s) { writeini -n $gfile(gatherstatus.ini) $1 t_subs $calc($readini($gfile(gatherstatus.ini),$1,t_subs) + %t.s) }
- if (%ct.s) { writeini -n $gfile(gatherstatus.ini) $1 ct_subs $calc($readini($gfile(gatherstatus.ini),$1,ct_subs) + %ct.s) }
- var %subs = $calc(%ct.s + %t.s) | rconsend $1 say Now searching for %subs sub(s) | if (!$timer(submsg)) { submsg $1 }
- }
- else { rconsend $1 say There is no room for more than %slots players }
- }
- else { rconsend $1 say There is no room for more than $iif($readini($gfile(gatherstatus.ini),$1,slots),$ifmatch,$ini($gfile(players.ini),$1,0)) players }
- }
- alias fastsub {
- if (($2 == ct) || ($2 == t)) && ($3 isnum) && ($3 != 0) {
- if ($calc($readini($gfile(gatherstatus.ini),$1,ct_subs) + $readini($gfile(gatherstatus.ini),$1,t_subs) + $3) < 9) {
- if (!$sameteam($score($1,total))) { var %ini = $+($iif($2 == ct,t,ct),_subs) } | else { var %ini = $+($2,_subs) }
- writeini -n $gfile(gatherstatus.ini) $1 %ini $calc($readini($gfile(gatherstatus.ini),$1,%ini) + $3) | rconsend $1 say Now searching for $3 sub(s) | if (!$timer(submsg)) { submsg $1 }
- }
- else { rconsend $1 say Cant search more than 9 subs at once }
- }
- }
- alias endsub {
- if ($readini($gfile(gatherstatus.ini),$1,t_subs)) { remini -n $gfile(gatherstatus.ini) $1 t_subs | var %endsub = ended } | if ($readini($gfile(gatherstatus.ini),$1,ct_subs)) { remini -n $gfile(gatherstatus.ini) $1 ct_subs | var %endsub = ended }
- if (%endsub == ended) { rconsend $1 say Substitute search ended | whatcmd $meorsay $mainchan $logo Substitute search on server $serverid($1) got ended by $anick($2) $logo } | else { rconsend $1 say There is no subsitute search now }
- }
- alias csjoins { var %i = 1, %ct = 0, %t = 0 | while (%i <= $ini($gfile(joined.ini),$1,0)) { var %x = $ini($gfile(joined.ini),$1,%i) | if ($readini($gfile(counter.ini),$1,%x)) { inc %ct } | elseif ($readini($gfile(terrorist.ini),$1,%x)) { inc %t } | inc %i } return $iif($2 == ct,%ct,%t) }
- alias mostsigns { var %i = 1, %ct = 0, %t = 0 | while (%i <= $ini($gfile(counter.ini),$1,0)) || (%i <= $ini($gfile(terrorist.ini),$1,0)) { if ($ini($gfile(counter.ini),$1,%i)) { inc %ct } | if ($ini($gfile(terrorist.ini),$1,%i)) { inc %t } | inc %i } | return $iif($2 == ct,%ct,%t) }
- alias addsub {
- if ($gatherstatus(sub)) {
- var %ip = $ifmatch, %ip2 = %ip, %id, %forceteam
- if ($2 isnum) { var %id = $2, %ip2 = $ini($gfile(gatherservers.ini),%id) | if ($3 == T) || ($3 == CT) { var %forceteam = $3 } } | elseif ($2 == T) || ($2 == CT) { var %forceteam = $2 }
- if ($serverstatus(%ip2,sub)) { var %ip = %ip2 }
- if (!$readini($gfile(players.ini),%ip,$1)) {
- var %ct.subs = $iif($readini($gfile(gatherstatus.ini),%ip,ct_subs),$ifmatch,0), %t.subs = $iif($readini($gfile(gatherstatus.ini),%ip,t_subs),$ifmatch,0)
- var %ct.score = $score(%ip,ct), %t.score = $score(%ip,t), %total = $score(%ip,total)
- if (%forceteam) && (!$sameteam(%total)) { var %forceteam = $iif(%forceteam == CT,T,CT) }
- if (%ct.subs) && (%t.subs) {
- if (%forceteam) && (% [ $+ [ %forceteam ] $+ ] .subs) { var %team = %forceteam, %ini = $iif(%team == CT,$gfile(counter.ini),$gfile(terrorist.ini)) }
- elseif (%ct.subs > %t.subs) { var %team = CT, %ini = $gfile(counter.ini) } | elseif (%t.subs > %ct.subs) { var %team = T, %ini = $gfile(terrorist.ini) }
- elseif (%ct.score > %t.score) { var %team = T, %ini = $gfile(terrorist.ini) } | else { var %team = CT, %ini = $gfile(counter.ini) }
- }
- elseif (%ct.subs) { var %team = CT, %ini = $gfile(counter.ini) } | else { var %team = T, %ini = $gfile(terrorist.ini) }
- if (%team == CT) { dec %ct.subs | if (%ct.subs >= 1) { writeini -n $gfile(gatherstatus.ini) %ip ct_subs %ct.subs } | else { remini -n $gfile(gatherstatus.ini) %ip ct_subs } }
- elseif (%team == T) { dec %t.subs | if (%t.subs >= 1) { writeini -n $gfile(gatherstatus.ini) %ip t_subs %t.subs } | else { remini -n $gfile(gatherstatus.ini) %ip t_subs } }
- writeini -n $gfile(players.ini) %ip $1 $calc($ctime +300) | writeini -n %ini %ip $1 $1 | if ($readini($gfile(kicked.ini),%ip,$1)) { remini -n $gfile(kicked.ini) %ip $1 } | msgnick %ip $1
- writeini -n $gfile(gatherstats.ini) $1 Subs $calc($gatherstats($1,Subs) +1)
- whatcmd $meorsay $mainchan $logo $anick($gauth($1)) was added as substitute (Team: $iif(%team == CT,$col(11,%team),$col(04,%team)) $+ ) and info is sent to the player $split Server $+($chr(35),,$serverid(%ip),) $logo
- rconsend %ip say $gnick($gauth($1)) joins as substitute (Team: $iif($sameteam(%total),%team,$iif(%team = CT,T,CT)) $+ ) | gathertimeout %ip
- var %admin = $readini($gfile(gatherstatus.ini),%ip,gatheradmin), %adminauth = $gauth(%admin), %adminlevel = $admin($+($chr(35),%adminauth)), %alevel = $admin($+($chr(35),%auth))
- if (%adminlevel < 8) && (%alevel > %adminlevel) { writeini -n $gfile(gatherstatus.ini) %ip gatheradmin %id | rconsend %ip say New admin: $gnick(%auth) }
- if ($gatherstatus(signout)) {
- var %ipp = $gatherstatus(ip), %added = $gatherstatus(%ipp,added), %steamid = $1, %type = $gatherstatus(%ipp,type), %ga = $gatherstatus(%ipp,gatheradmin), %cl1 = $gatherstatus(%ipp,challenger), %cl2 = $gatherstatus(%ipp,challenged)
- if ($readini($gfile(players.ini),%ipp,%steamid)) && (!$gatherstatus(%ip,clstatus)) {
- if (%type == Challenge) && ((%steamid == %cl1) || (%steamid == %cl2)) { resetall %ipp | .timeradded 1 0 whatcmd $meorsay $mainchan $logo $anick($gauth($1)) got added as substitute, the gather is therefore stopped $logo | .timerendsignup off }
- elseif (%added > 1) { remini -n $gfile(players.ini) %ipp %steamid | endsigntimer %type
- if (%ga == %steamid) {
- var %i = 1 | while (%i <= $ini($gfile(players.ini),%ipp,0)) {
- var %newadmin = $ini($gfile(players.ini),%ipp,%i), %newauth = $gauth(%newadmin)
- if ($admin($+($chr(35),%newauth)) >= 8) { writeini -n $gfile(gatherstatus.ini) %ipp gatheradmin %newadmin | var %newadmin = found, %i = $ini($gfile(players.ini),%ipp,0) }
- inc %i
- }
- if (%newadmin != found) { var %newadmin = $ini($gfile(players.ini),%ipp,1) | writeini -n $gfile(gatherstatus.ini) %ipp gatheradmin %newadmin | writeini -n $gfile(gatherstatus.ini) %ipp type Public }
- }
- endsigntimer $gatherstatus(%ipp,type)
- }
- else { resetall %ipp | whatcmd $meorsay $mainchan $logo $anick($gauth($1)) got added as substitute, the gather is therefore stopped $logo | .timerendsignup off }
- }
- }
- }
- else {
- whatcmd $meorsay $mainchan $logo $anick($1) is already signed up on server $+($chr(35),$serverid(%ip)) $logo
- }
- }
- }
- alias submsg {
- if ($1) {
- var %ct = $iif($readini($gfile(gatherstatus.ini),$1,ct_subs),$ifmatch,0), %t = $iif($readini($gfile(gatherstatus.ini),$1,t_subs),$ifmatch,0), %subs = $calc(%ct + %t), %map = $readini($gfile(gatherstatus.ini),$1,map) | if (%subs) {
- if (!$sameteam($score($1,total))) { var %x = %ct, %ct = %t, %t = %x, %s.ct = $score($1,ct), %s.t = $score($1,t) } | else { var %s.ct = $score($1,ct), %s.t = $score($1,t) }
- whatcmd $meorsay $mainchan $logo Searching for %subs sub(s) on server $serverid($1) $logo $col(11,CT:) %s.ct $col(04,T:) %s.t $logo Map: %map $+ $logo Use: .addsub %i - to sign as substitute $logo
- }
- elseif ($timer(submsg. [ $+ [ $1 ] ])) { .timersubmsg. [ $+ [ $1 ] ] off }
- }
- else {
- var %i = 1, %seeksub = 0 | while (%i <= $ini($gfile(gatherservers.ini),0)) {
- var %ip = $ini($gfile(gatherservers.ini),%i), %ct = $iif($readini($gfile(gatherstatus.ini),%ip,ct_subs),$ifmatch,0), %t = $iif($readini($gfile(gatherstatus.ini),%ip,t_subs),$ifmatch,0), %subs = $calc(%ct + %t), %map = $readini($gfile(gatherstatus.ini),%ip,map) | if (%subs) {
- inc %seeksub | if (!$sameteam($score($1,total))) { var %x = %ct, %ct = %t, %t = %x, %s.ct = $score(%ip,ct), %s.t = $score(%ip,t) } | else { var %s.ct = $score(%ip,ct), %s.t = $score(%ip,t) }
- whatcmd $meorsay $mainchan $logo Searching for %subs sub(s) on server %i $logo $col(11,CT:) %s.ct $col(04,T:) %s.t $logo Map: %map $+ $logo Use: .addsub %i - to sign as substitute $logo
- }
- elseif ($timer(submsg. [ $+ [ %ip ] ])) { .timersubmsg. [ $+ [ %ip ] ] off } | inc %i
- }
- if (!%seeksub) && ($timer(submsg)) { .timersubmsg off }
- }
- }
- ;#################################### Aliases to reset servers, signup etc ##########################################
- alias endsigntimer {
- ;;SPECIAL;;
- if (#signfrag.* iswm $mainchan) || (#CSGO.hu == $mainchan) {
- if ($1 == Challenge) { .timerendsignup 2 150 endsignup } | else { .timerendsignup 2 60 endsignup }
- }
- elseif (#kosegather == $mainchan) {
- .timerendsignup 2 900 endsignup
- }
- elseif ($1 == Challenge) { .timerendsignup 2 $calc($gatherinfo(timetoabortcl) * 30) endsignup } | else { .timerendsignup 2 $calc($gatherinfo(timetoabortsg) * 30) endsignup }
- }
- alias endsignup {
- if ($gatherstatus(signup)) {
- var %ip = $ifmatch, %type = $gatherstatus(%ip,type), %d = $timer(endsignup).delay, %time = $duration($calc(%d * 2))
- if ($timer(endsignup).reps) {
- var %x = $ifmatch, %s = $timer(endsignup).secs, %t = $iif(%x > 1,$calc((%x -1) * %d + %s),%s)
- whatcmd $meorsay $mainchan $logo $col(04,Warning:) The gather signup will be aborted in $duration(%t) $split Can be extended with .sign; .out; .extend $logo
- }
- else {
- resetall %ip | whatcmd settopic | whatcmd $meorsay $mainchan $logo The gather signup have been inactive for %time and is therefore stopped $logo
- }
- }
- elseif ($timer(endsignup)) { .timerendsignup off }
- }
- alias clrejectimer {
- if ($2 == all) { .timerchallenge 2 $calc($gatherinfo(timetoacceptall) * 30) clreject $1 } | else { .timerchallenge 2 $calc($gatherinfo(timetoaccept) * 30) clreject $1 }
- }
- alias clreject {
- if ($gatherstatus(accept)) {
- var %accept = $ifmatch, %ip = $gatherstatus(ip), %csteamid = $readini($gfile(gatherstatus.ini),%ip,challenger), %cauth = $gauth(%csteamid), %cnick = $anick(%cauth), %map = $readini($gfile(gatherstatus.ini),%ip,map), %slots = $readini($gfile(gatherstatus.ini),%ip,slots), %chan = $iif($me ison $1,$1,$iif($me ison $mainchan,$mainchan,$iif($me ison $privchan,$privchan,$ownerchan))), %d = $timer(challenge).delay, %time = $duration($calc(%d * 2)), %region = $readini($gfile(gatherstatus.ini),%ip,region)
- if ($timer(challenge).reps) {
- var %x = $ifmatch, %s = $timer(challenge).secs, %t = $iif(%x > 1,$calc((%x -1) * %d + %s),%s)
- whatcmd $meorsay %chan $logo $col(04,Warning:) %cnick has challenged $iif(%accept == All,You?,$anick(%accept) $+ ) $iif(%slots == 2,for a 1v1) $split $iif($gatherinfo(regions),Region: $+(,%region,) $split) Map: %map $+ $logo $iif(%accept == All,Anyone can use .accept ,Use .accept or .reject) $col(14,$chr(40)) $+ $duration(%t) $+ $col(14,$chr(41)) $logo
- }
- else {
- remini -n $gfile(gatherstatus.ini) %ip accept | resetall %ip | whatcmd $meorsay %chan $logo Challenge accept timeout after %time $logo %cnick had challenged $iif(%accept == All,All,$anick(%accept)) on %map $+ , but did not get accepted $col(14,$chr(40)) $+ .accept $+ $col(14,$chr(41)) $logo | .timerendsignup off
- }
- }
- elseif ($timer(challenge)) { .timerchallenge off }
- }
- alias resetserver {
- var %id = $serverid($1), %switch = $+(switch_,%id), %replace = $+(replace_,%id), %abortgame = $+(abortgame_,%id), %result = $+(result_,%id), %gamestats = $gamestatsini($1) | .timer [ $+ [ $+(*,$1,*) ] ] off | unset % [ $+ [ $+(*,$1,*) ] ]
- remini -n $gfile(voting.ini) %switch | remini -n $gfile(voting.ini) %replace | remini -n $gfile(voting.ini) %abortgame | remini -n $gfile(voting.ini) %result | remini -n $gfile(leavers.ini) $1 | remini -n $gfile(ready.ini) $1 | remini -n $gfile(picked.ini) $1 | remini -n $gfile(stacks.ini) $1 | remini -n $gfile(record.ini) $1
- remini -n $gfile(players.ini) $1 | remini -n $gfile(joined.ini) $1 | remini -n $gfile(kicked.ini) $1 | remini -n $gfile(counter.ini) $1 | remini -n $gfile(lancheck.ini) $1 | remini -n $gfile(kills.ini) $1 | remini -n $gfile(terrorist.ini) $1 | remini -n $gfile(score.ini) $1 | remini -n $gfile(tempreg.ini) $1
- if ($ini($gfile(newteams.ini),$1)) { .timer 1 2 resetnewteams $1 } | if ($readini($gfile(gatherservers.ini),$1,status)) { remini -n $gfile(gatherservers.ini) $1 status } | if ($isfile(%gamestats)) { .remove %gamestats }
- if ($2) { whatcmd $meorsay $mainchan $logo Gather on server $serverid($1) was stopped by $anick($gauth($2)) $logo | if ($vtset($1)) { .timer 1 1 delete.vt $1 } | if ($checkrematch) { var %id = $ifmatch | whatcmd rematch %id } }
- .timer 1 1 resetlog $1 | .timer 1 1 resetlog2 $1 | srcon.clear $1
- }
- alias resetall {
- if ($ini($gfile(gatherstatus.ini),$1)) { remini -n $gfile(gatherstatus.ini) $1 } | if ($readini($gfile(gatherstatus.ini),info,ip) == $1) { remini -n $gfile(gatherstatus.ini) info }
- .resetserver $1-
- }
- alias resetnewteams { var %i = 1 | while (%i <= $ini($gfile(newteams.ini),$1,0)) { var %x = $ini($gfile(newteams.ini),$1,%i) | remini -n $gfile(newteams.ini) %x | inc %i } | if ($ini($gfile(newteams.ini),$1)) { remini -n $gfile(newteams.ini) $1 } }
- alias resetchanstats {
- if ($readini($gfile(gatherstats.ini),chan,day) != $day) {
- writeini -n $gfile(gatherstats.ini) chan day $day | var %m = $null, %y = $null
- if ($day == Monday) { remini -n $gfile(gatherstats.ini) chan thisweek }
- if ($readini($gfile(gatherstats.ini),chan,year) != $date(yyyy)) { writeini -n $gfile(gatherstats.ini) chan year $date(yyyy) }
- if ($readini($gfile(gatherstats.ini),chan,today)) { var %ifmatch = $ifmatch | writeini -n $gfile(gatherstats.ini) chan lastday %ifmatch | remini -n $gfile(gatherstats.ini) chan today } | elseif ($readini($gfile(gatherstats.ini),chan,lastday)) { remini -n $gfile(gatherstats.ini) chan lastday }
- if ($readini($gfile(gatherstats.ini),chan,month) != $date(mmm)) { var %m = $readini($gfile(gatherstats.ini),chan,month) | if (%m) { remini -n $gfile(gatherstats.ini) chan %m } | writeini -n $gfile(gatherstats.ini) chan month $date(mmm) }
- else { var %ctime = $calc($ctime +86400), %date = $date(%ctime,mmm) }
- }
- .timerchanstats -o 00:00 1 2 .resetchanstats
- }
- alias checktimers {
- if (!$timer(chanstats)) { resetchanstats }
- if (!$timer(adv)) { .timeradv2 1 10 advertise }
- if (!$timer(gatherbans)) { .timer 1 3 gatherbans }
- if (!$timer(gatherdemotes)) { .timer 1 5 gatherdemotes }
- if (!$timer(checkconn)) { .timercheckconn -o 1 300 checkconn }
- if (!$statscheck) && ($readini($gfile(gatherinfo.ini),modes,statschat)) && (!$timer(statschat)) { .timer -o 1 1 statschat }
- }
- alias advertise {
- if ($ini($gfile(gatheradv.ini),0)) && ($me ison $mainchan) {
- var %n = $readini($gfile(gatherinfo.ini),gatheradv,line), %line = $iif(%n,$calc(%n +1),1)
- if ($ini($gfile(gatheradv.ini),%line)) { var %cmd = $ifmatch } | else { var %line = 1, %cmd = $ini($gfile(gatheradv.ini),%line) }
- var %txt = $readini($gfile(gatheradv.ini),n,%cmd,txt), %saytxt = $c_text($mainchan,%txt) | writeini -n $gfile(gatherinfo.ini) gatheradv line %line | statsbot $mainchan %saytxt
- ;;SPECIAL;;
- if (#signfrag.* iswm $mainchan) { .timeradv 0 900 advertise | return }
- .timeradv 0 $calc($gatherinfo(timetoadv) * 60) advertise
- }
- }
- alias serverinuse { var %ip = $iif($1 != 0,$1,Error), %status = $gatherstatus(%ip) | if (!$istok(Free Error Offline Ended Cooldown,%status,32)) { return $true } | return $false }
- alias servernotfree { var %ip = $iif($1 != 0,$1,Error), %status = $gatherstatus(%ip) | if (!$istok(Free Ended Cooldown,%status,32)) { return $true } | return $false }
- alias posgid {
- var %i = 1, %gid = $calc($gatherstats(chan,played) +1) | while ($ini($gfile(gatherservers.ini),%i)) {
- var %ip = $ifmatch, %status = $gatherstatus(%ip)
- if (!$istok(Free Error Offline Ended Signup Sending_Info Picking Cooldown,%status,32)) && ($1 != %ip) { inc %gid }
- inc %i
- }
- return %gid
- }
- alias admindate {
- var %date = $replace($1-,$chr(45),$chr(32),$chr(47),$chr(32)), %m = $gettok(%date,1,32), %y = $gettok(%date,2,32)
- if (%m) && (%y) { if (%m isnum 1-12) && (%y isnum 0-9999) { var %month = $adminday($round(%m,0)), %year = $adminyear(%y) | return $+(%month,-,%year) } | return 0 }
- elseif (%m isnum 1-12) { var %month = $adminday($round(%m,0)), %year = $date(yyyy) | return $+(%month,-,%year) } | return 0
- }
- alias adminday { if ($len($1) == 1) { return $+(0,$1) } | return $1 }
- alias adminyear { var %year = $date(yyyy), %len = $calc(4 - $len($1)) | return $+($left(%year,%len),$1) }
- alias html {
- if (($1-) || ($1 == 0)) && ($prop) { var %prop = $ifmatch
- if (%prop == s) || (%prop == small) { return $iif($+(<s>,$1-,</s>),$ifmatch,-ERROR-S1-) }
- if (%prop == p) || (%prop == normal) { return $iif($+(<p>,$1-,</p>),$ifmatch,-ERROR-P2-) }
- if (%prop == m) || (%prop == big) { return $iif($+(<m>,$1-,</m>),$ifmatch,-ERROR-) }
- if (%prop == b) || (%prop == bold) { return $iif($+(<b>,$1-,</b>),$ifmatch,-ERROR-) }
- if (%prop == i) || (%prop == u) { return $iif($+(<i>,$1-,</i>),$ifmatch,-ERROR-) }
- if (%prop == strong) { return $iif($+(<strong>,$1-,</strong>),$ifmatch,-ERROR-) }
- if (%prop == c) || (%prop == color) {
- if ($1 == 0) || ($1 == white) { return $iif($+(<c style="color:#FFFFFF">,$2-,</c>),$ifmatch,-ERROR-) }
- if ($1 == 1) || ($1 == black) { return $iif($+(<c style="color:#000000">,$2-,</c>),$ifmatch,-ERROR-) }
- if ($1 == 2) || ($1 == navy) { return $iif($+(<c style="color:#000080">,$2-,</c>),$ifmatch,-ERROR-) }
- if ($1 == 3) || ($1 == green) { return $iif($+(<c style="color:#009900">,$2-,</c>),$ifmatch,-ERROR-) }
- if ($1 == 4) || ($1 == red) { return $iif($+(<c style="color:#FF0000">,$2-,</c>),$ifmatch,-ERROR-) }
- if ($1 == 5) || ($1 == brown) { return $iif($+(<c style="color:#8B4513">,$2-,</c>),$ifmatch,-ERROR-) }
- if ($1 == 6) || ($1 == purple) { return $iif($+(<c style="color:#800080">,$2-,</c>),$ifmatch,-ERROR-) }
- if ($1 == 7) || ($1 == orange) { return $iif($+(<c style="color:#FFA520">,$2-,</c>),$ifmatch,-ERROR-) }
- if ($1 == 8) || ($1 == yellow) { return $iif($+(<c style="color:#EEEE00">,$2-,</c>),$ifmatch,-ERROR-) }
- if ($1 == 9) || ($1 == lime) { return $iif($+(<c style="color:#00FF00">,$2-,</c>),$ifmatch,-ERROR-) }
- if ($1 == 10) || ($1 == teal) { return $iif($+(<c style="color:#008080">,$2-,</c>),$ifmatch,-ERROR-) }
- if ($1 == 11) || ($1 == turquoise) || ($1 == turq) { return $iif($+(<c style="color:#80BFFF">,$2-,</c>),$ifmatch,-ERROR-) }
- if ($1 == 12) || ($1 == blue) { return $iif($+(<c style="color:#0000CD">,$2-,</c>),$ifmatch,-ERROR-) }
- if ($1 == 13) || ($1 == pink) { return $iif($+(<c style="color:#FF00FF">,$2-,</c>),$ifmatch,-ERROR-) }
- if ($1 == 14) || ($1 == grey) || ($1 == gray) { return $iif($+(<c style="color:#A9A9A9">,$2-,</c>),$ifmatch,-ERROR-) }
- if ($1 == 15) || ($1 == silver) { return $iif($+(<c style="color:#C0C0C0">,$2-,</c>),$ifmatch,-ERROR-) }
- if ($1 == logo) { var %logo = $strip($remove($logo,$chr(91),$chr(93))) | return $iif($+($+(<l style="color:#A9A9A9">,$chr(91),</l>),$+(<l style="color:#80BFFF">,%logo,</l>),$+(<l style="color:#A9A9A9">,$chr(93),</l>)),$ifmatch,-ERROR-) }
- if ($1 == split) { return $iif($+(<l style="color:#80BFFF">,»,</l>),$ifmatch,-ERROR-) }
- return $1-
- }
- if (%prop == logo) { var %logo = $strip($remove($logo,$chr(91),$chr(93))) | return $+($+(<l style="color:#A9A9A9">,$chr(91),</l>),$+(<l style="color:#80BFFF">,%logo,</l>),$+(<l style="color:#A9A9A9">,$chr(93),</l>)) }
- if (%prop == split) { return return $+(<l style="color:#80BFFF">,»,</l>) }
- if (%prop == weapon) && ($2) { return <img src="images/ $+ $lower($1) $+ .gif" width="63" height="20" style="float:left;" /> $+($chr(40),$lower($1),$chr(41),:) $2 }
- return $1-
- }
- return
- }
- alias upstats {
- if ($gatherinfo(ftp)) {
- var %ftp = $ifmatch, %host = $gettok(%ftp,1,32), %user = $gettok(%ftp,2,32), %pass = $gettok(%ftp,3,32), %dir = $gettok(%ftp,4,32), %url = $gettok(%ftp,5,32), %dir = $+(",$iif($left(%dir,1) != /,/),%dir,$iif($right(%dir,1) != /,/),stats/")
- if (%upload.stats) || (!%url) || (($isfile(upstats.bat)) && ($isfile(upstats.txt))) || (!$isfile($gfile(upstats.html))) { return $false }
- set -z %upload.stats 2 | .timerupstats 1 30 upstats_clean
- var %gstats = $1, %steamid = $1, %auth = $gauth(%steamid), %nick = $gnick(%steamid), %clean = $+(%auth,.html), %file = $+(%clean), %put = %file, %s = $html(split).color, %logo = $html(logo).color | .copy -o $+(",$gfile(upstats.html),") $+(",%file,")
- write %file $html(%logo $html(Stats on: $html(%nick).bold).strong %s $html(Auth: $html(%auth).bold).strong %s $html(Steamid: $html(%steamid).bold).strong %logo).p | write %file
- write %file $html(%logo $html(Rank:).bold $gatherstats(%gstats,Rank) $+ / $+ $lines($gfile(gatherusers.dat)) %s $html(Points:).bold $round($iif($gatherstats(%gstats,Points),$ifmatch,1000),2) %s $html(Man of the Match:).bold $gatherstats(%gstats,motm) %s $html(Best K/D's:).bold $gatherstats(%gstats,bestkds) %s $html(Newb of the Match:).bold $gatherstats(%gstats,notm) %logo).p
- write %file $html(%logo $html(Games:).bold $gatherstats(%gstats,Played) %s $html(Started:).bold $gatherstats(%gstats,Started) %s $html(Substitute:).bold $gatherstats(%gstats,Subs) %s $html(Won:).bold $gatherstats(%gstats,Wins) %s $html(Draw:).bold $gatherstats(%gstats,Draw) %s $html(Lost:).bold $gatherstats(%gstats,Loss) %s $html(Bans:).bold $gatherstats(%gstats,Bans) %s $html(Leavebans:).bold $gatherstats(%gstats,Leavebans) %logo).p
- write %file $html(%logo $html(Entrykills:).bold $gatherstats(%gstats,Entrykills) %s $html(Kills:).bold $gatherstats(%gstats,Kills) %s $html(Deaths:).bold $gatherstats(%gstats,Deaths) %s $html(Plants:).bold $gatherstats(%gstats,Plants) %s $html(Defuses:).bold $gatherstats(%gstats,Defs) %s $html(K/D:).bold $round($calc($gatherstats(%gstats,Kills) / $gatherstats(%gstats,Deaths)),2) %s $html(Assists:).bold $gatherstats(%gstats,Assists) %s $html(Aces:).bold $gatherstats(%gstats,Aces) %logo).p
- var %lastgame = $gatherstats(%steamid,lastgame), %n = $numtok(%lastgame,44), %id = $gettok(%lastgame,%n,44)
- if (%id) {
- if ($readini($gfile(gatherids.ini),%id,%steamid)) {
- var %stats = $ifmatch, %k = $gettok($gettok(%stats,1,32),2,58), %d = $gettok($gettok(%stats,2,32),2,58), %a = $gettok($gettok(%stats,3,32),2,58), %p = $round($gettok($gettok(%stats,4,32),2,58),2), %kd = $round($calc(%k / $iif(%d,$ifmatch,1)),2)
- set -u60 %gatherid. [ $+ [ $+(%id,.,%steamid) ] ] 1 | var %ct = $readini($gfile(gatherids.ini),%id,CT), %t = $readini($gfile(gatherids.ini),%id,TERRORIST), %teamwon = $readini($gfile(gatherids.ini),%id,TeamWon), %winloss = $iif(%teamwon == Draw,$html(08,Draw).c,$html(04,Lost).c)
- if ($istok(%ct,%auth,32)) { var %team = CT } | if ($istok(%t,%auth,32)) { var %team = TERRORIST } | if ($readini($gfile(gatherids.ini),%id,TeamWon) == %team) { var %winloss = $html(09,Won).c }
- if ($readini($gfile(gatherids.ini),%id,bestkd) == %steamid) { var %bestkd = 1 } | if ($readini($gfile(gatherids.ini),%id,MotM) == %steamid) { var %motm = 1 } | elseif ($readini($gfile(gatherids.ini),%id,NotM) == %steamid) { var %notm = 1 }
- var %1on1 = $gettok($gettok(%stats,5,32),2,58), %1on2 = $gettok($gettok(%stats,6,32),2,58), %1on3 = $gettok($gettok(%stats,7,32),2,58), %1on4 = $gettok($gettok(%stats,8,32),2,58), %1on5 = $gettok($gettok(%stats,9,32),2,58), %x1 = $gettok(%1on1,2,47), %x2 = $gettok(%1on2,2,47), %x3 = $gettok(%1on3,2,47), %x4 = $gettok(%1on4,2,47), %x5 = $gettok(%1on5,2,47)
- write %file $+(<p>,%logo $html(Lastgame:).bold $+($chr(35),%id) %s $gettok($readini($gfile(gatherids.ini),%id,Ended),1,32) %s $html(Type:).bold $readini($gfile(gatherids.ini),%id,Type) %s $html(Points:).bold $iif(%p >= 0,$html(09,$+(+,%p)).c,$html(04,%p).c) %s $html(K/D:).bold %kd $+($html(14,$chr(91)).c,%k,/,%d,$html(14,$chr(93)).c))
- write %file $+($iif(%x1,%s $html(1on1:).bold %1on1) $iif(%x2,%s $html(1on2:).bold %1on2) $iif(%x3,%s $html(1on3:).bold %1on3) $iif(%x4,%s $html(1on4:).bold %1on4) $iif(%x5,%s $html(1on5:).bold %1on5) %s $html(Status:).bold %winloss $iif(%motm,%s $html(07,Man of the Match).c,$iif(%notm,%s $html(04,Newb of the Match).c)) $iif(%bestkd,%s $html(07,Best K/D).c) %logo,<p>)
- }
- else { write %file $html(%logo $html(Lastgame:).bold $+($chr(35),%id) %s $gettok($readini($gfile(gatherids.ini),%id,Ended),1,32) %s $html(Type:).bold $readini($gfile(gatherids.ini),%id,Type) %s $html(Points:).bold $html(04,-39).c %s $html(Status:).bold $html(04,Leaver).c %logo).p }
- }
- if ($gatherstats(%gstats,Lastpoints)) {
- var %pp = $remove($strip($ifmatch),+), %ii = 1, %aa = 1, %ppoints, %bb | while (%ii <= $numtok(%pp,32)) {
- var %xx = $round($gettok(%pp,%ii,32),1), %nn = $iif(%xx < 0,$html(04,%xx).c,$html(09,$+(+,%xx)).c), %ppoints = %ppoints %nn | inc %ii
- if (%aa > $iif(%bb,20,18)) {
- if (!%bb) { if (%ii <= $numtok(%pp,32)) { write %file $+(<p>,%logo) $html(Skill history:).bold %ppoints | var %bb = 1, %ppoints } | else { write %file $html(%logo $html(Skill history:).bold %ppoints %logo).p | var %bb = 1, %ppoints } }
- else { if (%ii <= $numtok(%pp,32)) { write %file %ppoints | var %ppoints } | else { write %file %ppoints $+(%logo,<p>) | var %ppoints } }
- }
- inc %aa
- }
- if (%ppoints) { if (!%bb) { write %file $html(%logo $html(Skill history:).bold %ppoints %logo).p } | else { write %file %ppoints $+(%logo,<p>) } }
- }
- else { write %file $html(%logo $html(Skill history:).bold $html(04,Inactive).c %logo).p }
- write %file | var %1on1 = $clutchstats(%gstats,1on1), %fon1 = $clutchstats(%gstats,fail_1on1), %1on2 = $clutchstats(%gstats,1on2), %fon2 = $clutchstats(%gstats,fail_1on2), %1on3 = $clutchstats(%gstats,1on3), %fon3 = $clutchstats(%gstats,fail_1on3), %1on4 = $clutchstats(%gstats,1on4), %fon4 = $clutchstats(%gstats,fail_1on4), %1on5 = $clutchstats(%gstats,1on5), %fon5 = $clutchstats(%gstats,fail_1on5)
- write %file $html(%logo $html(1on1:).bold %1on1 out of $calc(%1on1 + %fon1) $html(14,$chr(91)).c $+ $html(07,$round($calc(100 / (%1on1 + %fon1) * %1on1),2)).c $+ $html(14,$+($chr(37),$chr(93))).c).p
- write %file $html(%logo $html(1on2:).bold %1on2 out of $calc(%1on2 + %fon2) $html(14,$chr(91)).c $+ $html(07,$round($calc(100 / (%1on2 + %fon2) * %1on2),2)).c $+ $html(14,$+($chr(37),$chr(93))).c).p
- write %file $html(%logo $html(1on3:).bold %1on3 out of $calc(%1on3 + %fon3) $html(14,$chr(91)).c $+ $html(07,$round($calc(100 / (%1on3 + %fon3) * %1on3),2)).c $+ $html(14,$+($chr(37),$chr(93))).c).p
- write %file $html(%logo $html(1on4:).bold %1on4 out of $calc(%1on4 + %fon4) $html(14,$chr(91)).c $+ $html(07,$round($calc(100 / (%1on4 + %fon4) * %1on4),2)).c $+ $html(14,$+($chr(37),$chr(93))).c).p
- write %file $html(%logo $html(1on5:).bold %1on5 out of $calc(%1on5 + %fon5) $html(14,$chr(91)).c $+ $html(07,$round($calc(100 / (%1on5 + %fon5) * %1on5),2)).c $+ $html(14,$+($chr(37),$chr(93))).c).p
- var %x = 1 | window -eh1 @wepstats | while (%x <= $ini($gfile(wepstats.ini),%gstats,0)) { var %wep = $ini($gfile(wepstats.ini),%gstats,%x) | aline @wepstats %wep $ex_nr($readini($gfile(wepstats.ini),%gstats,%wep)) | inc %x }
- filter -twce 2 32 @wepstats @wepstats | var %x = 1, %crlf | while (%x <= $line(@wepstats,0)) { var %wep = $upleft($gettok($line(@wepstats,%x),1,32)), %stat = $round($gettok($line(@wepstats,%x),2,32),0) | inc %x
- if (!%crlf) { write %file | var %crlf = 1 } | write %file $html($html(%wep,%stat).weapon).p
- }
- window -c @wepstats | write %file | write %file $html(%logo End of stats file %s $html(Uploaded: $html($date $time).bold).strong %logo).p
- write %file <!-- end #stats --></div>
- write %file <!-- end #mainContent --></div>
- write %file
- write %file <div id="footer">
- write %file <p>Copyright © Fragportal - <a href="http://www.fragportal.dk" style="color:#000; text-decoration:none;">www.fragportal.dk</a> - Created by W33D -aka- cokE</p>
- write %file <!-- end #footer --></div>
- write %file <!-- end #container --></div>
- write %file
- write %file </body>
- write %file </html>
- write -c upstats.txt open %host | write upstats.txt %user | write upstats.txt %pass | write upstats.txt bin
- write upstats.txt cd %dir | write upstats.txt dele %put | write upstats.txt put %put | write upstats.txt quit
- write -c upstats.bat @echo off | write upstats.bat ftp -i -s:"upstats.txt" | write upstats.bat del %put
- write upstats.bat del upstats.txt | write upstats.bat del upstats.bat | .timer 1 0 run -hp upstats.bat
- return $+(%url,$iif($right(%url,1) != /,/),stats/,%clean)
- }
- return $false
- }
- alias upstats_clean {
- if ($isfile(upstats.bat)) { .timer 1 0 .remove upstats.bat }
- if ($isfile(upstats.txt)) { .timer 1 0 .remove upstats.txt }
- }
- alias upbans {
- if ($gatherinfo(ftp)) {
- var %ftp = $ifmatch, %host = $gettok(%ftp,1,32), %user = $gettok(%ftp,2,32), %pass = $gettok(%ftp,3,32), %dir = $gettok(%ftp,4,32), %url = $gettok(%ftp,5,32), %dir = $+(",$iif($left(%dir,1) != /,/),%dir,$iif($right(%dir,1) != /,/),")
- if (%upload.bans) || (!%url) || (($isfile(upload.txt)) && ($isfile(upload.bat))) { return $false }
- if ($isfile(bans.txt)) { write -c bans.txt }
- set -z %upload.bans 5
- var %i = 1, %put = $+(",bans.txt,") | while (%i <= $ini($gfile(gatherbans.ini),0)) {
- write bans.txt Ban $+($chr(35),%i,:)
- var %id = $ini($gfile(gatherbans.ini),%i), %admin = $readini($gfile(gatherbans.ini),%id,admin), %tid = $readini($gfile(gatherbans.ini),%id,tid), %grund = $readini($gfile(gatherbans.ini),%id,grund), %type = $readini($gfile(gatherbans.ini),%id,type), %nick = $gnick(%id), %auth = $gauth(%id)
- if (%auth) {
- if (%tid != Permanent) { var %bantime = $duration($calc(%tid - $ctime)) } | else { var %bantime = %tid }
- if ($gettok(%grund,1-7,32) == Was not ingame while checking for leavers) && ($numtok(%grund,32) > 8) { var %ga = $gettok(%grund,9,32), %ga = $left(%ga,-1), %grund = $gettok(%grund,1-7,32) [Admin: $strip($anick(%ga)) $+ $chr(93) }
- if ($gettok(%grund,1-8,32) == You have been kicked ingame by an admin) && ($numtok(%grund,32) > 9) { var %ga = $gettok(%grund,10,32), %ga = $left(%ga,-1), %grund = $gettok(%grund,1-8,32) [Admin: $strip($anick(%ga)) $+ $chr(93) }
- if ($gettok(%grund,1-8,32) == Was not ingame before the time limit expired) && ($numtok(%grund,32) > 9) { var %ga = $gettok(%grund,10,32), %ga = $left(%ga,-1), %grund = $gettok(%grund,1-8,32) [Admin: $strip($anick(%ga)) $+ $chr(93) }
- write bans.txt Nick: %nick - Auth: %auth - Steamid: %id
- }
- else { write bans.txt $iif(*.* iswm %id,IP:,Steamid:) %id }
- write bans.txt Banned by $strip($anick(%admin)) - Type: %type - Expire: %bantime - Reason: %grund | write bans.txt $crlf | inc %i
- }
- write bans.txt End of banlist, $calc(%i -1) bans - Updated: $date $time
- write -c upload.txt open %host | write upload.txt %user | write upload.txt %pass | write upload.txt bin
- write upload.txt cd %dir | write upload.txt dele %put | write upload.txt put %put | write upload.txt quit
- write -c upload.bat @echo off | write upload.bat ftp -i -s:"upload.txt" | write upload.bat del bans.txt
- write upload.bat del upload.txt | write upload.bat del upload.bat | .timer 1 0 run upload.bat
- return $+(%url,$iif($right(%url,1) != /,/),bans.txt)
- }
- return $false
- }
- alias upcslog {
- if ($gatherinfo(ftp)) {
- var %ftp = $ifmatch, %host = $gettok(%ftp,1,32), %user = $gettok(%ftp,2,32), %pass = $gettok(%ftp,3,32), %dir = $gettok(%ftp,4,32), %url = $gettok(%ftp,5,32)
- if (!%upload) || (($isfile(upload.txt)) && ($isfile(upload.bat))) { var %gid = $remove($1,gatherid,.log), %logput = $+("gatherlogs\gatherid,%gid,.log"), %logdir = $+(",$iif($left(%dir,1) != /,/),%dir,$iif($right(%dir,1) != /,/),gatherlogs/")
- if ($isfile(%logput)) { set -u60 %upload 1
- write -c upload.txt open %host | write upload.txt %user | write upload.txt %pass | write upload.txt bin | write upload.txt cd %logdir
- write upload.txt put %logput | write upload.txt quit | write -c upload.bat @echo off | write upload.bat ftp -i -s:"upload.txt"
- write upload.bat del upload.txt | write upload.bat del upload.bat | .timer 1 0 run upload.bat
- }
- else { echo -s $date ][ $time $logo %logput doesnt exist $logo }
- }
- else { .timer 1 10 upcslog $1- }
- }
- }
- alias logchan {
- ;;SPECIAL;;
- if (#signfrag.* iswm $mainchan) { return }
- if ($readini($gfile(gatherinfo.ini),log,date) != $date) {
- var %date = $iif($readini($gfile(gatherinfo.ini),log,date),$ifmatch,$date)
- if (!$isdir(chanlogs)) { .mkdir chanlogs } | writeini -n $gfile(gatherinfo.ini) log date $date
- if ($isfile(chanlog.txt)) { write chanlog.txt Session Close: $date $time
- var %file = $+($mircdirchanlogs\,chanlog_,$replace(%date,$chr(47),$chr(45))), %mput = $+(",%file,.log"), %i = 2 | while ($isfile(%mput)) { var %mput = $+(",%file,_,%i,.log") | inc %i }
- .rename chanlog.txt %mput
- if ($gatherinfo(ftp)) {
- var %ftp = $ifmatch, %host = $gettok(%ftp,1,32), %user = $gettok(%ftp,2,32), %pass = $gettok(%ftp,3,32), %dir = $gettok(%ftp,4,32), %url = $gettok(%ftp,5,32)
- var %dir = $+(",$iif($left(%dir,1) != /,/),%dir,$iif($right(%dir,1) != /,/),chanlogs/"), %numtok = $numtok(%mput,92)
- if ($isfile(uploadlog.txt)) { .remove uploadlog.txt } | if ($isfile(uploadlog.bat)) { .remove uploadlog.bat }
- write uploadlog.txt open %host | write uploadlog.txt %user | write uploadlog.txt %pass | write uploadlog.txt bin | write uploadlog.txt cd %dir
- write uploadlog.txt put %mput | write uploadlog.txt quit | write uploadlog.bat @echo off | write uploadlog.bat ftp -i -s:"uploadlog.txt"
- write uploadlog.bat del uploadlog.txt | write uploadlog.bat del uploadlog.bat | .timer 1 0 run uploadlog.bat
- whatcmd $meorsay $iif($me ison $privchan,$privchan,$ownerchan) $logo Channel log from yesterday $col(14,$chr(40)) $+ %date $+ $col(14,$chr(41)) being uploaded now $split $+(,%url,$iif($right(%url,1) != /,/),chanlogs/,$gettok(%mput,%numtok,92),) $logo
- }
- }
- }
- if ($1) { if (!$isfile(chanlog.txt)) { write chanlog.txt Session Start: $date $time } | write chanlog.txt $time » $1- }
- }
- alias gofopen {
- var %file = $1, %window = $2, %stats = $3, %req = $iif($4,$iif($4 isnum,$4,3),0)
- if (!$isfile(%file)) { return $false } | if ($fopen(%window)) { .fclose %window } | .fopen %window %file
- if ($fopen(%window).err) { return $false } | if (!$window(%window)) { window -eh1 %window } | else { clear %window }
- .fseek -w %window *STEAM_*:*:* | while ($fread(%window)) {
- var %info = $ifmatch, %id = $remove(%info,$chr(91),$chr(93))
- if ((!%req) || ((%req) && ($readini(%file,%id,Played) >= %req))) && ($readini(%file,%id,%stats)) { aline %window %id $ex_nr($ifmatch) }
- .fseek -w %window *STEAM_*:*:*
- }
- .fclose %window | return $true
- }
- alias gofopen2 {
- var %file = $1, %window = $2, %stats = $3, %file2 = $gfile(gatherstats.ini), %stats2 = Played
- if (!$isfile(%file)) { return $false } | if ($fopen(%window)) { .fclose %window } | .fopen %window %file
- if ($fopen(%window).err) { return $false } | if (!$window(%window)) { window -eh1 %window } | else { clear %window }
- .fseek -w %window *STEAM_*:*:* | while ($fread(%window)) {
- var %info = $ifmatch, %id = $remove(%info,$chr(91),$chr(93))
- if ($readini(%file,%id,%stats)) && ($readini(%file2,%id,%stats2)) { var %s1 = $readini(%file,%id,%stats), %s2 = $readini(%file2,%id,%stats2), %s = $calc(%s1 / %s2) | aline %window %id $ex_nr(%s1) %s }
- .fseek -w %window *STEAM_*:*:*
- }
- .fclose %window | return $true
- }
- alias gofopen3 {
- var %file = $1, %window = $2, %stats = $3, %stats2 = $4
- if (!$isfile(%file)) { return $false } | if ($fopen(%window)) { .fclose %window } | .fopen %window %file
- if ($fopen(%window).err) { return $false } | if (!$window(%window)) { window -eh1 %window } | else { clear %window }
- .fseek -w %window *STEAM_*:*:* | while ($fread(%window)) {
- var %info = $ifmatch, %id = $remove(%info,$chr(91),$chr(93))
- if ($readini(%file,%id,%stats)) || ($readini(%file,%id,%stats2)) { var %s1 = $readini(%file,%id,%stats), %s2 = $readini(%file,%id,%stats2), %s = $calc(100 / (%s1 + %s2) * %s1) | aline %window %id $ex_nr(%s1) %s }
- .fseek -w %window *STEAM_*:*:*
- }
- .fclose %window | return $true
- }
- alias gofopen4 {
- var %file = $1, %window = $2, %stats = $3, %file2 = $gfile(gatherstats.ini), %stats2 = Played
- if (!$isfile(%file)) { return $false } | if ($fopen(%window)) { .fclose %window } | .fopen %window %file
- if ($fopen(%window).err) { return $false } | if (!$window(%window)) { window -eh1 %window } | else { clear %window }
- .fseek -w %window *STEAM_*:*:* | while ($fread(%window)) {
- var %info = $ifmatch, %id = $remove(%info,$chr(91),$chr(93))
- if ($readini(%file,%id,%stats)) && ($readini(%file2,%id,%stats2) >= 3) { var %s1 = $readini(%file,%id,%stats), %s2 = $readini(%file2,%id,%stats2), %s = $calc(%s1 / %s2) | aline %window %id $ex_nr(%s) %s1 }
- .fseek -w %window *STEAM_*:*:*
- }
- .fclose %window | return $true
- }
- alias resetstats { var %ctime = $ctime, %time
- if ($1) && ($1 != chan) { var %xPoints = $readini($gfile(gatherstats.ini),$1,Points), %Lastgame = $readini($gfile(gatherstats.ini),$1,Lastgame)
- remini -n $gfile(wepstats.ini) $1 | remini -n $gfile(hitstats.ini) $1 | remini -n $gfile(clutchstats.ini) $1 | remini -n $gfile(gatherstats.ini) $1
- if (%xPoints) { writeini -n $gfile(gatherstats.ini) $1 xPoints %xPoints }
- if (%Lastgame) { writeini -n $gfile(gatherstats.ini) $1 Lastgame %Lastgame }
- var %time = $calc($ctime - %ctime) | return $iif(%time > 0,%time,1)
- }
- else {
- if ($isfile($gfile(wepstats.ini))) { .remove -b $gfile(wepstats.ini) }
- if ($isfile($gfile(hitstats.ini))) { .remove -b $gfile(hitstats.ini) }
- if ($isfile($gfile(clutchstats.ini))) { .remove -b $gfile(clutchstats.ini) }
- if ($isfile($gfile(gatherstats.ini))) {
- var %file = $gfile(gatherstats.ini), %i = 1, %oldfile = statsfile.ini | while ($isfile(%oldfile)) { var %oldfile = $+(statsfile_,%i,.ini) | inc %i } | .rename %file %oldfile
- var %i = 1, %x = chan | while ($ini(%oldfile,%x,%i)) { var %t = $lower($ifmatch), %s = $readini(%oldfile,%x,%t) | if (%s) { writeini -n %file %x %t %s } | inc %i }
- var %i = 1 | while ($ini(%oldfile,%i)) { var %x = $ifmatch
- if (STEAM_*:*:* iswm %x) {
- if ($readini(%oldfile,%x,Points)) { writeini -n %file %x xPoints $ifmatch }
- if ($readini(%oldfile,%x,Lastgame)) { writeini -n %file %x Lastgame $ifmatch }
- }
- inc %i
- }
- }
- if ($isfile(%oldfile)) { .remove -b %oldfile }
- var %time = $calc($ctime - %ctime) | return $iif(%time > 0,%time,1)
- }
- return $false
- }
- ;#################################### Aliases rank/toplist ##########################################;
- alias updaterank {
- if ($timer(upuser)) { .timerupuser off }
- if ($window(@toplist)) { .window -c @toplist }
- if ($gofopen($gfile(gatherstats.ini),@toplist,Points,1)) { filter -twce 2 32 @toplist @toplist | set %up.id 1 | set %up.start $ctime | .timerupuser 1 1 updateuser }
- }
- alias updateuser {
- if (%up.id) && (%up.id <= $line(@toplist,0)) {
- var %s = $gettok($line(@toplist,%up.id),1,32) | writeini -n $gfile(gatherstats.ini) %s Rank %up.id | inc %up.id | .timerupuser -m 1 100 updateuser
- }
- elseif (%up.id) { unset %up.* | window -c @toplist }
- }
- alias splitnum { if (!$calc($1 % 2)) { return $calc($1 /2) } | var %x = $calc($1 -1) | return $calc(%x /2 +1) }
- alias toplist {
- if ($gofopen($gfile(gatherstats.ini),@top5,Points,1)) {
- filter -twce 2 32 @top5 @top5 | var %i = 1, %x = 10, %st = $null, %a = $iif($line(@top5,0) > 10,%x,$line(@top5,0)), %split = $splitnum(%a) | while (%i <= $line(@top5,0)) && (%i <= %x) {
- var %line = $line(@top5,%i), %s = $gettok(%line,1,32), %p = $round($gettok(%line,2,32),2)
- if (%i <= %split) || (%a <= 7) { var %st = $iif(%st,$ifmatch $split,) %i $+ . $anick($gauth(%s)) $col(14,$chr(40)) $+ %p $+ $col(14,$chr(41)) } | else { var %st2 = $iif(%st2,$ifmatch $split,) %i $+ . $anick($gauth(%s)) $col(14,$chr(40)) $+ %p $+ $col(14,$chr(41)) } | inc %i
- }
- if (%st) && (%st2) { set -u300 %tmp.top 1 | statsbot $1 $logo Top 1- $+ %split $+ $logo %st $logo | statsbot $1 $logo Top $calc(%split +1) $+ - $+ $calc(%i -1) $+ $logo %st2 $logo }
- elseif (%st) { set -u300 %tmp.top 1 | statsbot $1 $logo Top $calc(%i -1) $+ $logo %st $logo } | else { statsbot $1 $logo There is not enough stats for a toplist yet $logo }
- }
- window -c @top5
- }
- alias botlist {
- if ($gofopen($gfile(gatherstats.ini),@bot5,Points,1)) {
- filter -twce 2 32 @bot5 @bot5 | var %i = $line(@bot5,0), %x = 10, %st = $null, %b = 1, %m = $calc(%i -10), %i = $iif(%m >= 1,%m,1), %a = $iif($line(@bot5,0) > 10,%x,$line(@bot5,0)), %split = $splitnum(%a)
- while (%i <= $line(@bot5,0)) && (%b <= %x) { var %line = $line(@bot5,%i), %s = $gettok(%line,1,32), %p = $round($gettok(%line,2,32),2)
- if (%b <= %split) || (%a <= 7) { var %st = $iif(%st,$ifmatch $split,) %i $+ . $anick($gauth(%s)) $col(14,$chr(40)) $+ %p $+ $col(14,$chr(41)) }
- else { var %st2 = $iif(%st2,$ifmatch $split,) %i $+ . $anick($gauth(%s)) $col(14,$chr(40)) $+ %p $+ $col(14,$chr(41)) } | inc %i | inc %b
- }
- if (%st) && (%st2) { set -u300 %tmp.bot 1 | statsbot $1 $logo Botlist $logo %st $logo | statsbot $1 $logo Botlist $logo %st2 $logo }
- elseif (%st) { set -u300 %tmp.bot 1 | statsbot $1 $logo Bot $calc(%b -1) $+ $logo %st $logo } | else { statsbot $1 $logo There is not enough stats for a botlist yet $logo }
- }
- window -c @bot5
- }
- ;#################################### Aliases for rcon start/send/etc and diverse ##########################################;
- alias getname {
- if ($1 isnum) { var %n = $1, %t = $2- } | else { var %n = 1, %t = $1- } | var %i = 1, %x = $gettok(%t,%n,34) | while (%i <= $numtok(%x,60)) {
- var %n = $gettok(%x,%i,60) | if (*STEAM_*:*:* iswm %n) { var %gettok = 1- $+ $calc(%i -2) | return $gettok(%x,%gettok,60) } | inc %i
- }
- return 0
- }
- alias getteam {
- if ($1 isnum) { var %n = $1, %t = $2- } | else { var %n = 1, %t = $1- } | var %i = 1, %x = $gettok(%t,%n,34) | while (%i <= $numtok(%x,60)) {
- var %n = $gettok(%x,%i,60) | if (*STEAM_*:*:* iswm %n) { var %gettok = $calc(%i +1) | return $left($gettok(%x,%gettok,60),-1) } | inc %i
- }
- return 0
- }
- alias getsteamid {
- if ($1 isnum) { var %n = $1, %t = $2- } | else { var %n = 1, %t = $1- } | var %i = 1, %x = $gettok(%t,%n,34) | while (%i <= $numtok(%x,60)) {
- var %n = $left($gettok(%x,%i,60),-1) | if (*STEAM_*:*:* iswm %n) { return %n } | inc %i
- }
- return 0
- }
- alias getuserid {
- if ($1 isnum) { var %n = $1, %t = $2- } | else { var %n = 1, %t = $1- } | var %i = 1, %x = $gettok(%t,%n,34) | while (%i <= $numtok(%x,60)) {
- var %n = $gettok(%x,%i,60) | if (*STEAM_*:*:* iswm %n) { var %gettok = $calc(%i -1) | return $left($gettok(%x,%gettok,60),-1) } | inc %i
- }
- return 0
- }
- alias assini { return $gfile($+(assists,$replace($1,$chr(58),$chr(45)),.ini)) }
- alias killsini { return $gfile($+(kills,$replace($1,$chr(58),$chr(45)),.ini)) }
- alias gamestatsini { return $gfile($+(gamestats,$replace($1,$chr(58),$chr(45)),.ini)) }
- alias recordname {
- var %ip = $1, %id = $2, %game = $calc($gatherstats(%id,played) +1), %name = $remove($gettok($mainchan,1,46),$chr(35))
- if ($readini($gfile(record.ini),%ip,%id)) { var %demo = $ifmatch, %demo = $calc(%demo +1) | writeini -n $gfile(record.ini) %ip %id %demo | return $+(%name,_,%game,_,%demo) }
- writeini -n $gfile(record.ini) %ip %id 1 | return $+(%name,_,%game)
- }
- alias overtime_rounds {
- if ($gatherinfo(overtime)) { return $iif($ifmatch isnum,$ifmatch,3) }
- ;;SPECIAL;;
- if (#signfrag.* iswm $mainchan) { return 5 }
- return 3
- }
- alias mr3 { var %s = $1, %r = $calc($overtime_rounds *2), %n = $calc(30 + %r) | while (%s > %n) { inc %n %r } | return %n }
- alias mr3.half { var %s = $1, %r = $overtime_rounds, %n = $calc(30 + %r) | while (%s > %n) { inc %n %r } | return %n }
- alias sameteam_OLD {
- var %score = $1, %s = 1, %x = 32
- if (%score < 15) { return $true }
- if (%score < 30) { return $false }
- while (%x < %score) { inc %x 3 | var %s = $iif(%s,0,1) }
- return $iif(%s,$true,$false)
- }
- alias sameteam {
- var %score = $1, %s = 0, %r = $overtime_rounds, %x = $calc(30 + %r -1), %c = $calc(30 + %r)
- if (%score < 15) { return $true }
- if (%score < 30) { return $false }
- while (%x < %score) {
- if ($calc(%x +1) == %c) { var %s = $iif(%s,0,1), %c = $calc(%c + %r + %r) }
- inc %x %r
- }
- return $iif(%s,$true,$false)
- }
- alias swapteams {
- if ($gatherinfo(game) == CS:GO) {
- var %ipp = $1, %gfile = $gfile(joined.ini), %i = 1 | while ($ini(%gfile,%ipp,%i)) {
- var %x = $ifmatch, %t = $readini(%gfile,%ipp,%x)
- if (%t == CT) { writeini -n %gfile %ipp %x TERRORIST } | elseif (%t == TERRORIST) { writeini -n %gfile %ipp %x CT }
- inc %i
- }
- .timer 1 5 start_only %ipp | return
- rconsend %ipp mp_swapteams
- if ($ini(%gfile,%ipp,0) == $ini($gfile(players.ini),%ipp,0)) && (!$serverstatus(%ipp,sub)) { .timer 1 2 start %ipp } | else { .timer 1 2 pregame %ipp }
- }
- else {
- .timer 1 1 pregame $1
- }
- }
- alias swapteams2 {
- if ($gatherinfo(game) == CS:GO) {
- var %ipp = $1, %gfile_ct = $gfile(counter.ini), %gfile_t = $gfile(terrorist.ini), %new_ct, %new_t
- var %i = 1 | while ($ini(%gfile_ct,%ipp,%i)) { var %x = $ifmatch, %new_t = %new_t %x | inc %i }
- var %i = 1 | while ($ini(%gfile_t,%ipp,%i)) { var %x = $ifmatch, %new_ct = %new_ct %x | inc %i }
- remini -n %gfile_ct %ipp | remini -n %gfile_t %ipp
- var %i = 1 | while ($gettok(%new_ct,%i,32)) { var %x = $ifmatch | writeini -n %gfile_ct %ipp %x %x | inc %i }
- var %i = 1 | while ($gettok(%new_t,%i,32)) { var %x = $ifmatch | writeini -n %gfile_t %ipp %x %x | inc %i }
- rconsend %ipp mp_swapteams | rconsend %ipp say Teams has been swapped
- }
- }
- alias team_ct_won {
- var %ipp = $1, %idd = $serverid(%ipp), %gamestats = $gamestatsini(%ipp)
- .timerbombdefused. [ $+ [ %ipp ] ] off | set -u5 %roundend. [ $+ [ %ipp ] ] 1 | set -u5 %teamwon. [ $+ [ %ipp ] ] CT
- var %score = $score(%ipp,total), %score.ct = $score(%ipp,ct), %score.t = $score(%ipp,t)
- if ($2 isnum) && ($3 isnum) {
- var %newscore.ct = $calc($2 - 1), %newscore.t = $3
- writeini -n $gfile(score.ini) %ipp antiterrorist %newscore.ct
- writeini -n $gfile(score.ini) %ipp terrorist %newscore.t
- }
- score %ipp inc ct | checkace %ipp | var %score = $score(%ipp,total), %score.ct = $score(%ipp,ct), %score.t = $score(%ipp,t)
- logit %ipp Team CT won the round. CT: %score.ct - T: %score.t
- logit2 %ipp Team CT won the round. CT: %score.ct - T: %score.t
- srcon_echo %ipp Team CT won the round. CT: %score.ct - T: %score.t
- if ($gatherinfo(schat)) { schatsend $+(0,$chr(44),%idd,Server) $+($chr(35),%idd,:,$col(end)) Team CT won the round. CT: %score.ct - T: %score.t }
- if (%score == 15) {
- writeini -n $gfile(gatherservers.ini) %ipp status Pregame | rconsend %ipp say Counter-Terrorist: %score.ct - Terrorist: %score.t
- rconsend %ipp say First half is over - Time to change teams! | .score %ipp switch | .timer 1 1 swapteams %ipp
- if ($gatherinfo(amx)) && ($ini($gfile(joined.ini),%ipp,0) >= 1) && (!%forceteams. [ $+ [ %ipp ] ]) { set -u10 %forceteams. [ $+ [ %ipp ] ] 1 | .timer 1 2 rconsend %ipp status }
- }
- elseif (%score == 30) {
- if (%score.ct > %score.t) {
- writeini -n $gfile(gatherservers.ini) $1 status Ended
- var %i = 1, %t = $null, %tini = $gfile(counter.ini) | while (%i <= $ini(%tini,%ipp,0)) { var %s = $ini(%tini,%ipp,%i), %t = %t $gauth(%s), %t.sid = %t.sid %s | writeini -n %gamestats %s Loss 1 | inc %i }
- var %i = 1, %ct = $null, %ctini = $gfile(terrorist.ini) | while (%i <= $ini(%ctini,%ipp,0)) { var %s = $ini(%ctini,%ipp,%i), %ct = %ct $gauth(%s), %ct.sid = %ct.sid %s | writeini -n %gamestats %s Wins 1 | inc %i }
- writeini -n %gamestats %ipp CT $iif(%ct.sid,$ifmatch,0) | writeini -n %gamestats %ipp TERRORIST $iif(%t.sid,$ifmatch,0) | writeini -n %gamestats %ipp TeamWon CT | writeini -n %gamestats %ipp Score $+(%score.ct,-,%score.t)
- rconsend %ipp say Counter-Terrorist won the gather %score.ct - %score.t | .timer 1 1 stop %ipp
- if ($gatherinfo(schat)) { schatsend $+(0,$chr(44),%idd,Server) $+($chr(35),%idd,:,$col(end)) Counter-Terrorist won the gather %score.ct - %score.t }
- }
- elseif (%score.t > %score.ct) {
- writeini -n $gfile(gatherservers.ini) $1 status Ended
- var %i = 1, %t = $null, %tini = $gfile(counter.ini) | while (%i <= $ini(%tini,%ipp,0)) { var %s = $ini(%tini,%ipp,%i), %t = %t $gauth(%s), %t.sid = %t.sid %s | writeini -n %gamestats %s Wins 1 | inc %i }
- var %i = 1, %ct = $null, %ctini = $gfile(terrorist.ini) | while (%i <= $ini(%ctini,%ipp,0)) { var %s = $ini(%ctini,%ipp,%i), %ct = %ct $gauth(%s), %ct.sid = %ct.sid %s | writeini -n %gamestats %s Loss 1 | inc %i }
- writeini -n %gamestats %ipp CT $iif(%ct.sid,$ifmatch,0) | writeini -n %gamestats %ipp TERRORIST $iif(%t.sid,$ifmatch,0) | writeini -n %gamestats %ipp TeamWon TERRORIST | writeini -n %gamestats %ipp Score $+(%score.t,-,%score.ct)
- rconsend %ipp say Terrorist won the gather %score.t - %score.ct | .timer 1 1 stop %ipp
- if ($gatherinfo(schat)) { schatsend $+(0,$chr(44),%idd,Server) $+($chr(35),%idd,:,$col(end)) Terrorist won the gather %score.t - %score.ct }
- }
- elseif ($gatherinfo(game) != CS:GO) {
- writeini -n $gfile(gatherservers.ini) %ipp status Pregame | rconsend %ipp say Counter-Terrorist: %score.ct - Terrorist: %score.t
- rconsend %ipp say Second half is over - Time to change teams! | .score %ipp switch | .timer 1 1 swapteams %ipp
- if ($gatherinfo(amx)) && ($ini($gfile(joined.ini),%ipp,0) >= 1) && (!%forceteams. [ $+ [ %ipp ] ]) { set -u10 %forceteams. [ $+ [ %ipp ] ] 1 | .timer 1 2 rconsend %ipp status }
- }
- elseif ($gatherinfo(overtime)) || (#rasta.gather == $mainchan) || (#go.ee == $mainchan) || (#cisgl.gotime2 == $mainchan) || (#gamebase.csgo == $mainchan) || (#ihl.csgo == $mainchan) {
- ;writeini -n $gfile(gatherservers.ini) %ipp status Pregame | rconsend %ipp say Counter-Terrorist: %score.ct - Terrorist: %score.t
- ;rconsend %ipp say Second half is over - Time to change teams! | ;rconsend %ipp mp_swapteams | ;.score %ipp switch | ;.timer 1 1 swapteams %ipp
- rconsend %ipp say Second half is over - Get ready for overtime!
- if ($gatherinfo(amx)) && ($ini($gfile(joined.ini),%ipp,0) >= 1) && (!%forceteams. [ $+ [ %ipp ] ]) { set -u10 %forceteams. [ $+ [ %ipp ] ] 1 | .timer 1 2 rconsend %ipp status }
- }
- else {
- writeini -n $gfile(gatherservers.ini) $1 status Ended
- var %i = 1, %t = $null, %tini = $gfile(counter.ini) | while (%i <= $ini(%tini,%ipp,0)) { var %s = $ini(%tini,%ipp,%i), %t = %t $gauth(%s), %t.sid = %t.sid %s | writeini -n %gamestats %s Draw 1 | inc %i }
- var %i = 1, %ct = $null, %ctini = $gfile(terrorist.ini) | while (%i <= $ini(%ctini,%ipp,0)) { var %s = $ini(%ctini,%ipp,%i), %ct = %ct $gauth(%s), %ct.sid = %ct.sid %s | writeini -n %gamestats %s Draw 1 | inc %i }
- writeini -n %gamestats %ipp CT $iif(%ct.sid,$ifmatch,0) | writeini -n %gamestats %ipp TERRORIST $iif(%t.sid,$ifmatch,0) | writeini -n %gamestats %ipp TeamWon Draw | writeini -n %gamestats %ipp Score $+(%score.ct,-,%score.t)
- rconsend %ipp say The gather ends draw %score.ct - %score.t | .timer 1 1 stop %ipp
- if ($gatherinfo(schat)) { schatsend $+(0,$chr(44),%idd,Server) $+($chr(35),%idd,:,$col(end)) The gather ends draw %score.ct - %score.t }
- }
- }
- elseif (%score < 30) {
- if (%score.ct >= 16) {
- writeini -n $gfile(gatherservers.ini) $1 status Ended
- var %i = 1, %t = $null, %tini = $gfile(counter.ini) | while (%i <= $ini(%tini,%ipp,0)) { var %s = $ini(%tini,%ipp,%i), %t = %t $gauth(%s), %t.sid = %t.sid %s | writeini -n %gamestats %s Loss 1 | inc %i }
- var %i = 1, %ct = $null, %ctini = $gfile(terrorist.ini) | while (%i <= $ini(%ctini,%ipp,0)) { var %s = $ini(%ctini,%ipp,%i), %ct = %ct $gauth(%s), %ct.sid = %ct.sid %s | writeini -n %gamestats %s Wins 1 | inc %i }
- writeini -n %gamestats %ipp CT $iif(%ct.sid,$ifmatch,0) | writeini -n %gamestats %ipp TERRORIST $iif(%t.sid,$ifmatch,0) | writeini -n %gamestats %ipp TeamWon CT | writeini -n %gamestats %ipp Score $+(%score.ct,-,%score.t)
- rconsend %ipp say Counter-Terrorist won the gather %score.ct - %score.t | .timer 1 1 stop %ipp
- if ($gatherinfo(schat)) { schatsend $+(0,$chr(44),%idd,Server) $+($chr(35),%idd,:,$col(end)) Counter-Terrorist won the gather %score.ct - %score.t }
- }
- elseif (%score.t >= 16) {
- writeini -n $gfile(gatherservers.ini) $1 status Ended
- var %i = 1, %t = $null, %tini = $gfile(counter.ini) | while (%i <= $ini(%tini,%ipp,0)) { var %s = $ini(%tini,%ipp,%i), %t = %t $gauth(%s), %t.sid = %t.sid %s | writeini -n %gamestats %s Wins 1 | inc %i }
- var %i = 1, %ct = $null, %ctini = $gfile(terrorist.ini) | while (%i <= $ini(%ctini,%ipp,0)) { var %s = $ini(%ctini,%ipp,%i), %ct = %ct $gauth(%s), %ct.sid = %ct.sid %s | writeini -n %gamestats %s Loss 1 | inc %i }
- writeini -n %gamestats %ipp CT $iif(%ct.sid,$ifmatch,0) | writeini -n %gamestats %ipp TERRORIST $iif(%t.sid,$ifmatch,0) | writeini -n %gamestats %ipp TeamWon TERRORIST | writeini -n %gamestats %ipp Score $+(%score.t,-,%score.ct)
- rconsend %ipp say Terrorist won the gather %score.t - %score.ct | .timer 1 1 stop %ipp
- if ($gatherinfo(schat)) { schatsend $+(0,$chr(44),%idd,Server) $+($chr(35),%idd,:,$col(end)) Terrorist won the gather %score.t - %score.ct }
- }
- }
- elseif ($calc(%score.ct - %score.t) > 3) || ($calc(%score.ct - %score.t) > $calc($mr3(%score) - %score)) {
- writeini -n $gfile(gatherservers.ini) $1 status Ended
- if ($sameteam($calc(%score -1))) { var %ctini = $gfile(counter.ini), %tini = $gfile(terrorist.ini) } | else { var %tini = $gfile(counter.ini), %ctini = $gfile(terrorist.ini) }
- var %i = 1, %t = $null | while (%i <= $ini(%tini,%ipp,0)) { var %s = $ini(%tini,%ipp,%i), %t = %t $gauth(%s), %t.sid = %t.sid %s | writeini -n %gamestats %s Loss 1 | inc %i }
- var %i = 1, %ct = $null | while (%i <= $ini(%ctini,%ipp,0)) { var %s = $ini(%ctini,%ipp,%i), %ct = %ct $gauth(%s), %ct.sid = %ct.sid %s | writeini -n %gamestats %s Wins 1 | inc %i }
- writeini -n %gamestats %ipp CT $iif(%ct.sid,$ifmatch,0) | writeini -n %gamestats %ipp TERRORIST $iif(%t.sid,$ifmatch,0) | writeini -n %gamestats %ipp TeamWon CT | writeini -n %gamestats %ipp Score $+(%score.ct,-,%score.t)
- rconsend %ipp say Counter-Terrorist won the gather %score.ct - %score.t | .timer 1 1 stop %ipp
- if ($gatherinfo(schat)) { schatsend $+(0,$chr(44),%idd,Server) $+($chr(35),%idd,:,$col(end)) Counter-Terrorist won the gather %score.ct - %score.t }
- }
- elseif ($calc(%score.t - %score.ct) > 3) || ($calc(%score.t - %score.ct) > $calc($mr3(%score) - %score)) {
- writeini -n $gfile(gatherservers.ini) $1 status Ended
- if ($sameteam($calc(%score -1))) { var %ctini = $gfile(counter.ini), %tini = $gfile(terrorist.ini) } | else { var %tini = $gfile(counter.ini), %ctini = $gfile(terrorist.ini) }
- var %i = 1, %t = $null | while (%i <= $ini(%tini,%ipp,0)) { var %s = $ini(%tini,%ipp,%i), %t = %t $gauth(%s), %t.sid = %t.sid %s | writeini -n %gamestats %s Wins 1 | inc %i }
- var %i = 1, %ct = $null | while (%i <= $ini(%ctini,%ipp,0)) { var %s = $ini(%ctini,%ipp,%i), %ct = %ct $gauth(%s), %ct.sid = %ct.sid %s | writeini -n %gamestats %s Loss 1 | inc %i }
- writeini -n %gamestats %ipp CT $iif(%ct.sid,$ifmatch,0) | writeini -n %gamestats %ipp TERRORIST $iif(%t.sid,$ifmatch,0) | writeini -n %gamestats %ipp TeamWon TERRORIST | writeini -n %gamestats %ipp Score $+(%score.t,-,%score.ct)
- rconsend %ipp say Terrorist won the gather %score.t - %score.ct | .timer 1 1 stop %ipp
- if ($gatherinfo(schat)) { schatsend $+(0,$chr(44),%idd,Server) $+($chr(35),%idd,:,$col(end)) Terrorist won the gather %score.t - %score.ct }
- }
- elseif (%score == $mr3(%score)) {
- if (%score.ct > %score.t) {
- writeini -n $gfile(gatherservers.ini) $1 status Ended
- if ($sameteam($calc(%score -1))) { var %ctini = $gfile(counter.ini), %tini = $gfile(terrorist.ini) } | else { var %tini = $gfile(counter.ini), %ctini = $gfile(terrorist.ini) }
- var %i = 1, %t = $null | while (%i <= $ini(%tini,%ipp,0)) { var %s = $ini(%tini,%ipp,%i), %t = %t $gauth(%s), %t.sid = %t.sid %s | writeini -n %gamestats %s Loss 1 | inc %i }
- var %i = 1, %ct = $null | while (%i <= $ini(%ctini,%ipp,0)) { var %s = $ini(%ctini,%ipp,%i), %ct = %ct $gauth(%s), %ct.sid = %ct.sid %s | writeini -n %gamestats %s Wins 1 | inc %i }
- writeini -n %gamestats %ipp CT $iif(%ct.sid,$ifmatch,0) | writeini -n %gamestats %ipp TERRORIST $iif(%t.sid,$ifmatch,0) | writeini -n %gamestats %ipp TeamWon CT | writeini -n %gamestats %ipp Score $+(%score.ct,-,%score.t)
- rconsend %ipp say Counter-Terrorist won the gather %score.ct - %score.t | .timer 1 1 stop %ipp
- if ($gatherinfo(schat)) { schatsend $+(0,$chr(44),%idd,Server) $+($chr(35),%idd,:,$col(end)) Counter-Terrorist won the gather %score.ct - %score.t }
- }
- elseif (%score.t > %score.ct) {
- writeini -n $gfile(gatherservers.ini) $1 status Ended
- if ($sameteam($calc(%score -1))) { var %ctini = $gfile(counter.ini), %tini = $gfile(terrorist.ini) } | else { var %tini = $gfile(counter.ini), %ctini = $gfile(terrorist.ini) }
- var %i = 1, %t = $null | while (%i <= $ini(%tini,%ipp,0)) { var %s = $ini(%tini,%ipp,%i), %t = %t $gauth(%s), %t.sid = %t.sid %s | writeini -n %gamestats %s Wins 1 | inc %i }
- var %i = 1, %ct = $null | while (%i <= $ini(%ctini,%ipp,0)) { var %s = $ini(%ctini,%ipp,%i), %ct = %ct $gauth(%s), %ct.sid = %ct.sid %s | writeini -n %gamestats %s Loss 1 | inc %i }
- writeini -n %gamestats %ipp CT $iif(%ct.sid,$ifmatch,0) | writeini -n %gamestats %ipp TERRORIST $iif(%t.sid,$ifmatch,0) | writeini -n %gamestats %ipp TeamWon TERRORIST | writeini -n %gamestats %ipp Score $+(%score.t,-,%score.ct)
- rconsend %ipp say Terrorist won the gather %score.t - %score.ct | .timer 1 1 stop %ipp
- if ($gatherinfo(schat)) { schatsend $+(0,$chr(44),%idd,Server) $+($chr(35),%idd,:,$col(end)) Terrorist won the gather %score.t - %score.ct }
- }
- elseif ($gatherinfo(game) != CS:GO) {
- writeini -n $gfile(gatherservers.ini) %ipp status Pregame | rconsend %ipp say Counter-Terrorist: %score.ct - Terrorist: %score.t
- rconsend %ipp say Second half is over - Time to change teams! | .score %ipp switch | .timer 1 1 swapteams %ipp
- if ($gatherinfo(amx)) && ($ini($gfile(joined.ini),%ipp,0) >= 1) && (!%forceteams. [ $+ [ %ipp ] ]) { set -u10 %forceteams. [ $+ [ %ipp ] ] 1 | .timer 1 2 rconsend %ipp status }
- }
- else {
- ;writeini -n $gfile(gatherservers.ini) %ipp status Pregame | rconsend %ipp say Counter-Terrorist: %score.ct - Terrorist: %score.t
- ;rconsend %ipp say Second half is over - Time to change teams! | ;rconsend %ipp mp_swapteams | ;.score %ipp switch | ;.timer 1 1 swapteams %ipp
- rconsend %ipp say Second half is over - Get ready for overtime!
- if ($gatherinfo(amx)) && ($ini($gfile(joined.ini),%ipp,0) >= 1) && (!%forceteams. [ $+ [ %ipp ] ]) { set -u10 %forceteams. [ $+ [ %ipp ] ] 1 | .timer 1 2 rconsend %ipp status }
- }
- }
- elseif (%score == $mr3.half(%score)) {
- if ($gatherinfo(game) != CS:GO) {
- writeini -n $gfile(gatherservers.ini) %ipp status Pregame | rconsend %ipp say Counter-Terrorist: %score.ct - Terrorist: %score.t
- rconsend %ipp say First half is over - Time to change teams! | .score %ipp switch | .timer 1 1 swapteams %ipp
- if ($gatherinfo(amx)) && ($ini($gfile(joined.ini),%ipp,0) >= 1) && (!%forceteams. [ $+ [ %ipp ] ]) { set -u10 %forceteams. [ $+ [ %ipp ] ] 1 | .timer 1 2 rconsend %ipp status }
- }
- else {
- ;writeini -n $gfile(gatherservers.ini) %ipp status Pregame | rconsend %ipp say Counter-Terrorist: %score.ct - Terrorist: %score.t
- rconsend %ipp say First half is over - Time to change teams! | .score %ipp switch | .timer 1 1 swapteams %ipp
- if ($gatherinfo(amx)) && ($ini($gfile(joined.ini),%ipp,0) >= 1) && (!%forceteams. [ $+ [ %ipp ] ]) { set -u10 %forceteams. [ $+ [ %ipp ] ] 1 | .timer 1 2 rconsend %ipp status }
- }
- }
- }
- alias team_t_won {
- var %ipp = $1, %idd = $serverid(%ipp), %gamestats = $gamestatsini(%ipp)
- .timerbombdefused. [ $+ [ %ipp ] ] off | set -u5 %roundend. [ $+ [ %ipp ] ] 1 | set -u5 %teamwon. [ $+ [ %ipp ] ] TERRORIST
- var %score = $score(%ipp,total), %score.ct = $score(%ipp,ct), %score.t = $score(%ipp,t)
- if ($2 isnum) && ($3 isnum) {
- var %newscore.t = $calc($2 - 1), %newscore.ct = $3
- writeini -n $gfile(score.ini) %ipp antiterrorist %newscore.ct
- writeini -n $gfile(score.ini) %ipp terrorist %newscore.t
- }
- score %ipp inc t | checkace %ipp | var %score = $score(%ipp,total), %score.ct = $score(%ipp,ct), %score.t = $score(%ipp,t)
- logit %ipp Team TERRORIST won the round. CT: %score.ct - T: %score.t
- logit2 %ipp Team TERRORIST won the round. CT: %score.ct - T: %score.t
- srcon_echo %ipp Team TERRORIST won the round. CT: %score.ct - T: %score.t
- if ($gatherinfo(schat)) { schatsend $+(0,$chr(44),%idd,Server) $+($chr(35),%idd,:,$col(end)) Team TERRORIST won the round. CT: %score.ct - T: %score.t }
- if (%score == 15) {
- writeini -n $gfile(gatherservers.ini) %ipp status Pregame | rconsend %ipp say Counter-Terrorist: %score.ct - Terrorist: %score.t
- rconsend %ipp say First half is over - Time to change teams! | .score %ipp switch | .timer 1 1 swapteams %ipp
- if ($gatherinfo(amx)) && ($ini($gfile(joined.ini),%ipp,0) >= 1) && (!%forceteams. [ $+ [ %ipp ] ]) { set -u10 %forceteams. [ $+ [ %ipp ] ] 1 | .timer 1 2 rconsend %ipp status }
- }
- elseif (%score == 30) {
- if (%score.t > %score.ct) {
- writeini -n $gfile(gatherservers.ini) $1 status Ended
- var %i = 1, %t = $null, %tini = $gfile(counter.ini) | while (%i <= $ini(%tini,%ipp,0)) { var %s = $ini(%tini,%ipp,%i), %t = %t $gauth(%s), %t.sid = %t.sid %s | writeini -n %gamestats %s Wins 1 | inc %i }
- var %i = 1, %ct = $null, %ctini = $gfile(terrorist.ini) | while (%i <= $ini(%ctini,%ipp,0)) { var %s = $ini(%ctini,%ipp,%i), %ct = %ct $gauth(%s), %ct.sid = %ct.sid %s | writeini -n %gamestats %s Loss 1 | inc %i }
- writeini -n %gamestats %ipp CT $iif(%ct.sid,$ifmatch,0) | writeini -n %gamestats %ipp TERRORIST $iif(%t.sid,$ifmatch,0) | writeini -n %gamestats %ipp TeamWon TERRORIST | writeini -n %gamestats %ipp Score $+(%score.t,-,%score.ct)
- rconsend %ipp say Terrorist won the gather %score.t - %score.ct | .timer 1 1 stop %ipp
- if ($gatherinfo(schat)) { schatsend $+(0,$chr(44),%idd,Server) $+($chr(35),%idd,:,$col(end)) Terrorist won the gather %score.t - %score.ct }
- }
- elseif (%score.ct > %score.t) {
- writeini -n $gfile(gatherservers.ini) $1 status Ended
- var %i = 1, %t = $null, %tini = $gfile(counter.ini) | while (%i <= $ini(%tini,%ipp,0)) { var %s = $ini(%tini,%ipp,%i), %t = %t $gauth(%s), %t.sid = %t.sid %s | writeini -n %gamestats %s Loss 1 | inc %i }
- var %i = 1, %ct = $null, %ctini = $gfile(terrorist.ini) | while (%i <= $ini(%ctini,%ipp,0)) { var %s = $ini(%ctini,%ipp,%i), %ct = %ct $gauth(%s), %ct.sid = %ct.sid %s | writeini -n %gamestats %s Wins 1 | inc %i }
- writeini -n %gamestats %ipp CT $iif(%ct.sid,$ifmatch,0) | writeini -n %gamestats %ipp TERRORIST $iif(%t.sid,$ifmatch,0) | writeini -n %gamestats %ipp TeamWon CT | writeini -n %gamestats %ipp Score $+(%score.ct,-,%score.t)
- rconsend %ipp say Counter-Terrorist won the gather %score.ct - %score.t | .timer 1 1 stop %ipp
- if ($gatherinfo(schat)) { schatsend $+(0,$chr(44),%idd,Server) $+($chr(35),%idd,:,$col(end)) Counter-Terrorist won the gather %score.ct - %score.t }
- }
- elseif ($gatherinfo(game) != CS:GO) {
- writeini -n $gfile(gatherservers.ini) %ipp status Pregame | rconsend %ipp say Counter-Terrorist: %score.ct - Terrorist: %score.t
- rconsend %ipp say First half is over - Time to change teams! | .score %ipp switch | .timer 1 1 swapteams %ipp
- if ($gatherinfo(amx)) && ($ini($gfile(joined.ini),%ipp,0) >= 1) && (!%forceteams. [ $+ [ %ipp ] ]) { set -u10 %forceteams. [ $+ [ %ipp ] ] 1 | .timer 1 2 rconsend %ipp status }
- }
- elseif ($gatherinfo(overtime)) || (#rasta.gather == $mainchan) || (#go.ee == $mainchan) || (#cisgl.gotime2 == $mainchan) || (#gamebase.csgo == $mainchan) || (#ihl.csgo == $mainchan) {
- ;writeini -n $gfile(gatherservers.ini) %ipp status Pregame | rconsend %ipp say Counter-Terrorist: %score.ct - Terrorist: %score.t
- ;rconsend %ipp say Second half is over - Time to change teams! | ;rconsend %ipp mp_swapteams | ;.score %ipp switch | ;.timer 1 1 swapteams %ipp
- rconsend %ipp say Second half is over - Get ready for overtime!
- if ($gatherinfo(amx)) && ($ini($gfile(joined.ini),%ipp,0) >= 1) && (!%forceteams. [ $+ [ %ipp ] ]) { set -u10 %forceteams. [ $+ [ %ipp ] ] 1 | .timer 1 2 rconsend %ipp status }
- }
- else {
- writeini -n $gfile(gatherservers.ini) $1 status Ended
- var %i = 1, %t = $null, %tini = $gfile(counter.ini) | while (%i <= $ini(%tini,%ipp,0)) { var %s = $ini(%tini,%ipp,%i), %t = %t $gauth(%s), %t.sid = %t.sid %s | writeini -n %gamestats %s Draw 1 | inc %i }
- var %i = 1, %ct = $null, %ctini = $gfile(terrorist.ini) | while (%i <= $ini(%ctini,%ipp,0)) { var %s = $ini(%ctini,%ipp,%i), %ct = %ct $gauth(%s), %ct.sid = %ct.sid %s | writeini -n %gamestats %s Draw 1 | inc %i }
- writeini -n %gamestats %ipp CT $iif(%ct.sid,$ifmatch,0) | writeini -n %gamestats %ipp TERRORIST $iif(%t.sid,$ifmatch,0) | writeini -n %gamestats %ipp TeamWon Draw | writeini -n %gamestats %ipp Score $+(%score.ct,-,%score.t)
- rconsend %ipp say The gather ends draw %score.ct - %score.t | .timer 1 1 stop %ipp
- if ($gatherinfo(schat)) { schatsend $+(0,$chr(44),%idd,Server) $+($chr(35),%idd,:,$col(end)) The gather ends draw %score.ct - %score.t }
- }
- }
- elseif (%score < 30) {
- if (%score.t >= 16) {
- writeini -n $gfile(gatherservers.ini) $1 status Ended
- var %i = 1, %t = $null, %tini = $gfile(counter.ini) | while (%i <= $ini(%tini,%ipp,0)) { var %s = $ini(%tini,%ipp,%i), %t = %t $gauth(%s), %t.sid = %t.sid %s | writeini -n %gamestats %s Wins 1 | inc %i }
- var %i = 1, %ct = $null, %ctini = $gfile(terrorist.ini) | while (%i <= $ini(%ctini,%ipp,0)) { var %s = $ini(%ctini,%ipp,%i), %ct = %ct $gauth(%s), %ct.sid = %ct.sid %s | writeini -n %gamestats %s Loss 1 | inc %i }
- writeini -n %gamestats %ipp CT $iif(%ct.sid,$ifmatch,0) | writeini -n %gamestats %ipp TERRORIST $iif(%t.sid,$ifmatch,0) | writeini -n %gamestats %ipp TeamWon TERRORIST | writeini -n %gamestats %ipp Score $+(%score.t,-,%score.ct)
- rconsend %ipp say Terrorist won the gather %score.t - %score.ct | .timer 1 1 stop %ipp
- if ($gatherinfo(schat)) { schatsend $+(0,$chr(44),%idd,Server) $+($chr(35),%idd,:,$col(end)) Terrorist won the gather %score.t - %score.ct }
- }
- elseif (%score.ct >= 16) {
- writeini -n $gfile(gatherservers.ini) $1 status Ended
- var %i = 1, %t = $null, %tini = $gfile(counter.ini) | while (%i <= $ini(%tini,%ipp,0)) { var %s = $ini(%tini,%ipp,%i), %t = %t $gauth(%s), %t.sid = %t.sid %s | writeini -n %gamestats %s Loss 1 | inc %i }
- var %i = 1, %ct = $null, %ctini = $gfile(terrorist.ini) | while (%i <= $ini(%ctini,%ipp,0)) { var %s = $ini(%ctini,%ipp,%i), %ct = %ct $gauth(%s), %ct.sid = %ct.sid %s | writeini -n %gamestats %s Wins 1 | inc %i }
- writeini -n %gamestats %ipp CT $iif(%ct.sid,$ifmatch,0) | writeini -n %gamestats %ipp TERRORIST $iif(%t.sid,$ifmatch,0) | writeini -n %gamestats %ipp TeamWon CT | writeini -n %gamestats %ipp Score $+(%score.ct,-,%score.t)
- rconsend %ipp say Counter-Terrorist won the gather %score.ct - %score.t | .timer 1 1 stop %ipp
- if ($gatherinfo(schat)) { schatsend $+(0,$chr(44),%idd,Server) $+($chr(35),%idd,:,$col(end)) Counter-Terrorist won the gather %score.ct - %score.t }
- }
- }
- elseif ($calc(%score.t - %score.ct) > 3) || ($calc(%score.t - %score.ct) > $calc($mr3(%score) - %score)) {
- writeini -n $gfile(gatherservers.ini) $1 status Ended
- if ($sameteam($calc(%score -1))) { var %ctini = $gfile(counter.ini), %tini = $gfile(terrorist.ini) } | else { var %tini = $gfile(counter.ini), %ctini = $gfile(terrorist.ini) }
- var %i = 1, %t = $null | while (%i <= $ini(%tini,%ipp,0)) { var %s = $ini(%tini,%ipp,%i), %t = %t $gauth(%s), %t.sid = %t.sid %s | writeini -n %gamestats %s Wins 1 | inc %i }
- var %i = 1, %ct = $null | while (%i <= $ini(%ctini,%ipp,0)) { var %s = $ini(%ctini,%ipp,%i), %ct = %ct $gauth(%s), %ct.sid = %ct.sid %s | writeini -n %gamestats %s Loss 1 | inc %i }
- writeini -n %gamestats %ipp CT $iif(%ct.sid,$ifmatch,0) | writeini -n %gamestats %ipp TERRORIST $iif(%t.sid,$ifmatch,0) | writeini -n %gamestats %ipp TeamWon TERRORIST | writeini -n %gamestats %ipp Score $+(%score.t,-,%score.ct)
- rconsend %ipp say Terrorist won the gather %score.t - %score.ct | .timer 1 1 stop %ipp
- if ($gatherinfo(schat)) { schatsend $+(0,$chr(44),%idd,Server) $+($chr(35),%idd,:,$col(end)) Terrorist won the gather %score.t - %score.ct }
- }
- elseif ($calc(%score.ct - %score.t) > 3) || ($calc(%score.ct - %score.t) > $calc($mr3(%score) - %score)) {
- writeini -n $gfile(gatherservers.ini) $1 status Ended
- if ($sameteam($calc(%score -1))) { var %ctini = $gfile(counter.ini), %tini = $gfile(terrorist.ini) } | else { var %tini = $gfile(counter.ini), %ctini = $gfile(terrorist.ini) }
- var %i = 1, %t = $null | while (%i <= $ini(%tini,%ipp,0)) { var %s = $ini(%tini,%ipp,%i), %t = %t $gauth(%s), %t.sid = %t.sid %s | writeini -n %gamestats %s Loss 1 | inc %i }
- var %i = 1, %ct = $null | while (%i <= $ini(%ctini,%ipp,0)) { var %s = $ini(%ctini,%ipp,%i), %ct = %ct $gauth(%s), %ct.sid = %ct.sid %s | writeini -n %gamestats %s Wins 1 | inc %i }
- writeini -n %gamestats %ipp CT $iif(%ct.sid,$ifmatch,0) | writeini -n %gamestats %ipp TERRORIST $iif(%t.sid,$ifmatch,0) | writeini -n %gamestats %ipp TeamWon CT | writeini -n %gamestats %ipp Score $+(%score.ct,-,%score.t)
- rconsend %ipp say Counter-Terrorist won the gather %score.ct - %score.t | .timer 1 1 stop %ipp
- if ($gatherinfo(schat)) { schatsend $+(0,$chr(44),%idd,Server) $+($chr(35),%idd,:,$col(end)) Counter-Terrorist won the gather %score.ct - %score.t }
- }
- elseif (%score == $mr3(%score)) {
- if (%score.t > %score.ct) {
- writeini -n $gfile(gatherservers.ini) $1 status Ended
- if ($sameteam($calc(%score -1))) { var %ctini = $gfile(counter.ini), %tini = $gfile(terrorist.ini) } | else { var %tini = $gfile(counter.ini), %ctini = $gfile(terrorist.ini) }
- var %i = 1, %t = $null | while (%i <= $ini(%tini,%ipp,0)) { var %s = $ini(%tini,%ipp,%i), %t = %t $gauth(%s), %t.sid = %t.sid %s | writeini -n %gamestats %s Wins 1 | inc %i }
- var %i = 1, %ct = $null | while (%i <= $ini(%ctini,%ipp,0)) { var %s = $ini(%ctini,%ipp,%i), %ct = %ct $gauth(%s), %ct.sid = %ct.sid %s | writeini -n %gamestats %s Loss 1 | inc %i }
- writeini -n %gamestats %ipp CT $iif(%ct.sid,$ifmatch,0) | writeini -n %gamestats %ipp TERRORIST $iif(%t.sid,$ifmatch,0) | writeini -n %gamestats %ipp TeamWon TERRORIST | writeini -n %gamestats %ipp Score $+(%score.t,-,%score.ct)
- rconsend %ipp say Terrorist won the gather %score.t - %score.ct | .timer 1 1 stop %ipp
- if ($gatherinfo(schat)) { schatsend $+(0,$chr(44),%idd,Server) $+($chr(35),%idd,:,$col(end)) Terrorist won the gather %score.t - %score.ct }
- }
- elseif (%score.ct > %score.t) {
- writeini -n $gfile(gatherservers.ini) $1 status Ended
- if ($sameteam($calc(%score -1))) { var %ctini = $gfile(counter.ini), %tini = $gfile(terrorist.ini) } | else { var %tini = $gfile(counter.ini), %ctini = $gfile(terrorist.ini) }
- var %i = 1, %t = $null | while (%i <= $ini(%tini,%ipp,0)) { var %s = $ini(%tini,%ipp,%i), %t = %t $gauth(%s), %t.sid = %t.sid %s | writeini -n %gamestats %s Loss 1 | inc %i }
- var %i = 1, %ct = $null | while (%i <= $ini(%ctini,%ipp,0)) { var %s = $ini(%ctini,%ipp,%i), %ct = %ct $gauth(%s), %ct.sid = %ct.sid %s | writeini -n %gamestats %s Wins 1 | inc %i }
- writeini -n %gamestats %ipp CT $iif(%ct.sid,$ifmatch,0) | writeini -n %gamestats %ipp TERRORIST $iif(%t.sid,$ifmatch,0) | writeini -n %gamestats %ipp TeamWon CT | writeini -n %gamestats %ipp Score $+(%score.ct,-,%score.t)
- rconsend %ipp say Counter-Terrorist won the gather %score.ct - %score.t | .timer 1 1 stop %ipp
- if ($gatherinfo(schat)) { schatsend $+(0,$chr(44),%idd,Server) $+($chr(35),%idd,:,$col(end)) Counter-Terrorist won the gather %score.ct - %score.t }
- }
- elseif ($gatherinfo(game) != CS:GO) {
- writeini -n $gfile(gatherservers.ini) %ipp status Pregame | rconsend %ipp say Counter-Terrorist: %score.ct - Terrorist: %score.t
- rconsend %ipp say Second half is over - Time to change teams! | .score %ipp switch | .timer 1 1 swapteams %ipp
- if ($gatherinfo(amx)) && ($ini($gfile(joined.ini),%ipp,0) >= 1) && (!%forceteams. [ $+ [ %ipp ] ]) { set -u10 %forceteams. [ $+ [ %ipp ] ] 1 | .timer 1 2 rconsend %ipp status }
- }
- else {
- ;writeini -n $gfile(gatherservers.ini) %ipp status Pregame | rconsend %ipp say Counter-Terrorist: %score.ct - Terrorist: %score.t
- ;rconsend %ipp say Second half is over - Time to change teams! | ;rconsend %ipp mp_swapteams | ;.score %ipp switch | ;.timer 1 1 swapteams %ipp
- rconsend %ipp say Second half is over - Get ready for overtime!
- if ($gatherinfo(amx)) && ($ini($gfile(joined.ini),%ipp,0) >= 1) && (!%forceteams. [ $+ [ %ipp ] ]) { set -u10 %forceteams. [ $+ [ %ipp ] ] 1 | .timer 1 2 rconsend %ipp status }
- }
- }
- elseif (%score == $mr3.half(%score)) {
- if ($gatherinfo(game) != CS:GO) {
- writeini -n $gfile(gatherservers.ini) %ipp status Pregame | rconsend %ipp say Counter-Terrorist: %score.ct - Terrorist: %score.t
- rconsend %ipp say First half is over - Time to change teams! | .score %ipp switch | .timer 1 1 swapteams %ipp
- if ($gatherinfo(amx)) && ($ini($gfile(joined.ini),%ipp,0) >= 1) && (!%forceteams. [ $+ [ %ipp ] ]) { set -u10 %forceteams. [ $+ [ %ipp ] ] 1 | .timer 1 2 rconsend %ipp status }
- }
- else {
- ;writeini -n $gfile(gatherservers.ini) %ipp status Pregame | rconsend %ipp say Counter-Terrorist: %score.ct - Terrorist: %score.t
- rconsend %ipp say First half is over - Time to change teams! | .score %ipp switch | .timer 1 1 swapteams %ipp
- if ($gatherinfo(amx)) && ($ini($gfile(joined.ini),%ipp,0) >= 1) && (!%forceteams. [ $+ [ %ipp ] ]) { set -u10 %forceteams. [ $+ [ %ipp ] ] 1 | .timer 1 2 rconsend %ipp status }
- }
- }
- }
- alias setscore {
- var %ipp = $1, %idd = $serverid(%ipp), %gamestats = $gamestatsini(%ipp)
- if ($2 == ct) || ($2 == counter) || ($2 == counterterrorist) {
- if ($3 isnum 0-15) && ($calc($3 + $score(%ipp,t)) <= 29) {
- writeini -n $gfile(score.ini) %ipp antiterrorist $3 | score %ipp save | rconsend %ipp say $+($chr(91),$iif($readini($gfile(gatherservers.ini),%ipp,status),$ifmatch,Score),$chr(93)) CounterTerrorist: $score(%ipp,ct) - Terrorist: $score(%ipp,t)
- }
- elseif ($3 isnum 15) && ($calc($3 + $score(%ipp,t)) == 30) {
- writeini -n $gfile(gatherservers.ini) $1 status Ended
- writeini -n $gfile(score.ini) %ipp antiterrorist $3 | rconsend %ipp say $+($chr(91),$iif($readini($gfile(gatherservers.ini),%ipp,status),$ifmatch,Score),$chr(93)) CounterTerrorist: $score(%ipp,ct) - Terrorist: $score(%ipp,t)
- var %i = 1, %t = $null, %tini = $gfile(counter.ini) | while (%i <= $ini(%tini,%ipp,0)) { var %s = $ini(%tini,%ipp,%i), %t = %t $gauth(%s), %t.sid = %t.sid %s | writeini -n %gamestats %s Draw 1 | inc %i }
- var %i = 1, %ct = $null, %ctini = $gfile(terrorist.ini) | while (%i <= $ini(%ctini,%ipp,0)) { var %s = $ini(%ctini,%ipp,%i), %ct = %ct $gauth(%s), %ct.sid = %ct.sid %s | writeini -n %gamestats %s Draw 1 | inc %i }
- writeini -n %gamestats %ipp CT $iif(%ct.sid,$ifmatch,0) | writeini -n %gamestats %ipp TERRORIST $iif(%t.sid,$ifmatch,0) | writeini -n %gamestats %ipp TeamWon Draw | writeini -n %gamestats %ipp Score $+($score(%ipp,ct),-,$score(%ipp,t))
- rconsend %ipp say The gather ends draw $score(%ipp,ct) - $score(%ipp,t) | .timer 1 1 stop %ipp
- if ($gatherinfo(schat)) { schatsend $+(0,$chr(44),%idd,Server) $+($chr(35),%idd,:,$col(end)) The gather ends draw $score(%ipp,ct) - $score(%ipp,t) }
- }
- elseif ($3 isnum 16) && ($calc($3 + $score(%ipp,t)) <= 30) {
- writeini -n $gfile(gatherservers.ini) $1 status Ended
- writeini -n $gfile(score.ini) %ipp antiterrorist $3 | rconsend %ipp say $+($chr(91),$iif($readini($gfile(gatherservers.ini),%ipp,status),$ifmatch,Score),$chr(93)) CounterTerrorist: $score(%ipp,ct) - Terrorist: $score(%ipp,t)
- var %i = 1, %t = $null, %tini = $gfile(counter.ini) | while (%i <= $ini(%tini,%ipp,0)) { var %s = $ini(%tini,%ipp,%i), %t = %t $gauth(%s), %t.sid = %t.sid %s | writeini -n %gamestats %s Loss 1 | inc %i }
- var %i = 1, %ct = $null, %ctini = $gfile(terrorist.ini) | while (%i <= $ini(%ctini,%ipp,0)) { var %s = $ini(%ctini,%ipp,%i), %ct = %ct $gauth(%s), %ct.sid = %ct.sid %s | writeini -n %gamestats %s Wins 1 | inc %i }
- writeini -n %gamestats %ipp CT $iif(%ct.sid,$ifmatch,0) | writeini -n %gamestats %ipp TERRORIST $iif(%t.sid,$ifmatch,0) | writeini -n %gamestats %ipp TeamWon CT | writeini -n %gamestats %ipp Score $+($score(%ipp,ct),-,$score(%ipp,t))
- rconsend %ipp say Counter-Terrorist won the gather $score(%ipp,ct) - $score(%ipp,t) | .timer 1 1 stop %ipp
- if ($gatherinfo(schat)) { schatsend $+(0,$chr(44),%idd,Server) $+($chr(35),%idd,:,$col(end)) Counter-Terrorist won the gather $score(%ipp,ct) - $score(%ipp,t) }
- }
- }
- elseif ($2 == terrorist) || ($2 == t) {
- if ($3 isnum 0-15) && ($calc($3 + $score(%ipp,ct)) <= 29) {
- writeini -n $gfile(score.ini) %ipp terrorist $3 | score %ipp save | rconsend %ipp say $+($chr(91),$iif($readini($gfile(gatherservers.ini),%ipp,status),$ifmatch,Score),$chr(93)) CounterTerrorist: $score(%ipp,ct) - Terrorist: $score(%ipp,t)
- }
- elseif ($3 isnum 15) && ($calc($3 + $score(%ipp,ct)) == 30) {
- writeini -n $gfile(gatherservers.ini) $1 status Ended
- writeini -n $gfile(score.ini) %ipp terrorist $3 | score %ipp save | rconsend %ipp say $+($chr(91),$iif($readini($gfile(gatherservers.ini),%ipp,status),$ifmatch,Score),$chr(93)) CounterTerrorist: $score(%ipp,ct) - Terrorist: $score(%ipp,t)
- var %i = 1, %t = $null, %tini = $gfile(counter.ini) | while (%i <= $ini(%tini,%ipp,0)) { var %s = $ini(%tini,%ipp,%i), %t = %t $gauth(%s), %t.sid = %t.sid %s | writeini -n %gamestats %s Draw 1 | inc %i }
- var %i = 1, %ct = $null, %ctini = $gfile(terrorist.ini) | while (%i <= $ini(%ctini,%ipp,0)) { var %s = $ini(%ctini,%ipp,%i), %ct = %ct $gauth(%s), %ct.sid = %ct.sid %s | writeini -n %gamestats %s Draw 1 | inc %i }
- writeini -n %gamestats %ipp CT $iif(%ct.sid,$ifmatch,0) | writeini -n %gamestats %ipp TERRORIST $iif(%t.sid,$ifmatch,0) | writeini -n %gamestats %ipp TeamWon Draw | writeini -n %gamestats %ipp Score $+($score(%ipp,ct),-,$score(%ipp,t))
- rconsend %ipp say The gather ends draw $score(%ipp,ct) - $score(%ipp,t) | .timer 1 1 stop %ipp
- if ($gatherinfo(schat)) { schatsend $+(0,$chr(44),%idd,Server) $+($chr(35),%idd,:,$col(end)) The gather ends draw $score(%ipp,ct) - $score(%ipp,t) }
- }
- elseif ($3 isnum 16) && ($calc($3 + $score(%ipp,ct)) <= 30) {
- writeini -n $gfile(gatherservers.ini) $1 status Ended
- writeini -n $gfile(score.ini) %ipp terrorist $3 | score %ipp save | rconsend %ipp say $+($chr(91),$iif($readini($gfile(gatherservers.ini),%ipp,status),$ifmatch,Score),$chr(93)) CounterTerrorist: $score(%ipp,ct) - Terrorist: $score(%ipp,t)
- var %i = 1, %t = $null, %tini = $gfile(counter.ini) | while (%i <= $ini(%tini,%ipp,0)) { var %s = $ini(%tini,%ipp,%i), %t = %t $gauth(%s), %t.sid = %t.sid %s | writeini -n %gamestats %s Wins 1 | inc %i }
- var %i = 1, %ct = $null, %ctini = $gfile(terrorist.ini) | while (%i <= $ini(%ctini,%ipp,0)) { var %s = $ini(%ctini,%ipp,%i), %ct = %ct $gauth(%s), %ct.sid = %ct.sid %s | writeini -n %gamestats %s Loss 1 | inc %i }
- writeini -n %gamestats %ipp CT $iif(%ct.sid,$ifmatch,0) | writeini -n %gamestats %ipp TERRORIST $iif(%t.sid,$ifmatch,0) | writeini -n %gamestats %ipp TeamWon TERRORIST | writeini -n %gamestats %ipp Score $+($score(%ipp,t),-,$score(%ipp,ct))
- rconsend %ipp say Terrorist won the gather $score(%ipp,t) - $score(%ipp,ct) | .timer 1 1 stop %ipp
- if ($gatherinfo(schat)) { schatsend $+(0,$chr(44),%idd,Server) $+($chr(35),%idd,:,$col(end)) Terrorist won the gather $score(%ipp,t) - $score(%ipp,ct) }
- }
- }
- }
- alias teamcolor {
- if ($1 == CT) || ($1 == Counter) || ($1 == CounterTerrorist) || ($1 == Counter-Terrorist) { return $col(11,CT) }
- if ($1 == TERRORIST) { return $col(04,TERRORIST) }
- if ($1 == T) { return $col(04,T) }
- return $1
- }
- alias killpoints {
- var %points = $getpoints($1), %apoints = $getpoints($2), %diff = $calc(%points - %apoints)
- if (%points < 1000) || (%apoints < 1000) {
- if (%diff >= 1500) { return 0.6 }
- if (%diff >= 1000) { return 0.7 }
- if (%diff >= 600) { return 0.8 }
- if (%diff >= 300) { return 0.9 }
- if (%diff >= -300) { return 1.0 }
- if (%diff >= -600) { return 1.1 }
- if (%diff >= -1000) { return 1.2 }
- if (%diff >= -1500) { return 1.3 }
- return 1.4
- }
- if (%diff >= 1500) { return 0.7 }
- if (%diff >= 800) { return 0.8 }
- if (%diff >= 300) { return 0.9 }
- if (%diff >= -300) { return 1.0 }
- if (%diff >= -800) { return 1.1 }
- if (%diff >= -1300) { return 1.2 }
- return 1.3
- }
- alias echostuff { if (!$window(@echostuff)) { window -ezk0 @echostuff } | echo @echostuff $date ][ $time ][ $1- }
- alias echostuff2 { if (!$window(@echostuff2)) { window -ezk0 @echostuff2 } | echo @echostuff2 $date ][ $time ][ $1- }
- alias ingamenick {
- var %auth = $gauth($2), %nick = $remove($gnick(%auth),$chr(35),[G],-Admin-), %admin = $admin($+($chr(35),%auth)), %ingame = $read(ingamenicks.dat,s,$iif($2,$2,$1)), %isit = $remove($iif(%ingame,$ifmatch,%nick),[G],[A])
- var %team = $iif($readini($gfile(counter.ini),$1,$2),CT,T), %score = $score($1,total), %team = $iif($sameteam(%score),%team,$iif(%team == CT,T,CT)), %n = %team %isit, %name = $replace(%n,$chr(92),$chr(124)) | return %name
- }
- alias tjekteams {
- if (!$sameteam($score($1,total))) { var %ct = $gfile(terrorist.ini), %t = $gfile(counter.ini) } | else { var %ct = $gfile(counter.ini), %t = $gfile(terrorist.ini) }
- var %i = 1, %w = 0 | while (%i <= $ini($gfile(joined.ini),$1,0)) {
- var %x = $ini($gfile(joined.ini),$1,%i), %join = $readini($gfile(joined.ini),$1,%x), %team = $null | if ($readini(%ct,$1,%x)) { var %team = CT } | if ($readini(%t,$1,%x)) { var %team = TERRORIST }
- if (%team) && (%team != %join) { .timer 1 %w rconsend $1 say $gnick($gauth(%x)) needs to be on team $iif(%team == CT,CounterTerrorist!,Terrorist!) | inc %w } | inc %i
- }
- if (!%w) { rconsend $1 say All ingame players are on the right team.. }
- }
- alias tjeklan {
- if (!$readini($gfile(gatherstatus.ini),$1,lantjek)) {
- writeini -n $gfile(gatherstatus.ini) $1 lantjek $time | rconsend $1 say Please wait while checking for LAN.. | set -u10 %lancheck. [ $+ [ $1 ] ] 1 | .timer 1 1 rconsend $1 status
- }
- }
- alias lancheck {
- if ($ini($gfile(newteams.ini),$1)) { resetnewteams $1 } | var %i = 1, %tjek = $null | while (%i <= $ini($gfile(lancheck.ini),$1,0)) {
- var %x = $ini($gfile(lancheck.ini),$1,%i), %xids = $ini($gfile(lancheck.ini),%x,0) | if (%xids >= 2) {
- var %c = 1, %teamct = $null, %teamt = $null | while (%c <= %xids) { var %cx = $ini($gfile(lancheck.ini),%x,%c)
- if ($readini($gfile(counter.ini),$1,%cx)) { var %teamct = %teamct %cx } | elseif ($readini($gfile(terrorist.ini),$1,%cx)) { var %teamt = %teamt %cx } | inc %c
- }
- writeini -n $gfile(newteams.ini) $1 %x %x | if (%teamct) && (%teamt) { var %tjek = lan } | elseif (!%tjek) { var %tjek = sameteam }
- var %g = 1 | while (%g <= $numtok(%teamt,32)) { writeini -n $gfile(newteams.ini) %x $gettok(%teamt,%g,32) $gettok(%teamt,%g,32) | inc %g }
- var %g = 1 | while (%g <= $numtok(%teamct,32)) { writeini -n $gfile(newteams.ini) %x $gettok(%teamct,%g,32) $gettok(%teamct,%g,32) | inc %g }
- }
- remini -n $gfile(lancheck.ini) %x | inc %i
- }
- if ($ini($gfile(lancheck.ini),$1)) { remini -n $gfile(lancheck.ini) $1 } | if (!%tjek) { rconsend $1 say There was not found any players on LAN | .timer 1 1 .tjekteams $1 | resetnewteams $1 }
- elseif (%tjek == sameteam) { rconsend $1 say Players on LAN already on the same team | .timer 1 1 .tjekteams $1 | resetnewteams $1 } | else { rconsend $1 say There was found players on LAN.. | newteams $1 }
- }
- alias checkclutch {
- if (!$sameteam($score($1,total))) { var %ini = $iif($2 == CT,$gfile(terrorist.ini),$gfile(counter.ini)) } | else { var %ini = $iif($2 == CT,$gfile(counter.ini),$gfile(terrorist.ini)) }
- var %dead = $iif($readini($gfile(kills.ini),$1,$2),$ifmatch,0), %team = $ini(%ini,$1,0), %alive = $calc(%team - %dead) | if (%alive == 1) { return $true } | return $false
- }
- alias checkace {
- var %i = 1, %s = 0, %p = $ini($gfile(kills.ini),$1,0), %ct = $iif($readini($gfile(kills.ini),$1,CT),$ifmatch,0), %t = $iif($readini($gfile(kills.ini),$1,TERRORIST),$ifmatch,0), %gamestats = $gamestatsini($1), %teamwon = %teamwon. [ $+ [ $1 ] ]
- if (!$sameteam($score($1,total))) { var %old = %ct, %ct = %t, %t = %old, %teamwon = $iif(%teamwon == CT,TERRORIST,CT) }
- while (%i <= %p) {
- var %x = $ini($gfile(kills.ini),$1,%i), %k = $readini($gfile(kills.ini),$1,%x), %auth = $gauth(%x)
- if (STEAM_*:*:* iswm %x) { var %clutch = $+(clutch,%x)
- if ($readini($gfile(kills.ini),$1,%clutch)) { var %c = $ifmatch, %type = $+(1on,%c), %last = $readini($gfile(lastkill.ini),$1,%x)
- if ($readini($gfile(counter.ini),$1,%x)) { var %t.p = $ini($gfile(terrorist.ini),$1,0)
- if (%t == %t.p) {
- if (%teamwon == CT) {
- if (%c >= 2) && (%c <= 5) {
- if (%c >= 4) { var %points = %c } | elseif (%c == 3) { var %points = 2 } | else { var %points = 1 } | rconsend $1 say $gnick(%x) scored a %type clutch!
- writeini -n %gamestats %x %type $calc($readini(%gamestats,%x,%type) +1) | writeini -n %gamestats %x Points $calc($readini(%gamestats,%x,Points) + %points)
- if (%last) && ($readini($gfile(terrorist.ini),$1,%last)) { var %fail = $+(fail_,%type) | writeini -n %gamestats %last %fail $calc($readini(%gamestats,%last,%fail) +1) }
- }
- elseif (%c == 1) { writeini -n %gamestats %x %type $calc($readini(%gamestats,%x,%type) +1)
- if (%last) && ($readini($gfile(terrorist.ini),$1,%last)) { var %fail = $+(fail_,%type) | writeini -n %gamestats %last %fail $calc($readini(%gamestats,%last,%fail) +1) }
- }
- }
- elseif (%c >= 1) && (%c <= 5) { var %fail = $+(fail_,%type) | writeini -n %gamestats %x %fail $calc($readini(%gamestats,%x,%fail) +1) }
- }
- elseif (%teamwon == CT) {
- var %p = $calc(%t.p - %t + %c), %type = $+(1on,%p) | if (%p >= 4) { var %points = %p } | elseif (%p == 3) { var %points = 2 } | else { var %points = 1 }
- writeini -n %gamestats %x %type $calc($readini(%gamestats,%x,%type) +1) | writeini -n %gamestats %x Points $calc($readini(%gamestats,%x,Points) + %points) | rconsend $1 say $gnick(%x) scored a %type clutch!
- }
- else { var %type = $+(1on,$calc(%t.p - %t + %c)), %fail = $+(fail_,%type) | writeini -n %gamestats %x %fail $calc($readini(%gamestats,%x,%fail) +1) }
- }
- elseif ($readini($gfile(terrorist.ini),$1,%x)) { var %ct.p = $ini($gfile(counter.ini),$1,0)
- if (%ct == %ct.p) {
- if (%teamwon == TERRORIST) {
- if (%c >= 2) && (%c <= 5) {
- if (%c >= 4) { var %points = %c } | elseif (%c == 3) { var %points = 2 } | else { var %points = 1 } | rconsend $1 say $gnick(%x) scored a %type clutch!
- writeini -n %gamestats %x %type $calc($readini(%gamestats,%x,%type) +1) | writeini -n %gamestats %x Points $calc($readini(%gamestats,%x,Points) + %points)
- if (%last) && ($readini($gfile(counter.ini),$1,%last)) { var %fail = $+(fail_,%type) | writeini -n %gamestats %last %fail $calc($readini(%gamestats,%last,%fail) +1) }
- }
- elseif (%c == 1) { writeini -n %gamestats %x %type $calc($readini(%gamestats,%x,%type) +1)
- if (%last) && ($readini($gfile(counter.ini),$1,%last)) { var %fail = $+(fail_,%type) | writeini -n %gamestats %last %fail $calc($readini(%gamestats,%last,%fail) +1) }
- }
- }
- elseif (%c >= 1) && (%c <= 5) { var %fail = $+(fail_,%type) | writeini -n %gamestats %x %fail $calc($readini(%gamestats,%x,%fail) +1) }
- }
- elseif (%teamwon == TERRORIST) {
- var %p = $calc(%ct.p - %ct + %c), %type = $+(1on,%p) | if (%p >= 4) { var %points = %p } | elseif (%p == 3) { var %points = 2 } | else { var %points = 1 }
- writeini -n %gamestats %x %type $calc($readini(%gamestats,%x,%type) +1) | writeini -n %gamestats %x Points $calc($readini(%gamestats,%x,Points) + %points) | rconsend $1 say $gnick(%x) scored a %type clutch!
- }
- else { var %type = $+(1on,$calc(%ct.p - %ct + %c)), %fail = $+(fail_,%type) | writeini -n %gamestats %x %fail $calc($readini(%gamestats,%x,%fail) +1) }
- }
- }
- if (%k >= 5) {
- if ($readini($gfile(counter.ini),$1,%x)) && (%k == $ini($gfile(terrorist.ini),$1,0)) {
- writeini -n %gamestats %x Points $calc($readini(%gamestats,%x,Points) +3) | writeini -n %gamestats %x Aces $calc($readini(%gamestats,%x,Aces) +1) | rconsend $1 say $gnick(%x) made an ACE!!
- }
- elseif ($readini($gfile(terrorist.ini),$1,%x)) && (%k == $ini($gfile(counter.ini),$1,0)) {
- writeini -n %gamestats %x Points $calc($readini(%gamestats,%x,Points) +3) | writeini -n %gamestats %x Aces $calc($readini(%gamestats,%x,Aces) +1) | rconsend $1 say $gnick(%x) made an ACE!!
- }
- }
- }
- inc %i
- }
- remini -n $gfile(kills.ini) $1 | remini -n $gfile(lastkill.ini) $1 | unset %teamwon. [ $+ [ $1 ] ]
- }
- alias missing {
- if (!$2) {
- var %i = 1, %s = 0, %p = $ini($gfile(players.ini),$1,0), %m = $null | while (%i <= %p) {
- var %x = $ini($gfile(players.ini),$1,%i), %tid = $readini($gfile(players.ini),$1,%x)
- if (!$readini($gfile(joined.ini),$1,%x)) {
- if (!%m) { var %m = $gnick(%x) $+ ( $+ $duration($calc(%tid - $ctime)) $+ ) }
- else {
- if (!%s) { rconsend $1 say The following are missing on the server: | inc %s }
- .timer 1 %s rconsend $1 say %m $gnick(%x) $+ ( $+ $duration($calc(%tid - $ctime)) $+ ) | var %m = $null | inc %s
- }
- }
- inc %i
- }
- if (%m) { if (!%s) { rconsend $1 say Players missing on the server: | inc %s } | .timer 1 %s rconsend $1 say %m } | elseif (!%s) { rconsend $1 say There is no players missing }
- }
- else {
- var %i = 1, %s = 0, %p = $ini($gfile(players.ini),$1,0), %m | while (%i <= %p) {
- var %x = $ini($gfile(players.ini),$1,%i), %tid = $readini($gfile(players.ini),$1,%x)
- if (!$readini($gfile(joined.ini),$1,%x)) { var %m = $iif(%m,$+(%m,$chr(44))) $anick(%x) $+ ( $+ $duration($calc(%tid - $ctime)) $+ ) }
- inc %i
- }
- whatcmd $meorsay $2 $logo Players missing on server $+($chr(35),$serverid($1),:) $iif(%m,%m,None) $logo
- }
- }
- alias queryteams {
- var %msgtime = 0 | if ($2 == newteams) { rconsend $1 say LAN Script: New teams upcomming.. | inc %msgtime 2000 }
- if (!$sameteam($score($1,total))) { var %tini = $gfile(counter.ini), %ctini = $gfile(terrorist.ini) } | else { var %tini = $gfile(terrorist.ini), %ctini = $gfile(counter.ini) }
- var %i = 1, %p = $ini(%tini,$1,0), %t | while (%i <= %p) { var %x = $ini(%tini,$1,%i), %t = $iif(%t,$+(%t,$chr(44))) $gnick(%x) | inc %i }
- var %i = 1, %p = $ini(%ctini,$1,0), %ct | while (%i <= %p) { var %x = $ini(%ctini,$1,%i), %ct = $iif(%ct,$+(%ct,$chr(44))) $gnick(%x) | inc %i }
- .timer -m 1 %msgtime rconsend $1 say T: $iif(%t,$ifmatch,0) | .timer -m 1 %msgtime rconsend $1 say CT: $iif(%ct,$ifmatch,0) | inc %msgtime 1000
- if ($2 == newteams) { .timer -m 1 %msgtime rconsend $1 say If u need info, use .send on mIRC. } | else { .timer -m 1 %msgtime tjekteams $1 }
- }
- alias savelastid {
- var %ids = $readini($gfile(gatherstats.ini),$1,lastgame)
- if ($numtok(%ids,44) >= 5) { var %new = $+($gettok(%ids,2-5,44),$chr(44),$2) } | elseif (%ids) { var %new = $+(%ids,$chr(44),$2) } | else { var %new = $2 }
- if ($2 isnum) { writeini -n $gfile(gatherstats.ini) $1 lastgame %new }
- }
- alias saveplayedstats {
- writeini -n $gfile(gatherstats.ini) chan $date(yyyy) $calc($readini($gfile(gatherstats.ini),chan,$date(yyyy)) +1) | writeini -n $gfile(gatherstats.ini) chan $date(mmm) $calc($readini($gfile(gatherstats.ini),chan,$date(mmm)) +1)
- writeini -n $gfile(gatherstats.ini) chan Thisweek $calc($readini($gfile(gatherstats.ini),chan,thisweek) +1) | writeini -n $gfile(gatherstats.ini) chan Today $calc($readini($gfile(gatherstats.ini),chan,today) +1)
- writeini -n $gfile(gatherinfo.ini) maps $1 $calc($readini($gfile(gatherinfo.ini),maps,$1) +1) | writeini -n $gfile(gatherstats.ini) $2 Started $calc($readini($gfile(gatherstats.ini),$2,Started) +1)
- }
- alias stop {
- writeini -n $gfile(gatherservers.ini) $1 status Ended
- if ($sock($+($srcon.prefix, $1))) {
- if ($gatherinfo(gotv)) { rconsend $1 tv_stoprecord }
- if (%gatherstopped. [ $+ [ $1 ] ]) { rconsend $1 say The gather got stopped.. }
- .timer -o 1 1 srcon.clear $1
- }
- .timer -o 1 2 stopnow $1-
- }
- alias stopnow {
- writeini -n $gfile(gatherservers.ini) $1 status Ended
- if (%gatherstopped. [ $+ [ $1 ] ]) { .timer -o 1 5 resetall $1 %gatherstopped. [ $+ [ $1 ] ] | .timer -o 1 6 whatcmd settopic | unset %gatherstopped. [ $+ [ $1 ] ] }
- elseif (!%ignore) { var %cl1 = $readini($gfile(gatherstatus.ini),$1,challenger), %cl2 = $readini($gfile(gatherstatus.ini),$1,challenged)
- var %map = $readini($gfile(gatherstatus.ini),$1,map), %admin = $readini($gfile(gatherstatus.ini),$1,gatheradmin), %type = $readini($gfile(gatherstatus.ini),$1,type), %gid = $calc($readini($gfile(gatherstats.ini),chan,played) +1), %players = $readini($gfile(gatherstatus.ini),$1,slots), %slots = $round($calc(%players /2),0), %adminauth = $gauth(%admin), %gamestats = $gamestatsini($1)
- set -u10 %ignore 1 | logtop $1 | writeini -n $gfile(gatherstats.ini) chan Played %gid | writeini -n $gfile(gatherservers.ini) $1 lastgame %gid
- if ($me ison $mainchan) { whatcmd mute $mainchan | whatcmd $meorsay $mainchan $logo Gather on server $+($chr(35),$serverid($1)) ended, please wait.. $split Almost all commands are blocked for 30 seconds $logo }
- writeini -n $gfile(gatherids.ini) %gid Started $readini($gfile(gatherstatus.ini),$1,start_time) | writeini -n $gfile(gatherids.ini) %gid Ended $date $time | writeini -n $gfile(gatherids.ini) %gid Game %type
- writeini -n $gfile(gatherids.ini) %gid GatherAdmin %admin | writeini -n $gfile(gatherids.ini) %gid Type $+(%slots,on,%slots) | writeini -n $gfile(gatherids.ini) %gid Map %map | writeini -n $gfile(gatherids.ini) %gid Server $1
- var %s = 1 | while ($ini(%gamestats,$1,%s)) { var %n = $ifmatch, %ns = $readini(%gamestats,$1,%n) | writeini -n $gfile(gatherids.ini) %gid %n %ns | if (%n == CT) || (%n == TERRORIST) { logtop $1 $+(%n,:) %ns } | inc %s }
- var %s = 1 | while ($ini($gfile(leavers.ini),$1,%s)) { var %id = $ifmatch, %leavers = $readini($gfile(gatherids.ini),%gid,Leavers) | if (!$istok(%leavers,%id,32)) && (!$readini($gfile(players.ini),$1,%id)) { writeini -n $gfile(gatherids.ini) %gid Leavers %leavers %id } | inc %s }
- remini -n %gamestats $1 | writeini -n $gfile(gatherstatus.ini) $1 gid %gid | logtop $1 GatherAdmin: $gauth(%admin) | logtop $1 GatherID: $+($chr(35),%gid,:) $+(%slots,on,%slots) on %map | savelog $1 $+(gatherid,%gid) | savelog2 $1 $+(gatherid,%gid)
- remini -n $gfile(gatherids.ini) %gid Points | .timer -o 1 1 saveplayedstats %map %admin | .timer -o 1 3 stopnext $1 %gid
- ;;SPECIAL;;
- if (#signfrag.* iswm $mainchan) { set -z %CL. [ $+ [ %cl1 ] ] 600 | set -z %CL. [ $+ [ %cl2 ] ] 600 }
- }
- else { .timer -o 1 5 stopnow $1- }
- }
- alias stopnext {
- set -u10 %ignore 1 | var %gid = $2, %i = 1, %window = @best, %b = 2, %ce = 1, %te = 1, %ct = 0, %t = 0
- while ($ini($gfile(counter.ini),$1,%ce)) { var %x = $ifmatch, %p = $getpoints(%x), %ct = $calc(%ct + %p) | inc %ce }
- while ($ini($gfile(terrorist.ini),$1,%te)) { var %x = $ifmatch, %p = $getpoints(%x), %t = $calc(%t + %p) | inc %te }
- dec %ce | dec %te | var %avg_ct = $calc(%ct / %ce), %avg_t = $calc(%t / %te) | set %ct. [ $+ [ $1 ] ] %avg_ct | set %t. [ $+ [ $1 ] ] %avg_t
- while ($window(%window)) { var %window = $+(@best,%b) | inc %b } | inc %b | var %window2 = $+(@best,%b) | while ($window(%window2)) { inc %b | var %window2 = $+(@best,%b) }
- window -eh1 %window | window -eh1 %window2 | .timer -o 1 2 gamestopstats $1 %gid %window %window2
- }
- alias gamestopstats {
- set -u10 %ignore 1 | var %gamestats = $gamestatsini($1), %gid = $2, %window = $3, %window2 = $4, %ce = $iif(%ct. [ $+ [ $1 ] ],$ifmatch,1000), %te = $iif(%t. [ $+ [ $1 ] ],$ifmatch,1000)
- while ($ini(%gamestats,1)) { var %id = $ifmatch
- if (*STEAM_*:*:* iswm %id) {
- savelastid %id %gid
- if ($gatherinfo(mysql)) { writeini -n mysql.ini update_all %id %id }
- if ($gatherinfo(php.exe)) { writeini -n $gfile($php.ini) steamids %id %id }
- if ($gatherinfo(mysql.exe)) { writeini -n $gfile(upload.ini) steamids %id %id }
- if ($readini($gfile(players.ini),$1,%id)) { writeini -n $gfile(gatherstats.ini) %id played $calc($readini($gfile(gatherstats.ini),%id,played) +1)
- var %entrykills, %kills = 0, %deaths = 0, %assists = 0, %ownkills = 0, %teamkills = 0, %plants = 0, %defs = 0, %wins = 0, %draw = 0, %loss = 0, %match = 0, %aces = 0, %wl = 0, %best = 0, %mypoints = 0, %points = 0, %s = 1
- var %1on1 = 0, %1on2 = 0, %1on3 = 0, %1on4 = 0, %1on5 = 0, %fail_1on1 = 0, %fail_1on2 = 0, %fail_1on3 = 0, %fail_1on4 = 0, %fail_1on5 = 0
- while ($ini(%gamestats,%id,%s)) { var %n = $ifmatch, %ns = $readini(%gamestats,%id,%n) | inc %s
- if ($istok(Kills Teamkills Deaths Assists Plants Defs Aces Wins Loss Draw Entrykills 4K 3K Headshots,%n,32)) { var % [ $+ [ %n ] ] %ns | writeini -n $gfile(gatherstats.ini) %id %n $calc($readini($gfile(gatherstats.ini),%id,%n) + %ns) }
- elseif ($istok(1on1 1on2 1on3 1on4 1on5 fail_1on1 fail_1on2 fail_1on3 fail_1on4 fail_1on5,%n,32)) { var % [ $+ [ %n ] ] %ns | writeini -n $gfile(clutchstats.ini) %id %n $calc($readini($gfile(clutchstats.ini),%id,%n) + %ns) }
- elseif (%n == Points) { var %mypoints = %ns }
- elseif (*1on* !iswm %n) { writeini -n $gfile(wepstats.ini) chan %n $calc($readini($gfile(wepstats.ini),chan,%n) + %ns) | writeini -n $gfile(wepstats.ini) %id %n $calc($readini($gfile(wepstats.ini),%id,%n) + %ns) }
- }
- if (%loss) { var %match = -13, %wl = -5 } | if (%wins) { var %match = 13, %wl = 5 } | var %tp = $iif($readini($gfile(counter.ini),$1,%id),%ce,%te), %pointsnow = $getpoints(%id), %pointsdif = $calc(%tp - %pointsnow)
- if (%pointsdif >= 600) || (%pointsnow < 900) { var %1onx = $calc((%1on2 * 1.5) + (%1on3 * 2) + (%1on4 * 3) + (%1on5 * 3))
- var %best = $calc(%wl + %1onx + (%kills / 2) + (%entrykills / 3) + (%aces * 3) + (%plants / 4) + (%defs / 4) + (%assists / 3) - (%deaths / 2.5)), %points = $calc(%match + %best)
- }
- else { var %1onx = $calc(%1on2 + (%1on3 * 1.5) + (%1on4 * 2.5) + (%1on5 * 2.5))
- var %best = $calc(%wl + %1onx + (%kills / 2.5) + (%entrykills / 4) + (%aces * 3) + (%plants / 4) + (%defs / 4) + (%assists / 3) - (%deaths / 2.5)), %points = $calc(%match + %best)
- }
- var %kd = $calc(%kills / %deaths), %1onx = 1on1: $+ %1on1 $+ / $+ $calc(%fail_1on1 + %1on1) 1on2: $+ %1on2 $+ / $+ $calc(%fail_1on2 + %1on2) 1on3: $+ %1on3 $+ / $+ $calc(%fail_1on3 + %1on3) 1on4: $+ %1on4 $+ / $+ $calc(%fail_1on4 + %1on4) 1on5: $+ %1on5 $+ / $+ $calc(%fail_1on5 + %1on5)
- aline %window %id $ex_nr(%best) | aline %window2 %id $ex_nr(%kd) | writeini -n $gfile(gatherids.ini) %gid %id Kills: $+ %kills Deaths: $+ %deaths Assists: $+ %assists Points: $+ %points %1onx
- givepoints %id %points
- }
- else {
- var %leavers = $iif($readini($gfile(gatherids.ini),%gid,Leavers),$ifmatch,$null) | if (!$istok(%leavers,%id,32)) { writeini -n $gfile(gatherids.ini) %gid Leavers %leavers %id }
- }
- }
- remini -n %gamestats %id
- }
- .timer -o 1 2 stoprest $1 %gid %window %window2
- }
- alias stoprest {
- set -u10 %ignore 1 | var %gamestats = $gamestatsini($1), %gid = $2, %window = $3, %window2 = $4
- if ($gatherinfo(mysql)) { writeini -n mysql.ini update_gather %gid %gid }
- filter -twce 2 32 %window %window | var %motm = $gettok($line(%window,1),1,32), %notm = $findnotm(%window) | window -c %window
- filter -twce 2 32 %window2 %window2 | var %kd = $gettok($line(%window2,1),1,32) | window -c %window2
- if (%motm) { writeini -n $gfile(gatherstats.ini) %motm motm $calc($readini($gfile(gatherstats.ini),%motm,motm) +1) | writeini -n $gfile(gatherids.ini) %gid motm %motm }
- if (%kd) { writeini -n $gfile(gatherstats.ini) %kd bestkds $calc($readini($gfile(gatherstats.ini),%kd,bestkds) +1) | writeini -n $gfile(gatherids.ini) %gid bestkd %kd }
- if (%notm) && (%notm != %motm) { writeini -n $gfile(gatherstats.ini) %notm notm $calc($readini($gfile(gatherstats.ini),%notm,notm) +1) | writeini -n $gfile(gatherids.ini) %gid notm %notm }
- .timer -o 1 2 gatherdone $1
- var %leavers = $readini($gfile(gatherids.ini),%gid,Leavers), %i = 1 | while ($gettok(%leavers,%i,32)) { var %id = $ifmatch
- if ($gatherinfo(leavebans)) { givepoints %id -39 }
- if ($gatherinfo(php.exe)) { writeini -n $gfile($php.ini) steamids %id %id }
- if ($gatherinfo(mysql.exe)) { writeini -n $gfile(upload.ini) steamids %id %id }
- inc %i
- }
- }
- alias gatherdone {
- var %gamestats = $gamestatsini($1)
- if ($ini(%gamestats,1)) {
- if ($readini($gfile(gatherstatus.ini),$1,gid)) { var %ifmatch = $ifmatch | stopnext $1 %ifmatch } | else { stop $1 }
- }
- else {
- var %gid = $readini($gfile(gatherstatus.ini),$1,gid)
- if ($readini($gfile(gatherstatus.ini),info,ip) == $1) { remini -n $gfile(gatherstatus.ini) info }
- if ($readini($gfile(gatherservers.ini),$1,status)) { remini -n $gfile(gatherservers.ini) $1 status }
- if ($ini($gfile(gatherstatus.ini),$1)) { remini -n $gfile(gatherstatus.ini) $1 }
- .timer [ $+ [ $+(*,$1,*) ] ] off | unset % [ $+ [ $+(*,$1,*) ] ] | if (%gid) { .timer -o 1 1 gatherend $1 %gid }
- }
- }
- alias resultgame {
- if (!$istok(CT TERRORIST,$2,32)) { return }
- writeini -n $gfile(gatherservers.ini) $1 status Ended
- if (!%ignore) {
- var %map = $readini($gfile(gatherstatus.ini),$1,map), %admin = $readini($gfile(gatherstatus.ini),$1,gatheradmin), %type = $readini($gfile(gatherstatus.ini),$1,type), %gid = $calc($readini($gfile(gatherstats.ini),chan,played) +1), %players = $readini($gfile(gatherstatus.ini),$1,slots), %slots = $round($calc(%players /2),0), %adminauth = $gauth(%admin), %gamestats = $gamestatsini($1), %teamwon = $iif($2 == Draw,$upleft($2),$upper($2))
- set -u10 %ignore 1
- logtop $1
- writeini -n $gfile(gatherstats.ini) chan Played %gid
- writeini -n $gfile(gatherservers.ini) $1 lastgame %gid
- if ($me ison $mainchan) {
- whatcmd mute $mainchan
- whatcmd $meorsay $mainchan $logo Gather on server $+($chr(35),$serverid($1)) ended, please wait.. $split Almost all commands are blocked for a few seconds $logo
- }
- writeini -n $gfile(gatherids.ini) %gid Started $readini($gfile(gatherstatus.ini),$1,start_time)
- writeini -n $gfile(gatherids.ini) %gid Ended $date $time
- writeini -n $gfile(gatherids.ini) %gid Game %type
- writeini -n $gfile(gatherids.ini) %gid GatherAdmin %admin
- writeini -n $gfile(gatherids.ini) %gid Type $+(%slots,on,%slots)
- writeini -n $gfile(gatherids.ini) %gid Map %map
- writeini -n $gfile(gatherids.ini) %gid Server $1
- var %i = 1, %team.ct, %team.ct.sid | while ($ini($gfile(counter.ini),$1,%i)) { var %s = $ifmatch, %team.ct = %team.ct $gauth(%s), %team.ct.sid = %team.ct.sid %s | inc %i }
- var %i = 1, %team.t, %team.t.sid | while ($ini($gfile(terrorist.ini),$1,%i)) { var %s = $ifmatch, %team.t = %team.t $gauth(%s), %team.t.sid = %team.t.sid %s | inc %i }
- writeini -n $gfile(gatherids.ini) %gid CT $iif(%team.ct.sid,$ifmatch,0)
- writeini -n $gfile(gatherids.ini) %gid TERRORIST $iif(%team.t.sid,$ifmatch,0)
- logtop $1 CT: %team.ct | logtop $1 TERRORIST: %team.t
- writeini -n $gfile(gatherids.ini) %gid TeamWon %teamwon
- remini -n %gamestats $1
- writeini -n $gfile(gatherstatus.ini) $1 gid %gid
- logtop $1 GatherAdmin: $gauth(%admin)
- logtop $1 GatherID: $+($chr(35),%gid,:) $+(%slots,on,%slots) on %map
- savelog $1 $+(gatherid,%gid)
- .timer -o 1 1 saveplayedstats %map %admin | .timer -o 1 2 resultnext $1 %gid %teamwon
- ;;SPECIAL;;
- if (#signfrag.* iswm $mainchan) && (%type == Challenge) {
- var %cl1 = $readini($gfile(gatherstatus.ini),$1,challenger), %cl2 = $readini($gfile(gatherstatus.ini),$1,challenged)
- set -z %CL. [ $+ [ %cl1 ] ] 600 | set -z %CL. [ $+ [ %cl2 ] ] 600
- }
- }
- else { .timer -o 1 5 resultgame $1- }
- }
- alias resultnext {
- set -u10 %ignore 1 | var %gid = $2, %teamwon = $3, %i = 1, %ce = 1, %te = 1, %ct = 0, %t = 0, %won = 20, %lost = -20
- while ($ini($gfile(counter.ini),$1,%ce)) { var %x = $ifmatch, %p = $getpoints(%x), %ct = $calc(%ct + %p) | inc %ce } | dec %ce
- while ($ini($gfile(terrorist.ini),$1,%te)) { var %x = $ifmatch, %p = $getpoints(%x), %t = $calc(%t + %p) | inc %te } | dec %te
- var %avg_ct = $round($calc(%ct / %ce),0), %avg_t = $round($calc(%t / %te),0), %total = $calc(%avg_ct + %avg_t), %ct_pct = $round($calc(100 / %total * %avg_ct),0), %t_pct = $round($calc(100 / %total * %avg_t),0)
- if (%ct_pct > %t_pct) {
- var %dif = $calc(%ct_pct - %t_pct)
- if (%teamwon == CT) {
- var %d = 0.3 | while (%dif) && (%d < 2) { dec %won %d | inc %lost $calc(%d - $iif(%d > 1,0.3,0.2)) | inc %d $iif(%d > 1,0.1,0.3) | dec %dif }
- }
- else {
- var %d = 0.2 | while (%dif) && (%d < 2) { inc %won %d | dec %lost $calc(%d - $iif(%d > 1,0.3,0.2)) | inc %d 0.3 | dec %dif }
- }
- }
- elseif (%t_pct > %ct_pct) {
- var %dif = $calc(%t_pct - %ct_pct)
- if (%teamwon == TERRORIST) {
- var %d = 0.3 | while (%dif) && (%d < 2) { dec %won %d | inc %lost $calc(%d - $iif(%d > 1,0.3,0.2)) | inc %d $iif(%d > 1,0.1,0.3) | dec %dif }
- }
- else {
- var %d = 0.2 | while (%dif) && (%d < 2) { inc %won %d | dec %lost $calc(%d - $iif(%d > 1,0.3,0.2)) | inc %d 0.3 | dec %dif }
- }
- }
- var %i = 1, %points = $iif(%teamwon == CT,%won,%lost), %winloss = $iif(%teamwon == CT,Wins,Loss) | while ($ini($gfile(counter.ini),$1,%i)) {
- var %id = $ifmatch | savelastid %id %gid
- writeini -n $gfile(gatherstats.ini) %id played $calc($readini($gfile(gatherstats.ini),%id,played) +1)
- writeini -n $gfile(gatherstats.ini) %id %winloss $calc($readini($gfile(gatherstats.ini),%id,%winloss) +1)
- writeini -n $gfile(gatherids.ini) %gid %id Kills:0 Deaths:0 Assists:0 $+(Points:,%points) 1on1:0/0 1on2:0/0 1on3:0/0 1on4:0/0 1on5:0/0
- givepoints %id %points
- if ($gatherinfo(php.exe)) { writeini -n $gfile($php.ini) steamids %id %id }
- if ($gatherinfo(mysql.exe)) { writeini -n $gfile(upload.ini) steamids %id %id }
- inc %i
- }
- var %i = 1, %points = $iif(%teamwon == TERRORIST,%won,%lost), %winloss = $iif(%teamwon == TERRORIST,Wins,Loss) | while ($ini($gfile(terrorist.ini),$1,%i)) {
- var %id = $ifmatch | savelastid %id %gid
- writeini -n $gfile(gatherstats.ini) %id played $calc($readini($gfile(gatherstats.ini),%id,played) +1)
- writeini -n $gfile(gatherstats.ini) %id %winloss $calc($readini($gfile(gatherstats.ini),%id,%winloss) +1)
- writeini -n $gfile(gatherids.ini) %gid %id Kills:0 Deaths:0 Assists:0 $+(Points:,%points) 1on1:0/0 1on2:0/0 1on3:0/0 1on4:0/0 1on5:0/0
- givepoints %id %points
- if ($gatherinfo(php.exe)) { writeini -n $gfile($php.ini) steamids %id %id }
- if ($gatherinfo(mysql.exe)) { writeini -n $gfile(upload.ini) steamids %id %id }
- inc %i
- }
- if ($readini($gfile(gatherstatus.ini),info,ip) == $1) { remini -n $gfile(gatherstatus.ini) info }
- if ($readini($gfile(gatherservers.ini),$1,status)) { remini -n $gfile(gatherservers.ini) $1 status }
- if ($ini($gfile(gatherstatus.ini),$1)) { remini -n $gfile(gatherstatus.ini) $1 }
- .timer [ $+ [ $+(*,$1,*) ] ] off | unset % [ $+ [ $+(*,$1,*) ] ] | .timer -o 1 1 gatherend $1 %gid
- }
- alias gatherend {
- var %gid = $2, %motm = $readini($gfile(gatherids.ini),%gid,motm), %kd = $readini($gfile(gatherids.ini),%gid,bestkd), %notm = $readini($gfile(gatherids.ini),%gid,notm)
- var %ct_p = $readini($gfile(gatherids.ini),%gid,CT), %t_p = $readini($gfile(gatherids.ini),%gid,TERRORIST), %leavers = $iif($readini($gfile(gatherids.ini),%gid,Leavers),$ifmatch,0)
- var %teamwon = $readini($gfile(gatherids.ini),%gid,TeamWon), %score = $readini($gfile(gatherids.ini),%gid,Score)
- if (%ct_p) && (%t_p) {
- var %ct_pl, %i = 1 | while ($gettok(%ct_p,%i,32)) { var %s = $ifmatch, %p = $iif($gettok($gettok($readini($gfile(gatherids.ini),%gid,%s),4,32),2,58),$ifmatch,0), %p = $round(%p,2), %points = $iif(%p >= 0,$col(09,$+(+,%p)),$col(04,%p)), %ct_pl = $iif(%ct_pl,$+(%ct_pl,$chr(44))) $+($colnick(%s),$col(14,$chr(91)),%points,$col(14,$chr(93))) | inc %i }
- var %t_pl, %i = 1 | while ($gettok(%t_p,%i,32)) { var %s = $ifmatch, %p = $iif($gettok($gettok($readini($gfile(gatherids.ini),%gid,%s),4,32),2,58),$ifmatch,0), %p = $round(%p,2), %points = $iif(%p >= 0,$col(09,$+(+,%p)),$col(04,%p)), %t_pl = $iif(%t_pl,$+(%t_pl,$chr(44))) $+($colnick(%s),$col(14,$chr(91)),%points,$col(14,$chr(93))) | inc %i }
- }
- var %leavers_pl, %i = 1 | while ($gettok(%leavers,%i,32)) { var %s = $ifmatch, %leavers_pl = $iif(%leavers_pl,$+(%leavers_pl,$chr(44))) $+($colnick(%s),$iif($gatherinfo(leavebans),$+($col(14,$chr(91)),$col(04,-39),$col(14,$chr(93))))) | inc %i }
- if ($gatherinfo(php.exe)) && (%gid) { writeini -n $gfile($php.ini) gathers %gid %gid | .timerphp.exe -o 1 0 run $+(",$php.exe,") -f $+(",$mircdir,$gfile($php.file),") }
- if ($gatherinfo(mysql.exe)) && (%gid) { writeini -n $gfile(upload.ini) gather gatherid %gid | .timer -o 1 0 run -p $+(",$mircdir,$gdir,MySQL.exe,") }
- whatcmd $meorsay $mainchan $logo Gather on server $+($chr(35),$serverid($1)) ended (ID: %gid $+ ) $split $iif(%teamwon == Draw,Match ended $col(08,Draw),$iif(%teamwon == CT,Team $col(11,CT) won %score,Team $col(04,Terrorist) won %score)) $iif(%motm,$logo Man of the Match: $col(07,$anick(%motm))) $iif(%kd,$logo Best K/D: $col(07,$anick(%kd))) $iif(%notm,$logo Newb of the Match: $col(04,$anick(%notm))) $logo
- if (%ct_pl) && (%t_pl) { whatcmd $meorsay $mainchan $logo $+($col(11,CT),:) %ct_pl $logo $+($col(04,T),:) %t_pl $logo $iif(%leavers_pl,$col(04,Leavers:) %leavers_pl $logo) }
- if ($vtset($1)) { .timer -o 1 1 delete.vt $1 } | whatcmd unsetvar ignore | .timer -o 1 5 updaterank | whatcmd resetall $1 | whatcmd settopic
- if ($gatherstatus(start)) && ($checkrematch) { var %id = $ifmatch | whatcmd rematch %id } | else { whatcmd unmute $mainchan }
- playedup
- }
- alias gatherend_OLD {
- var %gid = $2, %motm = $readini($gfile(gatherids.ini),%gid,motm), %kd = $readini($gfile(gatherids.ini),%gid,bestkd), %notm = $readini($gfile(gatherids.ini),%gid,notm)
- var %ct_p = $readini($gfile(gatherids.ini),%gid,CT), %t_p = $readini($gfile(gatherids.ini),%gid,TERRORIST), %leavers = $iif($readini($gfile(gatherids.ini),%gid,Leavers),$ifmatch,0)
- var %teamwon = $readini($gfile(gatherids.ini),%gid,TeamWon), %score = $readini($gfile(gatherids.ini),%gid,Score)
- if (%ct_p) && (%t_p) {
- var %ct_pl, %i = 1 | while ($gettok(%ct_p,%i,32)) { var %a = $ifmatch, %s = $gsteamid($+($chr(35),%a)), %p = $iif($gettok($gettok($readini($gfile(gatherids.ini),%gid,%s),4,32),2,58),$ifmatch,0), %p = $round(%p,2), %points = $iif(%p >= 0,$col(09,$+(+,%p)),$col(04,%p)), %ct_pl = $iif(%ct_pl,$+(%ct_pl,$chr(44))) $+($colnick(%s),$col(14,$chr(91)),%points,$col(14,$chr(93))) | inc %i }
- var %t_pl, %i = 1 | while ($gettok(%t_p,%i,32)) { var %a = $ifmatch, %s = $gsteamid($+($chr(35),%a)), %p = $iif($gettok($gettok($readini($gfile(gatherids.ini),%gid,%s),4,32),2,58),$ifmatch,0), %p = $round(%p,2), %points = $iif(%p >= 0,$col(09,$+(+,%p)),$col(04,%p)), %t_pl = $iif(%t_pl,$+(%t_pl,$chr(44))) $+($colnick(%s),$col(14,$chr(91)),%points,$col(14,$chr(93))) | inc %i }
- }
- var %leavers_pl, %i = 1 | while ($gettok(%leavers,%i,32)) { var %s = $ifmatch, %leavers_pl = $iif(%leavers_pl,$+(%leavers_pl,$chr(44))) $+($colnick(%s),$iif($gatherinfo(leavebans),$+($col(14,$chr(91)),$col(04,-39),$col(14,$chr(93))))) | inc %i }
- if ($gatherinfo(php.exe)) && (%gid) { writeini -n $gfile($php.ini) gathers %gid %gid | .timerphp.exe -o 1 0 run $+(",$php.exe,") -f $+(",$mircdir,$gfile($php.file),") }
- if ($gatherinfo(mysql.exe)) && (%gid) { writeini -n $gfile(upload.ini) gather gatherid %gid | .timer -o 1 0 run -p $+(",$mircdir,$gdir,MySQL.exe,") }
- whatcmd $meorsay $mainchan $logo Gather on server $+($chr(35),$serverid($1)) ended (ID: %gid $+ ) $split $iif(%teamwon == Draw,Match ended $col(08,Draw),$iif(%teamwon == CT,Team $col(11,CT) won %score,Team $col(04,Terrorist) won %score)) $iif(%motm,$logo Man of the Match: $col(07,$anick(%motm))) $iif(%kd,$logo Best K/D: $col(07,$anick(%kd))) $iif(%notm,$logo Newb of the Match: $col(04,$anick(%notm))) $logo
- if (%ct_pl) && (%t_pl) { whatcmd $meorsay $mainchan $logo $+($col(11,CT),:) %ct_pl $logo $+($col(04,T),:) %t_pl $logo $iif(%leavers_pl,$col(04,Leavers:) %leavers_pl $logo) }
- if ($vtset($1)) { .timer -o 1 1 delete.vt $1 } | whatcmd unsetvar ignore | .timer -o 1 5 updaterank
- if ($gatherstatus(start)) && ($checkrematch) { var %id = $ifmatch | whatcmd rematch %id } | else { whatcmd unmute $mainchan }
- }
- alias unsetvar { if (% [ $+ [ $1 ] ]) { unset % [ $+ [ $1 ] ] } }
- alias findnotm { var %i = 1, %notm | while (%i <= $line($1,0)) { var %x = $line($1,%i), %id = $gettok(%x,1,32), %p = $gettok(%x,2,32) | if (%p < %l) || (!%notm) { var %notm = %id, %l = %p } | inc %i } | return %notm }
- alias skillhist {
- var %p = $remove($1-,+), %i = 1, %points | while (%i <= $numtok(%p,32)) { var %x = $round($gettok(%p,%i,32),1), %n = $+($iif(%x < 0,04,10+),%x), %points = %points %n | inc %i }
- return %points
- }
- alias givepoints {
- if ($readini($gfile(gatherstats.ini),$1,points)) { var %points = $ifmatch } | else { var %points = 1000 }
- var %lastpoints = $gatherstats($1,Lastpoints), %lastpoints = $iif($numtok(%lastpoints,32) > 39,$gettok(%lastpoints,2-,32),$iif(%lastpoints,$ifmatch)) $2
- writeini -n $gfile(gatherstats.ini) $1 Points $calc(%points + $2) | writeini -n $gfile(gatherstats.ini) $1 Lastpoint $2 | writeini -n $gfile(gatherstats.ini) $1 Lastpoints %lastpoints
- }
- alias score {
- if ($2 == total) { return $calc($iif($readini($gfile(score.ini),$1,antiterrorist),$ifmatch,0) + $iif($readini($gfile(score.ini),$1,terrorist),$ifmatch,0)) }
- elseif ($2 == ct) { return $iif($readini($gfile(score.ini),$1,antiterrorist),$ifmatch,0) }
- elseif ($2 == t) { return $iif($readini($gfile(score.ini),$1,terrorist),$ifmatch,0) }
- elseif ($2 == reset) {
- if ($readini($gfile(score.ini),$1,saved_ct)) || ($readini($gfile(score.ini),$1,saved_t)) {
- var %t = $iif($readini($gfile(score.ini),$1,saved_t),$ifmatch,0), %ct = $iif($readini($gfile(score.ini),$1,saved_ct),$ifmatch,0)
- writeini -n $gfile(score.ini) $1 terrorist %t | writeini -n $gfile(score.ini) $1 antiterrorist %ct
- }
- elseif ($ini($gfile(score.ini),$1)) { remini -n $gfile(score.ini) $1 }
- }
- elseif ($2 == switch) {
- var %ct = $iif($readini($gfile(score.ini),$1,antiterrorist),$ifmatch,0), %t = $iif($readini($gfile(score.ini),$1,terrorist),$ifmatch,0)
- writeini -n $gfile(score.ini) $1 terrorist %ct | writeini -n $gfile(score.ini) $1 antiterrorist %t | writeini -n $gfile(score.ini) $1 saved_t %ct | writeini -n $gfile(score.ini) $1 saved_ct %t
- }
- elseif ($2 == save) {
- var %ct = $iif($readini($gfile(score.ini),$1,antiterrorist),$ifmatch,0), %t = $iif($readini($gfile(score.ini),$1,terrorist),$ifmatch,0) | writeini -n $gfile(score.ini) $1 saved_t %t | writeini -n $gfile(score.ini) $1 saved_ct %ct
- }
- elseif ($2 == inc) {
- if ($3 == ct) { writeini -n $gfile(score.ini) $1 antiterrorist $calc($readini($gfile(score.ini),$1,antiterrorist) +1) } | elseif ($3 == t) { writeini -n $gfile(score.ini) $1 terrorist $calc($readini($gfile(score.ini),$1,terrorist) +1) }
- var %ct = $iif($readini($gfile(score.ini),$1,antiterrorist),$ifmatch,0), %t = $iif($readini($gfile(score.ini),$1,terrorist),$ifmatch,0), %score = $calc(%ct + %t)
- if (%score < 30) && (%ct != 16) && (%t != 16) && (%score != 15) && ((%score == 5) || (%score == 10) || (%score == 20) || (%score == 25) || (%ct == 15) || (%t == 15)) { .timerscore 1 1 rconsend $1 say [Reminder $+ $chr(93) CounterTerrorist: %ct - Terrorist: %t }
- }
- }
- alias myip { if ($sock(myip)) { sockclose myip } | sockopen myip checkip.dyndns.org 80 }
- on *:sockopen:myip:{
- sockwrite -n $sockname GET /index.php HTTP/1.0
- sockwrite -n $sockname Host: checkip.dyndns.org
- sockwrite -n $sockname user-agent: Mozilla/??
- sockwrite -n $sockname Connection: Keep-Alive
- sockwrite -n $sockname $crlf
- }
- on *:sockread:myip:{
- if ($sockerr > 0) return | :nextread | var %temp | sockread %temp | if ($sockbr == 0) return
- if (*Current IP Address* iswm %temp) { var %z = $remove(%temp,<html><head><title>Current IP Check</title></head><body>Current IP Address:,</body></html>) | .localinfo $strip(%z %z) }
- goto nextread
- }
- raw 473:*:{
- ; $1 = $me ; $2 = $chan ; $3 = unable to join channel (invite only)
- haltdef | echo -as $+($chr(91),$time,$chr(93)) Raw 473: $1-
- if ($me ison $2) && (!%tmp.raw473) { set -z %tmp.raw473 30 | .timerqinvite 1 1 whatcmd msg $Qbot invite }
- }
- raw 477:*:{
- ; $1 = $me ; $2 = $chan ; $3 = Cannot join channel (+r):
- haltdef | echo -as $+($chr(91),$time,$chr(93)) Raw 477: $1-
- if ($me ison $2) && (!%tmp.raw477) { set -z %tmp.raw477 30 | .timerauth 1 1 authme }
- }
- raw 442:*:{
- ; $1 = $me ; $2 = $chan ; $3 = You're not on that channel
- haltdef | echo -as $+($chr(91),$time,$chr(93)) Raw 442: $1-
- if ($me ison $2) && (!%tmp.raw442) { set -z %tmp.raw442 30 | part $2 | .timerraw 1 1 raw join $2 | .timerqinvite 1 2 whatcmd msg $Qbot invite | .timer 1 3 gatherchans }
- }
- raw 404:*:{
- ; $1 = $me ; $2 = $chan ; $3 = Cannot send to channel
- haltdef | echo -as $+($chr(91),$time,$chr(93)) Raw 404: $1-
- if ($me ison $2) && (!%tmp.raw404) { set -z %tmp.raw404 30 | part $2 | .timerraw 1 1 raw join $2 | .timerqinvite 1 2 whatcmd msg $Qbot invite | .timer 1 3 gatherchans }
- }
- raw 417:*:{ haltdef | echo -as $+($chr(91),$time,$chr(93)) Raw 417: Input line was too long }
- raw 315:*:{ haltdef }
- raw 354:*:{ haltdef | reguser $2 $3 }
- raw 352:*:{ haltdef | reguser $6 $6 $8 }
- alias reguser {
- if ($network == GRNet) {
- if ($3 != 0) {
- if (($1 ison $mainchan) || ($1 ison $privchan) || ($1 ison $ownerchan)) && ($1 != $Qbot) && ($1 != S) && ($1 != $me) { var %sid = $gsteamid($+($chr(35),$2))
- if ($read($gfile(authed.dat),s,$1)) { write -ds $+ $1 $gfile(authed.dat) }
- if ($read($gfile(authed.dat),w,* $2 *)) { write -ds $+ $gettok($ifmatch,1,32) $gfile(authed.dat) }
- if (%sid != 0) && ($read($gfile(authed.dat),w,* %sid)) { write -ds $+ $gettok($ifmatch,1,32) $gfile(authed.dat) } | write $gfile(authed.dat) $1 $2 %sid
- if ($istok($headadmins,$2,32)) { return }
- return
- if ($admin($+($chr(35),$2)) >= 8) && ($1 !ison $privchan) && ($me isop $privchan) { ;invitebot $1 $privchan }
- if ($admin($+($chr(35),$2)) >= 10) && ($1 !isop $mainchan) && ($me isop $mainchan) { $iif($script(pushmode.mrc),pushmode -l,putmode) $mainchan +o $1 }
- elseif ($admin($+($chr(35),$2)) >= 8) && ($1 isreg $mainchan) && ($me isop $mainchan) { $iif($script(pushmode.mrc),pushmode -l,putmode) $mainchan +v $1 }
- }
- }
- return
- }
- if ($network == Aitvaras) {
- if (r isincs $3) {
- if (($1 ison $mainchan) || ($1 ison $privchan) || ($1 ison $ownerchan)) && ($1 != $Qbot) && ($1 != S) && ($1 != $me) { var %sid = $gsteamid($+($chr(35),$2))
- if ($read($gfile(authed.dat),s,$1)) { write -ds $+ $1 $gfile(authed.dat) }
- if ($read($gfile(authed.dat),w,* $2 *)) { write -ds $+ $gettok($ifmatch,1,32) $gfile(authed.dat) }
- if (%sid != 0) && ($read($gfile(authed.dat),w,* %sid)) { write -ds $+ $gettok($ifmatch,1,32) $gfile(authed.dat) } | write $gfile(authed.dat) $1 $2 %sid
- if ($istok($headadmins,$2,32)) { return }
- return
- if ($admin($+($chr(35),$2)) >= 8) && ($1 !ison $privchan) && ($me isop $privchan) { ;invitebot $1 $privchan }
- if ($admin($+($chr(35),$2)) >= 10) && ($1 !isop $mainchan) && ($me isop $mainchan) { $iif($script(pushmode.mrc),pushmode -l,putmode) $mainchan +o $1 }
- elseif ($admin($+($chr(35),$2)) >= 8) && ($1 isreg $mainchan) && ($me isop $mainchan) { $iif($script(pushmode.mrc),pushmode -l,putmode) $mainchan +v $1 }
- }
- }
- return
- }
- if ($2 != 0) {
- if (($1 ison $mainchan) || ($1 ison $privchan) || ($1 ison $ownerchan)) && ($1 != $Qbot) && ($1 != S) && ($1 != $me) { var %sid = $gsteamid($+($chr(35),$2))
- if ($read($gfile(authed.dat),s,$1)) { write -ds $+ $1 $gfile(authed.dat) }
- if ($read($gfile(authed.dat),w,* $2 *)) { write -ds $+ $gettok($ifmatch,1,32) $gfile(authed.dat) }
- if (%sid != 0) && ($read($gfile(authed.dat),w,* %sid)) { write -ds $+ $gettok($ifmatch,1,32) $gfile(authed.dat) } | write $gfile(authed.dat) $1 $2 %sid
- if ($istok($headadmins,$2,32)) { return }
- if ($admin($+($chr(35),$2)) >= 8) && ($1 !ison $privchan) && ($me isop $privchan) { ;invitebot $1 $privchan }
- if ($admin($+($chr(35),$2)) >= 10) && ($1 !isop $mainchan) && ($me isop $mainchan) { $iif($script(pushmode.mrc),pushmode -l,putmode) $mainchan +o $1 }
- elseif ($admin($+($chr(35),$2)) >= 8) && ($1 isreg $mainchan) && ($me isop $mainchan) { $iif($script(pushmode.mrc),pushmode -l,putmode) $mainchan +v $1 }
- elseif (#cisgl.gotime2 == $mainchan) && ($1 isreg $mainchan) && ($me isop $mainchan) && ($read("D:\Gather\mIRC (CISGL.GOtime)\gatherbot\gatherusers.dat",s,$2)) {
- ;;SPECIAL;;
- var %sid = $ifmatch
- if (STEAM_T:E:MP* !iswm %sid) { $iif($script(pushmode.mrc),pushmode -l,putmode) $mainchan +v $1 }
- }
- }
- }
- }
- alias invitebot {
- if ($me isop $2) && ($1 !ison $2) { whatcmd invite $1 $2 }
- }
- alias whatcmd { g.list $1- }
- alias g.list {
- var %w = @glist, %t = glist, %txt = 0, %map = 0
- if (!$window(%w)) { window -ezk0 %w } | if ($1 != $null) { aline %w $1- }
- if ((!$timer(%t)) || ($ctimer == %t)) && ($line(%w,1)) { tokenize 32 $ifmatch | var %s = $line(%w,0) | dline %w 1
- if ($istok(describe msg notice cnotice cprivmsg,$remove($1,$chr(46)),32)) { var %txt = 1
- if ($2 == $mainchan) { var %tt = $iif($me isop $mainchan,<@,$iif($me isreg $mainchan,<,<+)) | logchan $+(%tt,$me,>) $3- }
- }
- if (!$istok(describe msg notice mode chanmode cnotice cprivmsg aoe claoe unmute,$remove($1,$chr(46)),32)) { .timer $+ %t -m 1 500 g.list | inc -z %glist 1 }
- elseif (#signfrag.* iswm $mainchan) {
- var %n = $iif(%glist > 12,4,$iif(%glist,$iif(%glist <= 5,1,3.5),0)) | .timer $+ %t 1 %n g.list | inc -z %glist $iif(%glist > 12,6,5)
- }
- else { var %n = $iif(%glist > 12,3.5,$iif(%glist,$iif(%glist <= 5,$iif(%s > 1,1,0.5),3),0)) | .timer $+ %t 1 %n g.list | inc -z %glist $iif(%glist > 12,6,5) }
- if (%txt) && ($len($3-) > 430) {
- var %txt = $3-, %i = 10, %a = $gettok(%txt,1 - %i,32), %b, %c
- if (* Map:* Players:* iswm %txt) { var %map = $gettok(%txt,2-5,32) }
- if ($len($3-) > 825) {
- while ($len(%a) < 390) { inc %i | var %a = $gettok(%txt,1 - %i,32) } | inc %i | var %z = $calc(%i +10), %b = $gettok(%txt,%i - %z,32)
- while ($len(%b) < 375) { inc %z | var %b = $gettok(%txt,%i - %z,32) } | inc %z | var %c = $gettok(%txt,%z -,32)
- g.list.exe $1 $2 %a $iif(%b,....)
- if (%b) { g.list.exe $1 $2 $iif($gettok(%b,1,32) != $logo,$logo) %b $iif($numtok(%c,32) > 1,....,%c) }
- if ($numtok(%c,32) > 1) { g.list.exe $1 $2 $iif($gettok(%c,1,32) != $logo,$logo) %c }
- }
- else {
- while ($len(%a) < 390) { inc %i | var %a = $gettok(%txt,1 - %i,32) } | inc %i | var %b = $iif(%map,$ifmatch) $gettok(%txt,%i -,32)
- g.list.exe $1 $2 %a $iif($numtok(%b,32) > 1,....,%b)
- if ($numtok(%b,32) > 1) { g.list.exe $1 $2 $iif($gettok(%b,1,32) != $logo,$logo) %b }
- }
- }
- else { g.list.exe $1 $2- }
- }
- }
- alias g.list.exe {
- if ($mainchan == #OBS) { [ $1 ] $strip($2-) | return }
- [ $1 ] $2-
- }
- alias vtset { if ($readini($gfile(gatherservers.ini),$1,vt_ip)) && ($readini($gfile(gatherservers.ini),$1,vt_rcon)) && ($readini($gfile(gatherservers.ini),$1,vt_rcon) != n/a) && ($readini($gfile(gatherservers.ini),$1,voice) == Ventrilo) { return $true } | return $false }
- alias vr { return " $+ $mircdir $+ ventrcon\ventrcon.exe" }
- alias create.vt {
- if ($vtset($1)) {
- var %ct_pw = $+($rand(a,z),$rand(1,9)), %t_pw = $+($rand(a,z),$rand(1,9)) | writeini -n $gfile(gatherservers.ini) $1 vt_ct %ct_pw | writeini -n $gfile(gatherservers.ini) $1 vt_t %t_pw
- var %pw = $readini($gfile(gatherservers.ini),$1,cs_pw), %vt_ip = $readini($gfile(gatherservers.ini),$1,vt_ip), %vt_rcon = $readini($gfile(gatherservers.ini),$1,vt_rcon), %vt_pass = $readini($gfile(gatherservers.ini),$1,vt_pw), %id = $serverid($1), %game = $gatherinfo(game), %room = " $+ %game Gather $+($chr(35),%id,")
- write -c cmds.txt /chan delete %room | write cmds.txt /chan create %room %id "" %id $+("connect $1,;password %pw,")
- write cmds.txt /subchan %room "Counter-Terrorist" 2 %ct_pw | write cmds.txt /subchan %room "Terrorist" 3 %t_pw
- run $VR -w $iif(%vt_pass,$ifmatch,fp) -a %vt_rcon -t 1 -f cmds.txt %vt_ip
- }
- }
- alias delete.vt {
- if ($vtset($1)) {
- var %vt_ip = $readini($gfile(gatherservers.ini),$1,vt_ip), %vt_rcon = $readini($gfile(gatherservers.ini),$1,vt_rcon), %vt_pass = $readini($gfile(gatherservers.ini),$1,vt_pw), %id = $serverid($1), %game = $gatherinfo(game), %room = " $+ %game Gather $+($chr(35),%id,")
- write -c cmds.txt /chan delete %room | run $VR -w $iif(%vt_pass,$ifmatch,fp) -a %vt_rcon -f cmds.txt %vt_ip
- }
- }
- ;;;;;;;;;;;;;;;;;;;;;;;SCHAT;;;;;;;;;;;;;;;;;;;;;;;;;
- alias achat {
- if (!$sock(achat2)) {
- if ($1 isnum) { socklisten achat2 $1 } | else { socklisten achat2 }
- schatecho $+($col(start),Now) listenning for connection on IP $iif($ip,$ifmatch,$iif($sock(achat2).ip,$ifmatch,n/a)) with Port $sock(achat2).port
- }
- else { schatecho $+($col(start),Now) listenning for connection on IP $iif($ip,$ifmatch,$iif($sock(achat2).ip,$ifmatch,n/a)) with Port $sock(achat2).port }
- }
- alias schataccept { var %schat = $1
- if ($sock(%schat)) {
- var %pw = $+($r(a,z),$r(1,9),$r(a,z),$r(1,9),$r(a,z),$r(1,9)) | schatsendto %schat $+($col(start),Use) "/msg $me .schatlogin $+(%pw,") to sign in, you got 60 sec.
- .timer [ $+ [ %schat ] ] 1 60 schatclose %schat | set -u60 % [ $+ [ %pw ] ] %schat
- }
- elseif ($readini($gfile(gatherinfo.ini),schat,%sock)) { remini -n $gfile(gatherinfo.ini) schat %sock }
- }
- alias schatclose { var %schat = $1
- if ($sock(%schat)) { schatsendto %schat $+($col(start),You) didnt make it, the connection is being closed! | sockclose %schat }
- if ($gatherinfo(schat)) { schatsend $+($col(start),User) $col(14,$chr(40)) $+ Unknown $+ $col(14,$chr(41)) Disconnected. }
- if ($readini($gfile(gatherinfo.ini),schat,%sock)) { remini -n $gfile(gatherinfo.ini) schat %sock }
- }
- on *:socklisten:achat2: {
- var %sock = schat.1, %n = 2 | while ($sock(%sock)) { var %sock = $+(schat.,%n) | inc %n }
- sockaccept %sock | writeini -n $gfile(gatherinfo.ini) schat %sock Unknown | .timer -o 1 2 schataccept %sock | schatsend $+($col(start),User) Connecting..
- }
- on *:sockclose:schat.*: {
- var %sock = $sockname | schatsend $+($col(start),User) $col(14,$chr(40)) $+ $iif($readini($gfile(gatherinfo.ini),schat,%sock),$ifmatch,Unknown) $+ $col(14,$chr(41)) Disconnected | schaterase %sock
- }
- on *:sockread:schat.*: {
- var %user = 0, %sock = $sockname, %schat | sockread %schat | schatecho %schat
- if ($readini($gfile(gatherinfo.ini),schat,%sock)) { var %user = $ifmatch } | if (!%user) { sockclose %sock | return } | if (%user == Unknown) { return }
- tokenize 32 $gettok(%schat,2-,32) | var %cmd = $cmd_ingame($1)
- if ($1) { schatsendfrom $gettok(%schat,1,32) %user $1- }
- if (%cmd != 0) {
- if (%cmd == mastercmd) || (%cmd == onlysetbybenjimymaster) { $2- }
- elseif (%cmd == schatusers) || (%cmd == users) {
- var %i = 1, %u | while ($ini($gfile(gatherinfo.ini),schat,%i)) { var %y = $ifmatch, %x = $readini($gfile(gatherinfo.ini),schat,%y), %u = %u $split $+(%i,.) $gnick(%x) $+ $col(14,$chr(40)) $+ %x $+ $col(14,$chr(41)) | inc %i }
- dec %i | schatsend $+($col(start),Users:) %i connected to Socket-chat %u
- }
- elseif ($2 != 0) && ($ini($gfile(gatherservers.ini),$2)) { var %ipp = $iif($2 isnum,$ini($gfile(gatherservers.ini),$2),$2), %idd = $serverid(%ipp)
- if ($sock($+($srcon.prefix, %ipp))) { var %info = $1 $3- | tokenize 32 %info
- if (%cmd == score) || (%cmd == status) { set -u5 %wscore. [ $+ [ %ipp ] ] 1 | rconsend %ipp say $+($chr(91),$gatherstatus(%ipp),$chr(93)) CounterTerrorist: $score(%ipp,ct) - Terrorist: $score(%ipp,t) }
- elseif (%cmd == time) || (%cmd == thetime) { rconsend %ipp say Date&Time: $asctime($ctime) }
- elseif (%cmd == teams) { set -u5 %teams. [ $+ [ %ipp ] ] 1 | queryteams %ipp }
- elseif (%cmd == check) || (%cmd == checkjoin) || (%cmd == missing) { set -u5 %missing. [ $+ [ %ipp ] ] 1 | missing %ipp }
- elseif (readylist* iswm %cmd) || (rdylist* iswm %cmd) || (%cmd == checkrdy) || (%cmd == checkready) {
- if ($gatherstatus(%ipp) != Started) && ($gatherstatus(%ipp) != Round_End) {
- set -u5 %ready. $+ %ipp 1 | var %i = 1, %x = 1, %m = $null
- rconsend %ipp say Players still not ready to go: | while (%i <= $ini($gfile(players.ini),%ipp,0)) {
- var %s = $ini($gfile(players.ini),%ipp,%i) | if (!$readini($gfile(ready.ini),%ipp,%s)) { var %m = $iif(%m,$+(%m,$chr(44))) $gnick(%s) | if ($len(%m) >= 18) { .timer -o 1 %x rconsend %ipp say %m | var %m = $null | inc %x } } | inc %i
- }
- if (%m) { .timer -o 1 %x rconsend %ipp say %m } | .timer -o 1 %x rconsend %ipp say Use: .ready -/- .unready
- }
- }
- elseif (%cmd == whois) && ($2 != $null) && ($2 != 0) { set %whois. [ $+ [ %ipp ] ] $2- | rconsend %ipp status }
- elseif (%cmd == rs) || (%cmd == restart) { ;rconsend %ipp sv_restart 1 }
- elseif (%cmd == swapteams) { set -u3 %swapteams. [ $+ [ %ipp ] ] 1 | swapteams2 %ipp }
- elseif (%cmd == seeksub) { set -u5 %needsub. [ $+ [ %ipp ] ] 1 | seeksub %ipp }
- elseif (%cmd == needsub) { set -u5 %needsub. [ $+ [ %ipp ] ] 1 | needsub %ipp }
- elseif (%cmd == endsub) || (%cmd == subend) { .endsub %ipp :gatherbot: }
- elseif (%cmd == setmap) || (%cmd == changemap) || (%cmd == changelevel) {
- if ($findmap($2)) {
- var %map = $ifmatch | writeini -n $gfile(gatherstatus.ini) %ipp map %map
- if ($workshop(%ipp,%map)) { var %x = $remove($ifmatch,workshop/) | rconsend %ipp host_workshop_map %x } | else { rconsend %ipp changelevel %map }
- }
- else { rconsend %ipp say $2 is not a valid map! }
- }
- elseif (%cmd == freeze) || (%cmd == freezetime) && ($2 isnum) { rconsend %ipp mp_freezetime $2 }
- elseif (%cmd == pregame) || (%cmd == pre) && (!%spt. [ $+ [ %ipp ] ]) { set -u2 %spt. [ $+ [ %ipp ] ] 1 | pregame %ipp }
- elseif (%cmd == tacs) && (!%spt. [ $+ [ %ipp ] ]) { set -u2 %spt. [ $+ [ %ipp ] ] 1 | tacs %ipp }
- elseif (%cmd == start) && (!%spt. [ $+ [ %ipp ] ]) { set -u3 %spt. [ $+ [ %ipp ] ] 1 | start %ipp }
- elseif (%cmd == adminstop) && (!%gatherstopped. [ $+ [ %ipp ] ]) { set -u10 %gatherstopped. [ $+ [ %ipp ] ] :gatherbot: | .stop %ipp }
- elseif (%cmd == setscore) || (%cmd == updatescore) || (%cmd == newscore) { setscore %ipp $2- }
- elseif (%cmd == say) && ($2 != $null) { rconsend %ipp say $+($gnick(%user),:) $2- }
- elseif (%cmd == kick) && ($2 != $null) { set %kick. [ $+ [ %ipp ] ] :gatherbot: $2- | rconsend %ipp status }
- elseif (%cmd == rcon) && ($2 != $null) { schatsendto %sock $+($col(start),Rcon:) $2- | rconsend %ipp $2- }
- }
- else { schatsendto %sock $+($col(start),There) is no connection to server $+($chr(35),%idd) }
- }
- else { schatsendto %sock $+($col(start),Error.) Use: .cmd <server:ID/IP> <rest of the cmd here> }
- }
- }
- on *:input:@schat:{
- if ($left($1,1) != $chr(47)) {
- var %open = 0, %i = 1 | while ($ini($gfile(gatherinfo.ini),schat,%i)) { var %schat = $ifmatch, %user = $readini($gfile(gatherinfo.ini),schat,%schat)
- if ($sock(%schat)) { if (%user) { var %open = 1 | sockwrite -n %schat $+(<,$me,>) $1- } | inc %i } | else { remini -n $gfile(gatherinfo.ini) schat %schat }
- }
- if (%open) { schatecho $+(<,$me,>) $1- } | else { schatecho 0,1<4Error0> No users are logged in }
- }
- }
- alias schatsend {
- if ($1) {
- var %open = 0, %i = 1 | while ($ini($gfile(gatherinfo.ini),schat,%i)) { var %schat = $ifmatch, %user = $readini($gfile(gatherinfo.ini),schat,%schat)
- if ($sock(%schat)) { if (%user != Unknown) { var %open = 1 | sockwrite -n %schat $+(<,$me,>) $1- } | inc %i } | else { remini -n $gfile(gatherinfo.ini) schat %schat }
- }
- if (%open) { schatecho $+(<,$me,>) $1- }
- }
- }
- alias schatsendfrom {
- if ($3) {
- var %i = 1 | while ($ini($gfile(gatherinfo.ini),schat,%i)) { var %schat = $ifmatch, %user = $readini($gfile(gatherinfo.ini),schat,%schat)
- if ($sock(%schat)) { if (%user != Unknown) && (%user != $2) { sockwrite -n %schat $1 $col(14,$chr(40)) $+ User: $2 $+ $col(14,$chr(41)) $+ : $3- } | inc %i } | else { schaterase %schat }
- }
- }
- }
- alias schatsendto { if ($sock($1)) { if ($2) { sockwrite -n $1 $+(<,$me,>) $2- | schatecho $+(<,$me,>) $2- } } | elseif ($readini($gfile(gatherinfo.ini),schat,$1)) { remini -n $gfile(gatherinfo.ini) schat $1 } }
- alias schatecho { if ($1) { if (!$window(@Schat)) { window -ezk0 @Schat } | echo @Schat $time » $1- | window -g @Schat } }
- alias schaterase { var %sock = $1
- if ($sock(%sock)) { sockclose %sock }
- if ($timer(%sock)) { .timer [ $+ [ %sock ] ] off }
- if ($readini($gfile(gatherinfo.ini),schat,%sock)) { remini -n $gfile(gatherinfo.ini) schat %sock }
- }
- ;;;;;;;;;;;;;;;;;;;;;;;STATSBOT CLIENT;;;;;;;;;;;;;;;;;;;;;;;;;
- on *:sockopen:statschat: {
- if ($sockerr) { .timerstatschat -o 0 60 statschat }
- }
- on *:sockread:statschat: {
- var %schat | sockread %schat
- if ($gettok(%schat,1,32) == reload) { rload $ownerchan | .timer -o 1 1 echo -s $timestamp Scripts reloaded. }
- }
- alias statschat {
- if (!$statscheck) && ($readini($gfile(gatherinfo.ini),modes,statschat)) {
- var %info = $ifmatch, %ip = $gettok(%info,1,58), %port = $gettok(%info,2,58)
- if (*?*.*?*.*?* !iswm %ip) { return }
- if (%port !isnum) { var %port = 1337 }
- if ($sock(statschat)) { sockclose statschat }
- .timerstatschat -o 1 300 statschat | sockopen statschat %ip %port
- }
- }
- alias statsend { if ($1-) && ($sock(statschat).status == active) { sockwrite -n statschat $1- } }
- alias statscheck { if ($sock(statschat).status == active) { return $true } | return $false }
- alias statsbot { if ($2-) { if ($statscheck) { statsend $meorsay $1 $2- } | else { whatcmd $meorsay $1 $2- } } }
- ;;;;;;;;;;;;;;;;;;;;;;;HLTV;;;;;;;;;;;;;;;;;;;;;;;;;
- alias hltvstart {
- if ($sock(rconhltv. [ $+ [ $1 ] ])) { sockclose rconhltv. [ $+ [ $1 ] ] }
- hltvchallenge $1
- .timer -o 1 2 hltvcmd $1 connect
- .timer -o 1 5 hltvcmd $1 record gatherid
- }
- alias hltvinfo {
- var %ip = $iif($1 isnum,$ini($gfile(gatherservers.ini),$1),$1), %id = $iif($1 isnum,$1,$serverid(%ip))
- if ($2 == port) { return $calc(9100 + %id) }
- if ($2 == log) || ($2 == logport) { return $calc(9200 + %id) }
- if ($2 == ip) { var %x = $iif($readini(gatherservers.ini,%ip,hltv_ip),$ifmatch,0) | if (myip == %x) { return $iif($ip,$ifmatch,0) } | return %x }
- if ($2 == challenge) { return $iif($readini(gatherservers.ini,%ip,hltv_challenge),$ifmatch,0) }
- if ($2 == rcon) { return $iif($readini(gatherservers.ini,%ip,hltv_rcon),$ifmatch,$iif($readini(gatherservers.ini,%ip,cs_rcon),$ifmatch,0)) }
- if ($2 != $null) { return $iif($readini(gatherservers.ini,%ip,$2),$ifmatch,0) } | return 0
- }
- alias hltvchallenge { var %ip = $iif($1 isnum,$ini(gatherservers.ini,$1),$1)
- .sockudp -nk rconhltv. $+ %ip $hltvinfo(%ip,log) $hltvinfo(%ip,ip) $hltvinfo(%ip,port) ÿÿÿÿchallenge rcon
- }
- alias hltvsend { var %ip = $iif($1 isnum,$ini(gatherservers.ini,$1),$1)
- .sockudp -nk rconhltv. $+ %ip $hltvinfo(%ip,log) $hltvinfo(%ip,ip) $hltvinfo(%ip,port) ÿÿÿÿrcon $hltvinfo(%ip,challenge) $hltvinfo(%ip,rcon) $2-
- }
- alias hltvrcon { var %ip = $iif($1 isnum,$ini(gatherservers.ini,$1),$1) | h.list %ip hltvsend %ip $2- }
- alias hltvcmd { var %ip = $iif($1 isnum,$ini(gatherservers.ini,$1),$1), %status = $gatherinfo(%ip,hltvstatus)
- if ($2 == connect) { hltvrcon %ip connect %ip ;serverpassword $gatherinfo(%ip,cs_pw) }
- elseif ($2 == disconnect) || ($2 == stop) { hltvrcon %ip stop }
- elseif ($2 == record) { var %demo = $iif($3,$ifmatch,gatherid)
- if ($readini(gatherservers.ini,%ip,hltv_stoprecord)) { remini -n gatherservers.ini %ip hltv_stoprecord }
- writeini -n gatherservers.ini %ip hltv_record %demo | hltvrcon %ip record %demo | .timerhltvrecord. $+ %ip 1 3 hltvrcon %ip status
- }
- elseif ($2 == stoprecording) || ($2 == stoprecord) {
- writeini -n gatherservers.ini %ip hltv_stoprecord $iif($3,$ifmatch,hltvdelete) | if ($4) { writeini -n gatherservers.ini %ip hltv_record $4 } | hltvrcon %ip stop | .timerhltvstop $+ %ip 1 2 hltvrcon %ip stop
- }
- else { h.list %ip hltvsend %ip $2- }
- }
- alias hltvecho { if (!$window(@HLTVLOG)) { window -ezk0 @HLTVLOG } | echo @HLTVLOG $1- }
- alias hltvsave {
- var %dir = $+(",$findfile($hltvdir,$1,1),"), %dem = $+($2,.dem), %newdir = $+(",$mircdirgatherdemo\,%dem,")
- if (!$isdir($mircdirgatherdemo\)) { mkdir gatherdemo\ } | .rename %dir %newdir | .timer -o 1 2 winrar %dem
- }
- alias hltvsave2 {
- var %dir = $+(",$findfile($hltvdir,$1,1),"), %dem = $+($2,.dem), %newdir = $+(",$mircdirgatherdemo\,%dem,")
- if (!$isdir($mircdirgatherdemo\)) { mkdir gatherdemo\ } | .rename %dir %newdir | .timer -o 1 2 winrar %dem
- }
- alias hltvfailsave {
- var %dir = $+(",$findfile($hltvdir,$1,1),"), %dem = $+($2,.dem), %newdir = $+(",$mircdirgatherdemo2\,%dem,")
- if (!$isdir($mircdirgatherdemo2\)) { mkdir gatherdemo2\ } | .rename %dir %newdir | .timer -o 1 2 winrar2 %dem
- }
- alias hltvdelete { var %dir = $+(",$findfile($hltvdir,$1,1),") | if (%dir) { .remove -b %dir } }
- alias h.list {
- var %w = @hlist, %t = hlist, %s = $line(%w,0)
- if (!$window(%w)) { window -ezk0 %w } | if ($2 != $null) { aline %w $1- } | if ($1 == stuck) { dline %w 1 }
- if ((!$timer(%t)) || ($ctimer == %t)) && ($line(%w,1)) { tokenize 32 $ifmatch
- if (%hltvchall. [ $+ [ $1 ] ]) { .timer $+ %t -m 1 200 h.list stuck | [ $2 ] $3- | dline %w 1 | .timer $+ %t -m 1 100 h.list } | else { set %h.list 1 | hltvchallenge $1 | .timer $+ %t 1 2 h.list stuck }
- }
- }
- on *:udpread:rconhltv.*: {
- if (!$window(@hltv)) { window -ezk0 @hltv }
- :nextread
- if ($sockerr > 0) { return }
- var %ipp = $gettok($sockname,2-,46), %chall = $null
- var %temp. [ $+ [ %ipp ] ] | sockread -f %temp. [ $+ [ %ipp ] ]
- if ($sockbr == 0) { return }
- if (%temp. [ $+ [ %ipp ] ]) { tokenize 32 $strip($remove(%temp. [ $+ [ %ipp ] ],ÿÿÿÿl,ÿÿÿÿ))
- echo @hltv $chr(91) $+ $time $+ ][ $+($chr(35),$serverid(%ipp)) $chr(93) $1-
- if (challenge rcon isin $1-) { var %chall = $3
- if (%chall) {
- writeini -n gatherservers.ini %ipp hltv_challenge %chall | set -u5 %hltvchall. [ $+ [ %ipp ] ] $time
- if (%h.list) { unset %h.list | .timerhlist -m 1 200 h.list }
- }
- else { .timerhltvchall $+ %ipp 1 2 hltvchallenge %ipp }
- }
- if (Recording initialized isin $1-) {
- if ($timer(rec [ $+ [ %ipp ] ])) { .timerrec [ $+ [ %ipp ] ] off } | if ($timer(record [ $+ [ %ipp ] ])) { .timerrecord [ $+ [ %ipp ] ] off } | goto nextread
- }
- if (Already recording isin $1-) {
- if ($timer(rec [ $+ [ %ipp ] ])) { .timerrec [ $+ [ %ipp ] ] off } | if ($timer(record [ $+ [ %ipp ] ])) { .timerrecord [ $+ [ %ipp ] ] off } | goto nextread
- }
- if (Completed demo isin $1-) { var %demo = $left($3,-1)
- if ($timer(hltvstop [ $+ [ %ipp ] ])) { .timerhltvstop [ $+ [ %ipp ] ] off }
- if ($readini(gatherservers.ini,%ipp,hltv_stoprecord)) { var %type = $ifmatch | remini -n gatherservers.ini %ipp hltv_stoprecord
- if ($readini(gatherservers.ini,%ipp,hltv_record)) { var %dem = $ifmatch
- remini -n gatherservers.ini %ipp hltv_record | [ %type ] $iif(%type == hltvsave,%demo %dem,%demo)
- }
- else { [ %type ] $iif(%type == hltvsave,%demo,) $remove(%demo,.dem) }
- }
- elseif ($readini(gatherservers.ini,%ipp,hltv_record)) { hltvcmd %ipp record $ifmatch | hltvfailsave %demo $remove(%demo,.dem) } | else { hltvfailsave %demo $remove(%demo,.dem) }
- goto nextread
- }
- if (HLTV Status isin $1-) { set -u2 %hltvstatus. [ $+ [ %ipp ] ] 1 | goto nextread }
- if (Local IP isin $1-) && (%hltvstatus. [ $+ [ %ipp ] ]) { writeini -n $gfile(gatherstatus.ini) %ipp hltvip $remove($3,$chr(44)) | goto nextread }
- if (Not connected isin $1-) && (%hltvstatus. [ $+ [ %ipp ] ]) {
- if ($serverstatus(%ipp,clean) != Free) && ($readini(gatherservers.ini,%ipp,hltv_record)) && (!$readini(gatherservers.ini,%ipp,hltv_stoprecord)) { hltvcmd %ipp connect | .timerstatus $+ %ipp 1 2 hltvrcon %ipp status } | goto nextread
- }
- if ((Connected to Game Server isin $1-) || (Connected to HLTV Proxy isin $1-)) && (%hltvstatus. [ $+ [ %ipp ] ]) {
- if ($serverstatus(%ipp,clean) != Free) && (!$readini(gatherservers.ini,%ipp,hltv_stoprecord)) && ($readini(gatherservers.ini,%ipp,hltv_record)) {
- .timerrec $+ %ipp 1 1 hltvrcon %ipp record $ifmatch
- if (!$readini(gatherstatus.ini,%ipp,hltv)) && ($readini(gatherstatus.ini,%ipp,hltvip)) { var %hltvip = $ifmatch
- writeini -n $gfile(gatherstatus.ini) %ipp hltv $time | whatcmd msg $mainchan $logo LIVE: Du kan nu følge med i gatheren på server $+($chr(35),$serverid(%ipp)) $logo HLTV: connect %hltvip $logo
- }
- }
- else { hltvrcon %ipp stop }
- .timerrecord $+ %ipp 1 2 hltvrcon %ipp status | goto nextread
- }
- if (Recording to isin $1-) && (%hltvstatus. [ $+ [ %ipp ] ]) {
- if ($timer(rec [ $+ [ %ipp ] ])) { .timerrec [ $+ [ %ipp ] ] off } | if ($timer(record [ $+ [ %ipp ] ])) { .timerrecord [ $+ [ %ipp ] ] off }
- if ($readini(gatherservers.ini,%ipp,hltv_record)) && ($readini(gatherservers.ini,%ipp,hltv_stoprecord)) { .timer -o 1 1 hltvrcon %ipp stop }
- elseif (!$readini(gatherservers.ini,%ipp,hltv_record)) { .timer -o 1 1 hltvrcon %ipp stop } | unset %hltvstatus. [ $+ [ %ipp ] ] | goto nextread
- }
- }
- goto nextread
- }
- ;;;;;;;;;;;;;;;;;;;;;;;STATSBOT;;;;;;;;;;;;;;;;;;;;;;;;;
- alias statsclient {
- on *:socklisten:statschat: { var %sock = statschat.1, %n = 2 | while ($sock(%sock)) { var %sock = $+(statschat.,%n) | inc %n } | sockaccept %sock }
- on *:sockclose:statschat.*: { .timer -o 1 0 statserase $sockname }
- on *:sockread:statschat.*: {
- var %sockname = $sockname, %schat | sockread %schat
- if (%schat) { tokenize 32 %schat | if ($3-) && ($me ison $2 || $comchan($2,0)) { [ $1 ] $2 $3- } }
- }
- alias statschat {
- if (!$sock(statschat)) { var %port = $iif($1 isnum,$calc($1 +1),1337) | if (%port < 1350) { .timerag 1 0 statschat %port } | socklisten statschat %port | .timerag off }
- }
- alias statsall { if ($1-) { var %i = 1 | while ($sock(*,%i)) { var %sockname = $ifmatch | if (statschat.* iswm %sockname) && ($sock(%sockname).status == active) { sockwrite -n %sockname $2- } | inc %i } } }
- alias statsend { if ($2-) && ($sock($1).status == active) { sockwrite -n $1 $2- } }
- alias statserase { var %sock = $iif($1,$1,statschat*)
- if ($sock(%sock)) { sockclose %sock }
- if ($timer(%sock)) { .timer [ $+ [ %sock ] ] off }
- }
- }
- ;; START/STOP SERVER SOCKETS ;;
- on *:sockopen:startserver.*:{
- var %ip = $gettok($sockname,2-,46)
- echo -s $timestamp $+($chr(35),$serverid(%ip),:) Sockopen.
- var %link = $cleanlink($readini($gfile(gatherservers.ini),%ip,startlink)), %host = $gettok(%link,1,47), %get = $+(/,$gettok(%link,2-,47))
- .sockwrite -n $sockname GET %get HTTP/1.1
- .sockwrite -n $sockname Host: %host
- .sockwrite -n $sockname $crlf
- if ($timer(startserver. [ $+ [ %ip ] ])) { .timerstartserver. [ $+ [ %ip ] ] off }
- .timerrconlast. [ $+ [ %ip ] ] 1 60 rconlast %ip
- }
- on *:sockread:startserver.*:{
- var %ip = $gettok($sockname,2-,46)
- if ($sockerr) { echo -s 4SOCKERR on $sockname | return }
- var %sock | .sockread -f %sock
- if (%sock) {
- echo -s $timestamp $+($chr(35),$serverid(%ip),:) %sock
- if ($timer(startserver. [ $+ [ %ip ] ])) { .timerstartserver. [ $+ [ %ip ] ] off }
- .timerrconlast. [ $+ [ %ip ] ] 1 20 rconlast %ip
- }
- }
- on *:sockclose:startserver.*:{
- var %ip = $gettok($sockname,2-,46)
- echo -s $timestamp $+($chr(35),$serverid(%ip),:) Sockclose.
- if ($timer(startserver. [ $+ [ %ip ] ])) { .timerstartserver. [ $+ [ %ip ] ] off }
- .timerrconlast. [ $+ [ %ip ] ] 1 15 rconlast %ip
- }
- alias startserver {
- if ($readini($gfile(gatherservers.ini),$1,startlink)) {
- var %link = $cleanlink($ifmatch), %host = $gettok(%link,1,47), %get = $+(/,$gettok(%link,2-,47))
- if (!$sock(startserver. [ $+ [ $1 ] ])) { .sockopen $iif(#go.ee == $mainchan,-e) startserver. [ $+ [ $1 ] ] %host $iif(#go.ee == $mainchan,443,80) }
- }
- }
- alias startlink {
- if ($readini($gfile(gatherservers.ini),$1,startlink)) {
- var %link = $cleanlink($ifmatch), %host = $gettok(%link,1,47), %get = $+(/,$gettok(%link,2-,47))
- if (!$sock(startserver. [ $+ [ $1 ] ])) {
- if (!$timer(startserver. [ $+ [ $1 ] ])) { .timerstartserver. [ $+ [ $1 ] ] 1 10 startlink $1 }
- .timerrconlast. [ $+ [ $1 ] ] 1 20 rconlast $1
- .sockopen $iif(#go.ee == $mainchan,-e) startserver. [ $+ [ $1 ] ] %host $iif(#go.ee == $mainchan,443,80)
- }
- }
- else {
- resetall $1 | writeini -n $gfile(gatherservers.ini) $1 error No Response | whatcmd $meorsay $mainchan $logo Couldnt connect to server $+($chr(35),$serverid($1)) $+ , the gather is therefore stopped! $logo
- }
- }
- alias cleanlink {
- return $remove($1-,http://,https://,www.)
- }
- ;##### ONLY CS GO PART #####;
- alias rconlast {
- if (!$serverinuse($1)) { return }
- if ($readini($gfile(gatherstatus.ini),$1,error)) { return }
- .timerretry. $+ $1 1 10 rconretry $1 | set %retry. [ $+ [ $1 ] ] 2
- writeini -n $gfile(gatherstatus.ini) $1 startlink $ctime | sourcercon $replace($1,$chr(58),$chr(32))
- }
- alias rconstart {
- var %rconsocket = $+($srcon.prefix, $1), %logsocket = $+($log.prefix, $1)
- ;;writeini -n $gfile(gatherstatus.ini) $1 error $ctime
- if ($sock(%rconsocket)) { sockclose %rconsocket }
- if ($sock(%logsocket)) { sockclose %logsocket }
- if ($readini($gfile(gatherstatus.ini),$1,error)) { return }
- if ($2 == startup) { set %startup. [ $+ [ $1 ] ] 1 }
- set %retry. [ $+ [ $1 ] ] 1 | .timerretry. $+ $1 1 10 rconretry $1 | sourcercon $replace($1,$chr(58),$chr(32))
- }
- alias rconretry {
- if (!$serverinuse($1)) { return }
- var %rconsocket = $+($srcon.prefix, $1)
- if ($readini($gfile(gatherservers.ini),$1,status) == Ended) { return }
- if ($readini($gfile(gatherstatus.ini),$1,error)) { return }
- if (%retry. [ $+ [ $1 ] ]) {
- if (%retry. [ $+ [ $1 ] ] > 2) {
- if ($readini($gfile(gatherstatus.ini),$1,startlink)) || (!$readini($gfile(gatherservers.ini),$1,startlink)) {
- ;resetall $1 | ;writeini -n $gfile(gatherservers.ini) $1 error No Response | ;whatcmd $meorsay $mainchan $logo Couldnt connect to server $+($chr(35),$serverid($1)) $+ , the gather is therefore stopped! $logo
- if ($vtset($1)) { ;.timer -o 1 1 delete.vt $1 }
- writeini -n $gfile(gatherstatus.ini) $1 error $ctime | remini -n $gfile(score.ini) $1
- whatcmd $meorsay $mainchan $logo Connection to server $+($chr(35),$serverid($1)) have been lost, game can be resulted with .result [win/lost] or aborted with .abortgame $logo
- }
- else {
- unset %retry. [ $+ [ $1 ] ] | startlink $1
- }
- }
- else {
- if ($sock(%rconsocket)) { sockclose %rconsocket }
- .timerretry. $+ $1 1 10 rconretry $1 | sourcercon $replace($1,$chr(58),$chr(32))
- }
- inc %retry. [ $+ [ $1 ] ]
- }
- elseif (%nodata. [ $+ [ $1 ] ]) { whatcmd $meorsay $privchan $logo Reconnected to server $serverid($1) $logo | unset %nodata. [ $+ [ $1 ] ] }
- }
- alias challenge {
- if ($readini($gfile(gatherstatus.ini),$1,error)) { return }
- var %ip = $iif($1 isnum,$ini($gfile(gatherservers.ini),$1),$1) | sourcercon $replace(%ip,$chr(58),$chr(32))
- }
- alias rconsayscript {
- if ($readini($gfile(gatherstatus.ini),$1,error)) { return }
- rconlogstart $1
- }
- alias rconsayscript2 {
- if ($readini($gfile(gatherstatus.ini),$1,error)) { return }
- rconlogstart2 $1
- }
- alias rconset {
- if (!$serverinuse($1)) { return }
- if ($readini($gfile(gatherstatus.ini),$1,error)) { return }
- if (%startup. [ $+ [ $1 ] ]) {
- unset %startup. [ $+ [ $1 ] ]
- if ($readini($gfile(gatherstatus.ini),$1,map)) {
- var %map = $ifmatch
- if ($workshop($1,%map)) { var %x = $remove($ifmatch,workshop/) | rconsend $1 host_workshop_map %x } | else { rconsend $1 changelevel %map }
- }
- .timerrecheck. [ $+ [ $1 ] ] 1 3 rechecksocket $1 | .timer -o 1 5 rconset $1 | return
- }
- rconsetpw $1 | .timer -o 1 3 pregame $1
- }
- alias rconadv {
- if (!$serverinuse($1)) { return }
- if ($readini($gfile(gatherservers.ini),$1,status) == Ended) { return }
- if ($readini($gfile(gatherstatus.ini),$1,error)) { return }
- if ($sock($+($srcon.prefix, $1))) {
- rconsetpw $1 | if ($network == QuakeNet) { ;rconsend $1 say Get your CS Gather bot from #OBS @ QuakeNet. }
- }
- elseif ($timer($1)) { .timer $+ $1 off }
- }
- alias rconsetpw {
- if ($readini($gfile(gatherstatus.ini),$1,error)) { return }
- rconsend $1 sv_password $iif($readini($gfile(gatherservers.ini),$1,cs_pw),$ifmatch,"")
- }
- alias keepalive {
- if (!$serverinuse($1)) { return }
- if ($readini($gfile(gatherservers.ini),$1,status) == Ended) { return }
- if ($readini($gfile(gatherstatus.ini),$1,error)) { return }
- if ($sock($+($srcon.prefix, $1))) { rconsend $1 echo Keep connection alive.. | .timerrecheck. [ $+ [ $1 ] ] 1 2 rechecksocket $1 }
- elseif ($serverinuse($1)) {
- if (!%retry. [ $+ [ $1 ] ]) { set %retry. [ $+ [ $1 ] ] 1 }
- .timerretry. $+ $1 1 10 rconretry $1 | sourcercon $replace($1,$chr(58),$chr(32))
- }
- elseif ($timer(keepalive. [ $+ [ $1 ] ])) { .timerkeepalive. [ $+ [ $1 ] ] off }
- }
- alias rconsend {
- var %rconsocket = $+($srcon.prefix, $1), %logsocket = $+($log.prefix, $1)
- if (!$sock(%rconsocket)) {
- if ($sock(%logsocket)) { sockclose %logsocket }
- srcon_echo $1 04 $time * Error: Socket is dead. $+($chr(40),Cmd: $2-,$chr(41))
- return
- }
- if ($sock(%rconsocket).status != active) { .timer -o 1 1 rconsend $1- | return }
- inc %srcon.id. $+ %rconsocket
- srcon.getrequest &srcon.cmd %srcon.id. [ $+ [ %rconsocket ] ] $srcon.req.execcmd $2-
- if ($2 != echo) { srcon_echo $1 $time -> $2- }
- if ($2 == changelevel) { .timerrecheck. [ $+ [ $1 ] ] 1 3 rechecksocket $1 }
- sockwrite %rconsocket &srcon.cmd
- }
- alias cfgfolder {
- var %folder = $readini($gfile(gatherservers.ini),$1,cfgfolder), %i = 1, %result
- if (!%folder) { var %folder = $readini($gfile(gatherinfo.ini),global,cfgfolder) }
- if (!%folder) { return }
- while ($gettok(%folder,%i,47)) { var %x = $ifmatch, %result = $+(%result,%x,/) | inc %i }
- return %result
- }
- alias workshop {
- var %workshop = $readini($gfile(gatherservers.ini),$1,$2)
- if (!%workshop) { var %workshop = $readini($gfile(gatherinfo.ini),global,$2) }
- return %workshop
- }
- alias startkick { set -u10 %startkick. [ $+ [ $1 ] ] 1 | rconsend $1 status }
- alias endkick { set -u10 %endkick. [ $+ [ $1 ] ] 1 | rconsend $1 status }
- alias start_only { var %gamestats = $gamestatsini($1) | if ($score($1,total) <= 2) && ($ini(%gamestats,0)) { .remove %gamestats } | if ($ini($gfile(ready.ini),$1)) { remini -n $gfile(ready.ini) $1 } | .score $1 reset | set -u10 %gatherhold. [ $+ [ $1 ] ] 1 | writeini -n $gfile(gatherservers.ini) $1 status Started }
- alias start { var %gamestats = $gamestatsini($1) | if ($score($1,total) <= 2) && ($ini(%gamestats,0)) { .remove %gamestats } | if ($ini($gfile(ready.ini),$1)) { remini -n $gfile(ready.ini) $1 } | .score $1 reset | set -u10 %gatherhold. [ $+ [ $1 ] ] 1 | writeini -n $gfile(gatherservers.ini) $1 status Started | startgame $1 }
- alias startgame {
- rconsend $1 say Starting game..
- var %cfgfolder = $cfgfolder($1)
- if ($score($1,total) < 30) {
- if ($gatherinfo(gotv)) {
- var %start = $readini($gfile(gatherstatus.ini),$1,start_time), %name = $+($replace($gettok(%start,1,32),/,-),_,$remove($gettok(%start,2,32),:),_,$readini($gfile(gatherstatus.ini),$1,map))
- rconsend $1 tv_stoprecord | rconsend $1 tv_record %name
- }
- var %slots = $readini($gfile(gatherstatus.ini),$1,slots)
- if (%slots == 2) && ($readini($gfile(gatherservers.ini),$1,alias_1v1)) {
- var %alias = $ifmatch, %gettok = $gettok(%alias,-1,32)
- if (%cfgfolder) && (*.cfg iswm %gettok) && (%cfgfolder != $mid(%gettok,1,$len(%cfgfolder))) { var %numtok = $numtok(%alias,32), %alias = $gettok(%alias,1 - $calc(%numtok -1),32) $+(%cfgfolder,%gettok) }
- rconsend $1 %alias | return
- }
- if (%slots == 2) && ($readini($gfile(gatherinfo.ini),global,alias_1v1)) {
- var %alias = $ifmatch, %gettok = $gettok(%alias,-1,32)
- if (%cfgfolder) && (*.cfg iswm %gettok) && (%cfgfolder != $mid(%gettok,1,$len(%cfgfolder))) { var %numtok = $numtok(%alias,32), %alias = $gettok(%alias,1 - $calc(%numtok -1),32) $+(%cfgfolder,%gettok) }
- rconsend $1 %alias | return
- }
- if ($readini($gfile(gatherservers.ini),$1,alias_mr15)) {
- var %alias = $ifmatch, %gettok = $gettok(%alias,-1,32)
- if (%cfgfolder) && (*.cfg iswm %gettok) && (%cfgfolder != $mid(%gettok,1,$len(%cfgfolder))) { var %numtok = $numtok(%alias,32), %alias = $gettok(%alias,1 - $calc(%numtok -1),32) $+(%cfgfolder,%gettok) }
- rconsend $1 %alias | return
- }
- if ($readini($gfile(gatherinfo.ini),global,alias_mr15)) {
- var %alias = $ifmatch, %gettok = $gettok(%alias,-1,32)
- if (%cfgfolder) && (*.cfg iswm %gettok) && (%cfgfolder != $mid(%gettok,1,$len(%cfgfolder))) { var %numtok = $numtok(%alias,32), %alias = $gettok(%alias,1 - $calc(%numtok -1),32) $+(%cfgfolder,%gettok) }
- rconsend $1 %alias | return
- }
- rconsend $1 exec $+(%cfgfolder,mr15.cfg)
- }
- else {
- if ($readini($gfile(gatherservers.ini),$1,alias_mr3)) {
- var %alias = $ifmatch, %gettok = $gettok(%alias,-1,32)
- if (%cfgfolder) && (*.cfg iswm %gettok) && (%cfgfolder != $mid(%gettok,1,$len(%cfgfolder))) { var %numtok = $numtok(%alias,32), %alias = $gettok(%alias,1 - $calc(%numtok -1),32) $+(%cfgfolder,%gettok) }
- rconsend $1 %alias | return
- }
- if ($readini($gfile(gatherinfo.ini),global,alias_mr3)) {
- var %alias = $ifmatch, %gettok = $gettok(%alias,-1,32)
- if (%cfgfolder) && (*.cfg iswm %gettok) && (%cfgfolder != $mid(%gettok,1,$len(%cfgfolder))) { var %numtok = $numtok(%alias,32), %alias = $gettok(%alias,1 - $calc(%numtok -1),32) $+(%cfgfolder,%gettok) }
- rconsend $1 %alias | return
- }
- rconsend $1 exec $+(%cfgfolder,mr3.cfg)
- }
- }
- alias pregame { .score $1 reset | writeini -n $gfile(gatherservers.ini) $1 status Pregame | warmup $1 }
- alias warmup {
- rconsend $1 say Setting pregame..
- var %cfgfolder = $cfgfolder($1)
- if ($readini($gfile(gatherservers.ini),$1,alias_pregame)) {
- var %alias = $ifmatch, %gettok = $gettok(%alias,-1,32)
- if (%cfgfolder) && (*.cfg iswm %gettok) && (%cfgfolder != $mid(%gettok,1,$len(%cfgfolder))) { var %numtok = $numtok(%alias,32), %alias = $gettok(%alias,1 - $calc(%numtok -1),32) $+(%cfgfolder,%gettok) }
- rconsend $1 %alias | return
- }
- if ($readini($gfile(gatherinfo.ini),global,alias_pregame)) {
- var %alias = $ifmatch, %gettok = $gettok(%alias,-1,32)
- if (%cfgfolder) && (*.cfg iswm %gettok) && (%cfgfolder != $mid(%gettok,1,$len(%cfgfolder))) { var %numtok = $numtok(%alias,32), %alias = $gettok(%alias,1 - $calc(%numtok -1),32) $+(%cfgfolder,%gettok) }
- rconsend $1 %alias | return
- }
- ;;SPECIAL;;
- if (#gatherzone == $mainchan) { rconsend $1 exec test.cfg | return }
- rconsend $1 exec $+(%cfgfolder,pregame.cfg)
- }
- alias tacs { .score $1 reset | writeini -n $gfile(gatherservers.ini) $1 status Tacs | rconsend $1 mp_freezetime 60 | rconsend $1 mp_restartgame 2 | rconsend $1 say Tacs settings loaded! }
- alias rechecksocket {
- if (!$serverinuse($1)) { return }
- if ($readini($gfile(gatherstatus.ini),$1,error)) { return }
- var %rconsocket = $+($srcon.prefix, $1), %logsocket = $+($log.prefix, $1)
- if (!$sock(%rconsocket)) {
- if ($sock(%logsocket)) { sockclose %logsocket }
- if (!%rechecksocket. [ $+ [ $1 ] ]) { set -u5 %rechecksocket. [ $+ [ $1 ] ] 1 | .timerrecheck. [ $+ [ $1 ] ] 1 2 rechecksocket $1 | sourcercon $replace($1,$chr(58),$chr(32)) }
- else { set %retry. [ $+ [ $1 ] ] 1 | .timerretry. $+ $1 1 10 rconretry $1 | sourcercon $replace($1,$chr(58),$chr(32)) }
- }
- elseif (!$sock(%logsocket)) { .timerlogstart. [ $+ [ $1 ] ] 1 1 rconlogstart $1 }
- }
- alias rconlogstart { set -u2 %logstart. [ $+ [ $1 ] ] 1 | rconlogstart2 $1 }
- alias rconlogstart2 {
- var %ipp = $1, %rconsocket = $+($srcon.prefix, $1), %logsocket = $+($log.prefix, $1)
- if ($readini($gfile(gatherstatus.ini),$1,error)) { return }
- if ($sock(%rconsocket)) {
- if ($sock(%logsocket)) { sockclose %logsocket }
- sockudp -k %logsocket
- var %port = $iif($sock(%logsocket).port,$ifmatch,$+(100,$rand(1,9),$rand(1,9)))
- rconsend %ipp logaddress_delall | rconsend %ipp logaddress_add $+($ip,:,%port)
- if (%startup. [ $+ [ %ipp ] ]) { rconsend %ipp log on | .timer -o 1 2 rconset %ipp } | else { rconsend %ipp log }
- set -u10 %check. [ $+ [ %ipp ] ] 1 | .timer -o 1 1 rconsend %ipp status
- }
- elseif ($sock(%logsocket)) { sockclose %logsocket }
- }
- alias logcheck {
- var %ipp = $1, %logsocket = $+($log.prefix,%ipp), %rconsocket = $+($srcon.prefix,%ipp)
- if ($readini($gfile(gatherstatus.ini),$1,error)) { return }
- if ($sock(%rconsocket)) { .timerlogstart. [ $+ [ %ipp ] ] 1 0 rconlogstart %ipp } | elseif ($sock(%logsocket)) { sockclose %logsocket }
- }
- alias getwep { return $gettok($gettok($1-,5,34),1,60) }
- alias getkill {
- if (*headshot* iswm $remove($gettok($1-,2,40),$chr(41))) { return Headshot }
- return Normal
- }
- alias sourcercon {
- if ($2 !isnum 1-65536) { echo -ag Invalid parameters. | return }
- .myip | var %ipp = $+($1,:,$2), %sockname = $+($srcon.prefix,%ipp), %rcon = $iif($3,$ifmatch,$readini($gfile(gatherservers.ini),%ipp,cs_rcon))
- if ($sock(%sockname)) { sockclose %sockname | unset %rcon.id. [ $+ [ %sockname ] ] }
- srcon_echo %ipp 12 CS RCON control window. Establishing the connection to server %ipp $+ $chr(44) please wait...!
- sockopen %sockname $1 $2 | sockmark %sockname %rcon
- }
- alias -l log.prefix { return SRcon.log. }
- alias -l srcon.prefix { return SRcon. }
- alias -l srcon.req.execcmd { return 2 }
- alias -l srcon.req.auth { return 3 }
- alias -l srcon.res.cmd { return 0 }
- alias -l srcon.res.auth { return 2 }
- alias -l srcon.inttobytes {
- tokenize 46 $longip($1)
- return $4 $3 $2 $1
- }
- alias -l srcon.getrequest {
- bunset $1
- bset $1 5 $srcon.inttobytes($2)
- bset $1 9 $srcon.inttobytes($3)
- bset -t $1 13 $4-
- bset $1 $calc($bvar($1,0) + 1) 00 00
- bset $1 1 $srcon.inttobytes($calc($bvar($1, 0) - 4))
- }
- alias -l srcon.clear {
- var %ipp = $remove($1,$srcon.prefix,$log.prefix), %srcon = $+($srcon.prefix,%ipp), %log = $+($log.prefix,%ipp)
- if ($sock(%srcon)) {
- if ($gatherinfo(cooldown)) { writeini -n $gfile(gatherservers.ini) %ipp cooldown $calc($ctime +90) }
- if ($gatherinfo(gotv)) { rconsend %ipp tv_stoprecord }
- rconsend %ipp logaddress_delall | .timer -o 1 2 sockclose %srcon | unset %rcon.id. [ $+ [ %srcon ] ]
- }
- if ($sock(%log)) { .timer -o 1 2 sockclose %log }
- }
- alias server.clear {
- var %ipp = $remove($1,$srcon.prefix,$log.prefix), %srcon = $+($srcon.prefix,%ipp), %log = $+($log.prefix,%ipp)
- if ($sock(%srcon)) {
- if ($gatherinfo(cooldown)) { writeini -n $gfile(gatherservers.ini) %ipp cooldown $calc($ctime +90) }
- if ($gatherinfo(gotv)) { rconsend %ipp tv_stoprecord }
- rconsend %ipp logaddress_delall | .timer -o 1 2 sockclose %srcon | unset %rcon.id. [ $+ [ %srcon ] ]
- }
- if ($sock(%log)) { .timer -o 1 2 sockclose %log }
- }
- alias srcon_send {
- var %ipp = $1, %srcon.window = $+(@,%ipp)
- if (!$window(%srcon.window)) { window -aek0x %srcon.window sourcercon.execcmd }
- echo %srcon.window $iif($2 isnum 1-15,$+(,$iif($len($2) > 1,$2,$+(0,$2)))) $+ $time -> $iif($2 isnum 1-15,$3-,$2-)
- }
- alias srcon_echo {
- var %ipp = $1, %srcon.window = $+(@,%ipp)
- if (!$window(%srcon.window)) { window -aek0x %srcon.window sourcercon.execcmd }
- echo %srcon.window $iif($2 isnum 1-15,$+(,$iif($len($2) > 1,$2,$+(0,$2)))) $+ $time * $iif($2 isnum 1-15,$3-,$2-)
- }
- on *:INPUT:@: {
- var %ipp = $remove($target,@), %idd = $serverid(%ipp), %sockname = $+($srcon.prefix,%ipp)
- if (*.*.*:* !iswm %ipp) || (log.* iswm %ipp) { return }
- if (!$sock(%sockname)) { srcon_echo %ipp 04 Error: Socket is dead. $+($chr(40),Cmd: $1-,$chr(41)) | return }
- if ($sock(%sockname).status == active) {
- inc %srcon.id. $+ %sockname
- srcon.getrequest &srcon.cmd %srcon.id. [ $+ [ %sockname ] ] $srcon.req.execcmd $1-
- srcon_send %ipp $1- | sockwrite %sockname &srcon.cmd
- }
- else {
- srcon_echo %ipp 04 Error: Socket is $iif($sock(%srcon.socket).status,$ifmatch,dead) $+ . $+($chr(40),Cmd: $1-,$chr(41))
- }
- }
- on *:SOCKOPEN:$($+($srcon.prefix,*)): {
- var %check = $+($sock($sockname).saddr,:,$sock($sockname).sport), %ipp = $remove($sockname,$srcon.prefix)
- ;;SPECIAL;;
- if ($mainchan == #Gathers.NO) {
- var %checkip = $sock($sockname).saddr, %checkport = $sock($sockname).sport
- var %currentip = $gettok(%ipp,1,58), %currentport = $gettok(%ipp,2,58)
- if (%check != :) && ($gettok(%checkip,1-3,46) != $gettok(%currentip,1-3,46)) && (%checkport != %currentport) {
- echo -s $timestamp 4WARNING(SOCKOPEN): %check isnt the same as %ipp
- if (!%tmp.sockopen) { whatcmd $meorsay $ownerchan $logo 4WARNING: SOCKOPEN $logo IP: %ipp $logo Check: %check $logo | set -z %tmp.sockopen 60 }
- }
- }
- elseif (%check != :) && (%check != %ipp) {
- echo -s $timestamp 4WARNING(SOCKOPEN): %check isnt the same as %ipp
- if (!%tmp.sockopen) { whatcmd $meorsay $ownerchan $logo 4WARNING: SOCKOPEN $logo IP: %ipp $logo Check: %check $logo | set -z %tmp.sockopen 60 }
- }
- if ($sock($sockname).status == active) {
- set %srcon.id. [ $+ [ $sockname ] ] 0
- srcon.getrequest &srcon.auth %srcon.id. [ $+ [ $sockname ] ] $srcon.req.auth $sock($sockname).mark
- sockwrite $sockname &srcon.auth
- srcon_echo %ipp 12 Connection established successfully to server %ipp $+ .
- .timerlogstart. [ $+ [ %ipp ] ] 1 1 rconlogstart %ipp
- }
- else {
- srcon_echo %ipp 04 Error: Socket is dead: Connection timed out. | srcon.clear %ipp
- }
- }
- on *:SOCKREAD:$($+($srcon.prefix, *)): {
- var %check = $+($sock($sockname).saddr,:,$sock($sockname).sport), %ipp = $remove($sockname,$srcon.prefix), %logip = $remove($sockname,$srcon.prefix), %idd = $serverid(%ipp)
- ;;SPECIAL;;
- if ($mainchan == #Gathers.NO) {
- var %checkip = $sock($sockname).saddr, %checkport = $sock($sockname).sport
- var %currentip = $gettok(%ipp,1,58), %currentport = $gettok(%ipp,2,58)
- if (%check != :) && ($gettok(%checkip,1-3,46) != $gettok(%currentip,1-3,46)) && (%checkport != %currentport) {
- echo -s $timestamp 4WARNING(SOCKREAD): %check isnt the same as %ipp
- if (!%tmp.sockopen) { whatcmd $meorsay $ownerchan $logo 4WARNING: SOCKREAD $logo IP: %ipp $logo Check: %check $logo | set -z %tmp.sockopen 60 }
- }
- }
- elseif (%check != :) && (%check != %ipp) {
- echo -s $timestamp 4WARNING(SOCKREAD): %check isnt the same as %ipp
- if (!%tmp.sockread) { whatcmd $meorsay $ownerchan $logo 4WARNING: SOCKREAD $logo IP: %ipp $logo Check: %check $logo | set -z %tmp.sockread 60 }
- }
- if (!$sock($sockname).mark) { srcon_echo %ipp 04 NO SOCK MARK ON $sockname | sockmark $sockname $readini($gfile(gatherservers.ini),%ipp,cs_rcon) }
- if ($sockerr) { srcon_echo %ipp 04 Error: Reading from socket (SockERR): $sock($sockname).wsmsg | return }
- if ($hget($sockname)) {
- var %srcon.pckt.size = $hget($sockname, size)
- var %srcon.pckt.left = $hget($sockname, left)
- var %srcon.pckt.id = $hget($sockname, id)
- var %srcon.pckt.cmd = $hget($sockname, cmd)
- var %noop = $hget($sockname, string1, &srcon.pckt.string1)
- sockread %srcon.pckt.left &srcon.pckt.rest
- dec %srcon.pckt.left $sockbr
- bcopy &srcon.pckt.string1 $calc($bvar(&srcon.pckt.string1, 0) + 1) &srcon.pckt.rest 1 -1
- hfree $sockname
- }
- else {
- sockread 4 &srcon.pckt.size
- var %srcon.pckt.size = $bvar(&srcon.pckt.size, 1).long
- var %srcon.pckt.left = %srcon.pckt.size
- sockread 4 &srcon.pckt.id
- var %srcon.pckt.id = $bvar(&srcon.pckt.id, 1).long
- dec %srcon.pckt.left $sockbr
- if ($srcon.inttobytes(%srcon.pckt.id) == 255 255 255 255) {
- srcon_echo %ipp 04 Error: Failed authentication (probably wrong rcon password).
- .timermixteams 1 2 resetall %ipp | writeini -n $gfile(gatherservers.ini) %ipp error Wrong RCON PW
- if ($gatherinfo(schat)) { schatsend $+(0,$chr(44),%idd,Server) $+($chr(35),%idd,:,$col(end)) Wrong RCON password, the gather is therefor stopped }
- whatcmd $meorsay $mainchan $logo $col(04,Wrong RCON) on server %idd $+ , the gather is therefore stopped $logo
- if ($vtset($1)) { .timer -o 1 1 delete.vt $1 }
- return
- }
- sockread 4 &srcon.pckt.cmd
- var %srcon.pckt.cmd = $bvar(&srcon.pckt.cmd, 1).long
- dec %srcon.pckt.left $sockbr
- sockread %srcon.pckt.left &srcon.pckt.string1
- dec %srcon.pckt.left $sockbr
- }
- if (%srcon.pckt.left > 0) {
- hmake $sockname
- hadd $sockname size %srcon.pckt.size
- hadd $sockname left %srcon.pckt.left
- hadd $sockname id %srcon.pckt.id
- hadd $sockname cmd %srcon.pckt.cmd
- hadd -b $sockname string1 &srcon.pckt.string1
- }
- elseif (%srcon.pckt.left == 0) {
- if (%srcon.pckt.cmd == $srcon.res.auth) {
- if (!$sock($+($log.prefix,%ipp))) && (!%logstart. [ $+ [ %ipp ] ]) { .timerlogstart. [ $+ [ %ipp ] ] 1 1 rconlogstart %ipp }
- }
- elseif (%srcon.pckt.cmd == $srcon.res.cmd) {
- if (!$sock($+($log.prefix,%ipp))) && (!%logstart. [ $+ [ %ipp ] ]) { .timerlogstart. [ $+ [ %ipp ] ] 1 1 rconlogstart %ipp }
- var %i = 1, %next, %last | while (%i <= $bvar(&srcon.pckt.string1,0)) {
- if ($bvar(&srcon.pckt.string1,%i) == $asc($lf)) {
- if (*L * - *: * !iswm %next) { srcon_sockread %ipp %next }
- var %next, %last
- }
- else { var %next = $+(%next,$iif(%last == 32,$chr(32)),$bvar(&srcon.pckt.string1,%i).text), %last = $bvar(&srcon.pckt.string1,%i) }
- inc %i
- }
- if (%next) { srcon_sockread %ipp %next }
- return
- var %bytes = $bvar(&srcon.pckt.string1, 0), %bytes.max = 300, %bytes.x = 1, %bytes.now = %bytes.max, %bvar.chr = $asc($lf), %bvar.text
- while (%bytes.x <= %bytes) {
- var %bvar.text = $+(%bvar.text,$bvar(&srcon.pckt.string1, %bytes.x, %bytes.now).text), %bytes.x = $calc(%bytes.now +1), %bytes.send
- while ($numtok(%bvar.text,%bvar.chr) > 1) {
- var %bytes.send = 1, %temp = $gettok(%bvar.text,1,%bvar.chr), %bvar.text = $gettok(%bvar.text,2-,%bvar.chr) | srcon_sockread %ipp %temp
- }
- if (%bytes.send) { var %bytes.now = $calc(%bytes.now + %bytes.max) } | else { var %bytes.now = $calc(%bytes.now + (%bytes.max / 5)) }
- }
- var %i = 1 | while ($gettok(%bvar.text,%i,%bvar.chr)) { var %temp = $ifmatch | srcon_sockread %ipp %temp | inc %i }
- }
- }
- }
- on *:UDPREAD:$($+($log.prefix, *)):{
- :nextread
- if (!$sock($sockname)) { return }
- var %check = $+($sock($sockname).saddr,:,$sock($sockname).sport), %ipp = $remove($sockname,$log.prefix), %temp. [ $+ [ %ipp ] ]
- if ($sockerr) { srcon_echo %ipp 04 Error: Reading from socket (SockERR): $sock($sockname).wsmsg | return }
- sockread -f %temp. [ $+ [ %ipp ] ]
- %temp. [ $+ [ %ipp ] ] = $gettok(%temp. [ $+ [ %ipp ] ],5-,32)
- if ($sockbr == 0) { return }
- ;;SPECIAL;;
- if ($mainchan == #Gathers.NO) {
- var %checkip = $sock($sockname).saddr, %checkport = $sock($sockname).sport
- var %currentip = $gettok(%ipp,1,58), %currentport = $gettok(%ipp,2,58)
- if (%check != :) && ($gettok(%checkip,1-3,46) != $gettok(%currentip,1-3,46)) && (%checkport != %currentport) {
- echo -s $timestamp 4WARNING(UDPREAD): %check isnt the same as %ipp
- if (!%tmp.sockopen) { whatcmd $meorsay $ownerchan $logo 4WARNING: SOCKREAD $logo IP: %ipp $logo Check: %check $logo | set -z %tmp.sockopen 60 }
- }
- }
- elseif (%check != :) && (%check != %ipp) {
- echo -s $timestamp 4WARNING(UDPREAD): %check isnt the same as %ipp // %temp. [ $+ [ %ipp ] ]
- if (!%tmp.udpread) { whatcmd $meorsay $ownerchan $logo 4WARNING: UDPREAD $logo IP: %ipp $logo Check: %check $logo %temp. [ $+ [ %ipp ] ] $logo | set -z %tmp.udpread 60 }
- goto nextread
- }
- if (%temp. [ $+ [ %ipp ] ]) { .timerlogcheck. [ $+ [ %ipp ] ] 1 20 logcheck %ipp | srcon_sockread %ipp %temp. [ $+ [ %ipp ] ] }
- goto nextread
- }
- alias srcon_sockread {
- var %ipp = $1, %logip = %ipp, %idd = $serverid(%ipp), %temp. [ $+ [ %ipp ] ] $replace($2-,$chr(124),>|<)
- if (%temp. [ $+ [ %ipp ] ]) {
- tokenize 32 %temp. [ $+ [ %ipp ] ] | srcon_echo %ipp $1-
- if ($readini($gfile(gatherservers.ini),%ipp,status) == Ended) { return }
- if ($serverinuse(%ipp)) { logit2 %ipp $1- }
- .timerkeepalive. [ $+ [ %ipp ] ] 5 5 keepalive %ipp
- if (!$timer(%ipp)) { .timer $+ %ipp 0 400 rconadv %ipp }
- if ($readini($gfile(gatherservers.ini),%ipp,stopped)) { remini -n $gfile(gatherservers.ini) %ipp stopped }
- if (%retry. [ $+ [ %ipp ] ]) {
- unset %retry. [ $+ [ %ipp ] ]
- if ($gatherinfo(schat)) { schatsend $+(0,$chr(44),%idd,Server) $+($chr(35),%idd,:,$col(end)) Connection made }
- }
- var %gamestats = $gamestatsini(%ipp), %gatherstatus = $gatherstatus(%ipp)
- if (say isin $gettok(%temp. [ $+ [ %ipp ] ],2,34)) || (say_team isin $gettok(%temp. [ $+ [ %ipp ] ],2,34)) && (*.*:* !iswm $gettok($gettok(%temp. [ $+ [ %ipp ] ],3,34),7,32)) {
- tokenize 32 $gettok(%temp. [ $+ [ %ipp ] ],3,34)
- var %steamid = $getsteamid(%temp. [ $+ [ %ipp ] ]), %name = $getname(%temp. [ $+ [ %ipp ] ]), %userid = $getuserid(%temp. [ $+ [ %ipp ] ]), %team = $iif($getteam(%temp. [ $+ [ %ipp ] ]),$ifmatch,SPECTATOR)
- var %cmd = $cmd_ingame($1), %admin = $admin($+($chr(35),$gauth(%steamid))), %saytype = $gettok(%temp. [ $+ [ %ipp ] ],2,34)
- if (!%steamid) && (!%name) && (!%userid) { var %say = $gettok(%temp. [ $+ [ %ipp ] ],3,34)
- if (%say) {
- if ($gatherinfo(schat)) { schatsend $+(0,$chr(44),%idd,Server) $+($chr(35),%idd say:,$col(end)) %say }
- if (%gatherstatus != Free) { logit %ipp Server say: %say }
- if (%say == .swapteams) { set -u3 %swapteams. [ $+ [ %ipp ] ] 1 | swapteams2 %ipp }
- elseif (%say == .start) { set -u3 %spt. [ $+ [ %ipp ] ] 1 | start %ipp }
- elseif (%say == .teams) { set -u5 %teams. [ $+ [ %ipp ] ] 1 | queryteams %ipp }
- }
- return
- }
- logit %ipp %name ( $+ $gauth(%steamid) $+ ) $+(%saytype,:) $1-
- if (%team == Terrorists) { var %team = TERRORIST }
- if (%team == Counter-Terrorists) { var %team = CT }
- if ($gatherinfo(schat)) { schatsend $+(0,$chr(44),%idd,Server) $+($chr(35),%idd,:,$col(end)) $anick(%steamid) $+(%saytype,:) $1- }
- if (%cmd != 0) {
- if (%cmd == reg) || (%cmd == auth) {
- if (!$findsid(%steamid)) && ($2) && ($tempplayers(%ipp)) {
- if ($temppw(%ipp,$2)) { var %xid = $ifmatch
- if ($gsteamid(%steamid)) {
- if ($read($gfile(gatherusers.dat),w,* %steamid)) { var %dauth = $gettok($ifmatch,1,32) | write -ds $+ %dauth $gfile(gatherusers.dat) }
- if ($read($gfile(authed.dat),w,* %steamid)) { var %dauth = $gettok($ifmatch,2,32) | write -ds $+ %dauth $gfile(authed.dat) }
- }
- if ($newsteamid(%xid,%steamid)) {
- writeini -n $gfile(userdata.ini) %steamid reg $date $time | remini -n $gfile(tempreg.ini) %ipp %xid
- writeini -n $gfile(joined.ini) %ipp %steamid %team | rconsend %ipp say %name succesfully authenticated
- var %addr = $readini($gfile(userdata.ini),%steamid,ipaddress)
- if ($readini($gfile(gatherbans.ini),%steamid,tid)) { rconsend %ipp kick $+($chr(35),%userid) Gather Banned!
- if ($readini($gfile(players.ini),%ipp,%steamid)) { remini -n $gfile(players.ini) %ipp %steamid
- if ($readini($gfile(counter.ini),%ipp,%steamid)) { remini -n $gfile(counter.ini) %ipp %steamid | var %team = ct } | if ($readini($gfile(terrorist.ini),%ipp,%steamid)) { remini -n $gfile(terrorist.ini) %ipp %steamid | var %team = t }
- whatcmd $meorsay $mainchan $logo $anick(%steamid) is banned on steamid before authentication, use .isbanned for more info $split Gatheradmin: $anick($gatherstatus(%ipp,admin)) $logo
- if (%team) { if (!$sameteam($score(%ipp,total))) { fastsub %ipp $iif(%team == ct,t,ct) 1 } | else { fastsub %ipp %team 1 } }
- }
- }
- elseif ($ipbanned(%addr)) { var %id = $ifmatch, %team = $null, %tid = $readini($gfile(gatherbans.ini),%id,tid)
- if (%id != %steamid) { rconsend %ipp kick $+($chr(35),%userid) IP Banned!
- if ($readini($gfile(players.ini),%ipp,%steamid)) { remini -n $gfile(players.ini) %ipp %steamid
- if ($readini($gfile(counter.ini),%ipp,%steamid)) { remini -n $gfile(counter.ini) %ipp %steamid | var %team = ct } | if ($readini($gfile(terrorist.ini),%ipp,%steamid)) { remini -n $gfile(terrorist.ini) %ipp %steamid | var %team = t }
- writeini -n $gfile(gatherbans.ini) %steamid admin :gatherbot: | writeini -n $gfile(gatherbans.ini) %steamid tid %tid | writeini -n $gfile(gatherbans.ini) %steamid type IP Ban
- writeini -n $gfile(gatherbans.ini) %steamid grund IP banned on another user [Steamid: %id $+ $chr(93) | writeini -n $gfile(gatherbans.ini) %steamid date $ctime
- if ($gatherinfo(php.exe)) { writeini -n $gfile($php.ini) bans %steamid %steamid | .timerphp.exe -o 1 0 run $+(",$php.exe,") -f $+(",$mircdir,$gfile($php.file),") }
- if ($gatherinfo(mysql.exe)) { writeini -n $gfile(upload.ini) bans steamid %steamid | .timer -o 1 0 run -p $+(",$mircdir,$gdir,MySQL.exe,") }
- whatcmd $meorsay $mainchan $logo $anick(%steamid) got auto banned, since he is IP banned [Steamid: %id $+ $chr(93) $split Gatheradmin: $anick($gatherstatus(%ipp,admin)) $logo
- if (%team) { if (!$sameteam($score(%ipp,total))) { fastsub %ipp $iif(%team == ct,t,ct) 1 } | else { fastsub %ipp %team 1 } }
- gatherbans
- }
- }
- }
- }
- else { rconsend %ipp say Error! Report to $contact $logo }
- }
- }
- }
- elseif (%cmd == admin) && ($2 != $null) {
- noticechan $privchan $logo Server $+($chr(35),$serverid(%ipp),:) %name $col(14,$chr(40)) $+ $anick(%steamid) $+ $col(14,$chr(41)) needs an admin $logo Reason: $+(,$2-,) $logo
- rconsend %ipp say Message got sent to admins
- }
- elseif (%cmd == score) || (%cmd == status) && (!%wscore. [ $+ [ %ipp ] ]) { set -u5 %wscore. [ $+ [ %ipp ] ] 1 | rconsend %ipp say $+($chr(91),%gatherstatus,$chr(93)) CounterTerrorist: $score(%ipp,ct) - Terrorist: $score(%ipp,t) }
- elseif (%cmd == time) || (%cmd == thetime) { rconsend %ipp say Date&Time: $asctime($ctime) }
- elseif (%cmd == teams) && (!%teams. [ $+ [ %ipp ] ]) { set -u5 %teams. [ $+ [ %ipp ] ] 1 | queryteams %ipp }
- elseif (%cmd == check) || (%cmd == checkjoin) || (%cmd == tjek) || (%cmd == tjekjoin) && (!%missing. [ $+ [ %ipp ] ]) { set -u5 %missing. [ $+ [ %ipp ] ] 1 | missing %ipp }
- elseif (%cmd == ready) || (%cmd == klar) || (%cmd == go) || (%cmd == rdy) {
- if (%gatherstatus != Started) && (%gatherstatus != Round_End) && (!$readini($gfile(ready.ini),%ipp,%steamid)) && (($score(%ipp,total) == 0) || ($score(%ipp,total) == 15) || ($score(%ipp,total) == $mr3.half($score(%ipp,total)))) {
- if (!$sameteam($score(%ipp,total))) { var %ct = $gfile(terrorist.ini), %t = $gfile(counter.ini) } | else { var %ct = $gfile(counter.ini), %t = $gfile(terrorist.ini) }
- var %ini = $iif(%team == CT,%ct,%t)
- if (%team == Spectator) || (!$readini(%ini,%ipp,%steamid)) {
- rconsend %ipp say $gnick(%steamid) $+ , u must be on team $iif(%team == CT,Terrorist!,CounterTerrorist!)
- return
- }
- writeini -n $gfile(ready.ini) %ipp %steamid %steamid | if ($ini($gfile(ready.ini),%ipp,0) >= $ini($gfile(players.ini),%ipp,0)) { start %ipp }
- else { rconsend %ipp say $gnick(%steamid) is ready to start ( $+ $+($ini($gfile(ready.ini),%ipp,0),$chr(47),$ini($gfile(players.ini),%ipp,0)) $+ ) }
- }
- }
- elseif (%cmd == unready) || (%cmd == unrdy) || (%cmd == notready) || (%cmd == notrdy) {
- if (%gatherstatus != Started) && (%gatherstatus != Round_End) && ($readini($gfile(ready.ini),%ipp,%steamid)) {
- remini -n $gfile(ready.ini) %ipp %steamid | rconsend %ipp say $gnick(%steamid) is NOT ready to start ( $+ $+($ini($gfile(ready.ini),%ipp,0),$chr(47),$ini($gfile(players.ini),%ipp,0)) $+ )
- }
- }
- elseif (readylist* iswm %cmd) || (rdylist* iswm %cmd) || (%cmd == checkrdy) || (%cmd == checkready) {
- if (%gatherstatus != Started) && (%gatherstatus != Round_End) && (!%ready. [ $+ [ %ipp ] ]) {
- set -u5 %ready. $+ %ipp 1 | var %i = 1, %x = 1, %m = $null
- rconsend %ipp say Players still not ready to go: | while (%i <= $ini($gfile(players.ini),%ipp,0)) {
- var %s = $ini($gfile(players.ini),%ipp,%i) | if (!$readini($gfile(ready.ini),%ipp,%s)) { var %m = $iif(%m,$+(%m,$chr(44))) $gnick(%s) | if ($len(%m) >= 18) { .timer -o 1 %x rconsend %ipp say %m | var %m = $null | inc %x } } | inc %i
- }
- if (%m) { .timer -o 1 %x rconsend %ipp say %m } | .timer -o 1 %x rconsend %ipp say Use: .ready -/- .unready
- }
- }
- elseif (%cmd == whois) && ($2 != $null) && ($2 != 0) { set %whois. [ $+ [ %ipp ] ] $2- | rconsend %ipp status }
- elseif (%steamid == $gatherstatus(%ipp,admin)) || (%admin >= 8) {
- if (%cmd == rs) || (%cmd == restart) { rconsend %ipp mp_restartgame 1 }
- elseif (%cmd == swapteams) && (!%swapteams. [ $+ [ %ipp ] ]) { set -u3 %swapteams. [ $+ [ %ipp ] ] 1 | swapteams2 %ipp }
- elseif (%cmd == seeksub) && (!%needsub. [ $+ [ %ipp ] ]) { set -u5 %needsub. [ $+ [ %ipp ] ] 1 | seeksub %ipp }
- elseif (%cmd == needsub) && (!%needsub. [ $+ [ %ipp ] ]) && (%admin >= 8) { set -u5 %needsub. [ $+ [ %ipp ] ] 1 | needsub %ipp }
- elseif (%cmd == fastsub) || (%cmd == addsub) || (%cmd == forcesub) && (!%needsub. [ $+ [ %ipp ] ]) && ($gauth(%steamid) == $remove($scripter,$chr(35))) {
- if ($3 isnum) {
- if ($2 == ct) || ($2 == counter) || ($2 == counterterrorist) { set -u5 %needsub. [ $+ [ %ipp ] ] 1 | fastsub %ipp ct $iif($3 >= 1,$round($3,0),1) }
- elseif ($2 == t) || ($2 == terrorist) { set -u5 %needsub. [ $+ [ %ipp ] ] 1 | fastsub %ipp t $iif($3 >= 1,$round($3,0),1) }
- else { rconsend %ipp say Error. Use: .fastsub "team" $iif($3 >= 1,$round($3,0),"antalsubs") }
- }
- else { rconsend %ipp say Error. Use: .fastsub "team" "antalsubs" }
- }
- elseif ((%cmd == endsub) || (%cmd == subend)) && (%admin >= 8) { .endsub %ipp $gauth(%steamid) }
- elseif (%cmd == setmap) || (%cmd == changemap) || (%cmd == changelevel) {
- if ($findmap($2)) {
- var %map = $ifmatch | writeini -n $gfile(gatherstatus.ini) %ipp map %map
- if ($workshop(%ipp,%map)) { var %x = $remove($ifmatch,workshop/) | rconsend %ipp host_workshop_map %x } | else { rconsend %ipp changelevel %map }
- }
- else { rconsend %ipp say $2 is not a valid map }
- }
- elseif (%cmd == freeze) || (%cmd == freezetime) && ($2 isnum) { rconsend %ipp mp_freezetime $2 }
- elseif (%cmd == pregame) || (%cmd == pre) && (!%spt. [ $+ [ %ipp ] ]) { set -u2 %spt. [ $+ [ %ipp ] ] 1 | pregame %ipp }
- elseif (%cmd == tacs) && (!%spt. [ $+ [ %ipp ] ]) { set -u2 %spt. [ $+ [ %ipp ] ] 1 | tacs %ipp }
- elseif (%cmd == start) && (!%spt. [ $+ [ %ipp ] ]) { set -u3 %spt. [ $+ [ %ipp ] ] 1 | start %ipp }
- elseif (%cmd == adminstop) && (!%gatherstopped. [ $+ [ %ipp ] ]) && (%admin >= 8) { set -u10 %gatherstopped. [ $+ [ %ipp ] ] %steamid | .stop %ipp }
- elseif (%cmd == setscore) || (%cmd == updatescore) || (%cmd == newscore) { setscore %ipp $2- }
- elseif (%cmd == say) && ($2 != $null) { rconsend %ipp say $gnick(%steamid) $+ : $2- }
- elseif (%cmd == kick) && ($2 != $null) && (%admin >= 8) { set %kick. [ $+ [ %ipp ] ] %steamid $2- | rconsend %ipp status }
- elseif (%cmd == rcon) && ($2 != $null) && (%admin >= 8) { rconsend %ipp $2- | rconsend %ipp say Rcon: $2- }
- elseif (%cmd == pause) { rconsend %ipp mp_pause_match }
- elseif (%cmd == unpause) { rconsend %ipp mp_unpause_match }
- }
- }
- return
- }
- if (rcon from "*": command "*" iswm %temp. [ $+ [ %ipp ] ]) {
- var %cmd = $gettok(%temp. [ $+ [ %ipp ] ],4,34)
- if (%cmd == .swapteams) { set -u3 %swapteams. [ $+ [ %ipp ] ] 1 | swapteams2 %ipp }
- elseif (%cmd == .start) { set -u3 %spt. [ $+ [ %ipp ] ] 1 | start %ipp }
- return
- }
- if ($gatherinfo(game) != CS:Promod) {
- if (*Loading map "*"* iswm %temp. [ $+ [ %ipp ] ]) {
- .timerrecheck. [ $+ [ $1 ] ] 1 5 rechecksocket %ipp
- var %map = $gettok(%temp. [ $+ [ %ipp ] ],2,34), %true = $readini($gfile(gatherstatus.ini),%ipp,map)
- var %n = $numtok(%map,47), %map = $gettok(%map,%n,47), %n = $numtok(%map,92), %map = $gettok(%map,%n,92)
- if (%true) && (%map != %true) {
- if ($workshop(%ipp,%true)) { var %x = $remove($ifmatch,workshop/) | .timerchange. [ $+ [ %ipp ] ] 1 8 rconsend %ipp host_workshop_map %x }
- else { .timerchange. [ $+ [ %ipp ] ] 1 8 rconsend %ipp changelevel %true }
- }
- elseif (%gatherstatus != Started) && (%gatherstatus != Round_End) { set -z %pregame. [ $+ [ %ipp ] ] 60 }
- return
- }
- if (*Started map "*"* iswm %temp. [ $+ [ %ipp ] ]) {
- .timerrecheck. [ $+ [ $1 ] ] 1 3 rechecksocket %ipp
- var %map = $gettok(%temp. [ $+ [ %ipp ] ],2,34), %true = $readini($gfile(gatherstatus.ini),%ipp,map)
- var %n = $numtok(%map,47), %map = $gettok(%map,%n,47), %n = $numtok(%map,92), %map = $gettok(%map,%n,92)
- if (%true) && (%map != %true) {
- if ($workshop(%ipp,%true)) { var %x = $remove($ifmatch,workshop/) | .timerchange. [ $+ [ %ipp ] ] 1 5 rconsend %ipp host_workshop_map %x }
- else { .timerchange. [ $+ [ %ipp ] ] 1 5 rconsend %ipp changelevel %true }
- }
- elseif (%gatherstatus != Started) && (%gatherstatus != Round_End) { set -z %pregame. [ $+ [ %ipp ] ] 60 }
- return
- }
- }
- if (not currently logging == %temp. [ $+ [ %ipp ] ]) { rconsend %ipp log on | return }
- if (Log file closed isin %temp. [ $+ [ %ipp ] ]) { .timerlog. [ $+ [ %ipp ] ] 1 1 rconsend %ipp log on | return }
- if (Log file started isin %temp. [ $+ [ %ipp ] ]) && ($timer(log. [ $+ [ %ipp ] ])) { .timerlog. [ $+ [ %ipp ] ] off | return }
- if (*logaddress_list: no addresses in the list* iswm $1-) { rconlogstart2 %ipp | return }
- if (%logstart. [ $+ [ %ipp ] ]) {
- if (*logaddress_list: * entry* iswm $1-) { set -u10 %logadr. [ $+ [ %ipp ] ] 1 | return }
- if (*?:?* iswm $1) && (%logadr. [ $+ [ %ipp ] ]) && (!$2) { rconsend %ipp logaddress_del $1 | .timer -o 1 1 rconlogstart2 %ipp }
- }
- if ("*" = "*" iswm %temp. [ $+ [ %ipp ] ]) {
- var %cvar = $gettok(%temp. [ $+ [ %ipp ] ],1,34), %value = $gettok(%temp. [ $+ [ %ipp ] ],3,34), %r = $iif(%cvar == mp_logfile || %cvar == mp_logecho,1,3)
- if ($istok(mp_logmessages mp_logdetail mp_logfile mp_logecho,%cvar,32)) && (%value != %r) { rconsend %ipp %cvar %r | return }
- }
- if (server_cvar: "*" "*" iswm %temp. [ $+ [ %ipp ] ]) {
- var %cvar = $gettok(%temp. [ $+ [ %ipp ] ],2,34), %value = $gettok(%temp. [ $+ [ %ipp ] ],4,34), %r = $iif(%cvar == mp_logfile || %cvar == mp_logecho,1,3)
- if ($istok(mp_logmessages mp_logdetail mp_logfile mp_logecho,%cvar,32)) && (%value != %r) { rconsend %ipp %cvar %r }
- return
- }
- if ($gatherinfo(game) != CS:Promod) {
- if (*Team "*" triggered "*"* iswm %temp. [ $+ [ %ipp ] ]) {
- if (%gatherstatus == Started) {
- var %team = $gettok(%temp. [ $+ [ %ipp ] ],2,34), %ct = $gettok(%temp. [ $+ [ %ipp ] ],6,34), %t = $gettok(%temp. [ $+ [ %ipp ] ],8,34)
- if (%team == Terrorists) { var %team = TERRORIST }
- if (%team == Counter-Terrorists) { var %team = CT }
- if (%team == CT) { team_ct_won %ipp %ct %t } | else { team_t_won %ipp %t %ct }
- }
- return
- }
- if ("*" triggered "Defused_The_Bomb" iswm %temp. [ $+ [ %ipp ] ]) {
- if (%gatherstatus == Started) {
- .timerbombdefused. [ $+ [ %ipp ] ] -o 1 2 team_ct_won %ipp
- }
- return
- }
- }
- if ($gatherinfo(game) != CS:Promod) {
- if (World triggered isin $gettok(%temp. [ $+ [ %ipp ] ],1,34)) { var %ini = $assini(%ipp), %killsini = $killsini(%ipp)
- if ($gatherinfo(schat)) { schatsend $+(0,$chr(44),%idd,Server) $+($chr(35),%idd,:,$col(end)) %temp. [ $+ [ %ipp ] ] }
- if (Round_Start isin $gettok(%temp. [ $+ [ %ipp ] ],2,34)) {
- if ($ini(%ini,0)) { write -c %ini } | if ($ini(%killsini,0)) { write -c %killsini } | unset %gatherhold. [ $+ [ %ipp ] ] | unset %roundend. [ $+ [ %ipp ] ] | unset %lastkill. [ $+ [ %ipp ] ] | unset %firstkill. [ $+ [ %ipp ] ] | unset %teamwon. [ $+ [ %ipp ] ] | remini -n $gfile(kills.ini) %ipp | remini -n $gfile(lastkill.ini) %ipp
- if ($gatherinfo(amx)) && ($gatherstatus(%ipp) != Ended) && ($ini($gfile(joined.ini),%ipp,0) >= 1) && (!%forceteams. [ $+ [ %ipp ] ]) { var %status = ok | set -u10 %forceteams. [ $+ [ %ipp ] ] 1 }
- if (!%check. [ $+ [ %ipp ] ]) { var %status = ok | set -u10 %check. [ $+ [ %ipp ] ] 1 }
- if (%status == ok) { rconsend %ipp status }
- }
- elseif (Round_End isin $gettok(%temp. [ $+ [ %ipp ] ],2,34)) && (%gatherstatus == Started) {
- if (%roundend. [ $+ [ %ipp ] ]) { set -u7 %gatherhold. [ $+ [ %ipp ] ] 1 }
- if (!%roundend. [ $+ [ %ipp ] ]) { return
- var %team = $iif(%lastkill. [ $+ [ %ipp ] ],$ifmatch,TERRORIST)
- if (%team == Terrorists) { var %team = TERRORIST }
- if (%team == Counter-Terrorists) { var %team = CT }
- set -u5 %teamwon. [ $+ [ %ipp ] ] %team | if (%team == TERRORIST) { team_t_won %ipp } | else { team_ct_won %ipp }
- }
- }
- return
- }
- }
- if ($gatherinfo(game) == CS:Promod) {
- if (round_end == $gettok(%temp. [ $+ [ %ipp ] ],1,34)) {
- if ($gatherinfo(schat)) { schatsend $+(0,$chr(44),%idd,Server) $+($chr(35),%idd,:,$col(end)) Round_End $gettok(%temp. [ $+ [ %ipp ] ],2-,34) }
- if (%gatherstatus == Started) {
- set -u7 %gatherhold. [ $+ [ %ipp ] ] 1
- if (!%roundend. [ $+ [ %ipp ] ]) {
- var %winner = $gettok(%temp. [ $+ [ %ipp ] ],3,34), %team = $iif(%winner == 3,CT,TERRORIST)
- if (%winner == 2) || (%winner == 3) {
- set -u5 %teamwon. [ $+ [ %ipp ] ] %team | if (%team == TERRORIST) { team_t_won %ipp } | else { team_ct_won %ipp }
- }
- }
- }
- return
- }
- if (round_start == $gettok(%temp. [ $+ [ %ipp ] ],1,34)) {
- if ($gatherinfo(schat)) { schatsend $+(0,$chr(44),%idd,Server) $+($chr(35),%idd,:,$col(end)) Round_Start }
- var %ini = $assini(%ipp), %killsini = $killsini(%ipp)
- if ($ini(%ini,0)) { write -c %ini } | if ($ini(%killsini,0)) { write -c %killsini } | unset %gatherhold. [ $+ [ %ipp ] ] | unset %roundend. [ $+ [ %ipp ] ] | unset %lastkill. [ $+ [ %ipp ] ] | unset %firstkill. [ $+ [ %ipp ] ] | unset %teamwon. [ $+ [ %ipp ] ] | remini -n $gfile(kills.ini) %ipp | remini -n $gfile(lastkill.ini) %ipp
- if ($gatherinfo(amx)) && ($gatherstatus(%ipp) != Ended) && ($ini($gfile(joined.ini),%ipp,0) >= 1) && (!%forceteams. [ $+ [ %ipp ] ]) { var %status = ok | set -u10 %forceteams. [ $+ [ %ipp ] ] 1 }
- if (!%check. [ $+ [ %ipp ] ]) { var %status = ok | set -u10 %check. [ $+ [ %ipp ] ] 1 }
- if (%status == ok) { rconsend %ipp status }
- return
- }
- if (round_freeze_end == $gettok(%temp. [ $+ [ %ipp ] ],1,34)) {
- if ($gatherinfo(schat)) { schatsend $+(0,$chr(44),%idd,Server) $+($chr(35),%idd,:,$col(end)) Round_Freeze_End }
- var %ini = $assini(%ipp), %killsini = $killsini(%ipp)
- if ($ini(%ini,0)) { write -c %ini } | if ($ini(%killsini,0)) { write -c %killsini } | unset %gatherhold. [ $+ [ %ipp ] ] | unset %roundend. [ $+ [ %ipp ] ] | unset %lastkill. [ $+ [ %ipp ] ] | unset %firstkill. [ $+ [ %ipp ] ] | unset %teamwon. [ $+ [ %ipp ] ] | remini -n $gfile(kills.ini) %ipp | remini -n $gfile(lastkill.ini) %ipp
- return
- }
- }
- if (Planted_The_Bomb isin $gettok(%temp. [ $+ [ %ipp ] ],3,34)) && (%gatherstatus == Started) {
- var %steamid = $getsteamid(%temp. [ $+ [ %ipp ] ]), %team = $getteam(%temp. [ $+ [ %ipp ] ]), %nick = $getname(%temp. [ $+ [ %ipp ] ])
- if ($readini($gfile(players.ini),%ipp,%steamid)) {
- if (%team == Terrorists) { var %team = TERRORIST }
- if (%team == Counter-Terrorists) { var %team = CT }
- writeini -n $gfile(joined.ini) %ipp %steamid %team
- writeini -n %gamestats %steamid Plants $calc($readini(%gamestats,%steamid,Plants) +1)
- writeini -n %gamestats %steamid Points $calc($readini(%gamestats,%steamid,Points) +0.4)
- ;;SPECIAL;;
- if ($network == GameSurge) {
- rconsend %ipp say %nick $+($chr(40),$gnick(%steamid),$chr(41)) planted the bomb
- if ($me ison $mainchan) { whatcmd $meorsay $mainchan $logo $anick(%steamid) $+($chr(40),%nick,$chr(41)) planted the bomb on server $+($chr(35),%idd) $logo }
- }
- }
- return
- }
- if (Defused_The_Bomb isin $gettok(%temp. [ $+ [ %ipp ] ],3,34)) && (%gatherstatus == Started) {
- var %steamid = $getsteamid(%temp. [ $+ [ %ipp ] ]), %team = $getteam(%temp. [ $+ [ %ipp ] ]), %nick = $getname(%temp. [ $+ [ %ipp ] ])
- if ($readini($gfile(players.ini),%ipp,%steamid)) {
- if (%team == Terrorists) { var %team = TERRORIST }
- if (%team == Counter-Terrorists) { var %team = CT }
- writeini -n $gfile(joined.ini) %ipp %steamid %team
- writeini -n %gamestats %steamid Defs $calc($readini(%gamestats,%steamid,Defs) +1)
- writeini -n %gamestats %steamid Points $calc($readini(%gamestats,%steamid,Points) +0.4)
- ;;SPECIAL;;
- if ($network == GameSurge) {
- rconsend %ipp say %nick $+($chr(40),$gnick(%steamid),$chr(41)) defused the bomb
- if ($me ison $mainchan) { whatcmd $meorsay $mainchan $logo $anick(%steamid) $+($chr(40),%nick,$chr(41)) defused the bomb on server $+($chr(35),%idd) $logo }
- }
- }
- return
- }
- if (threw isin $gettok(%temp. [ $+ [ %ipp ] ],2,34)) {
- var %steamid = $getsteamid(%temp. [ $+ [ %ipp ] ]), %team = $getteam(%temp. [ $+ [ %ipp ] ]), %nade = $gettok($gettok(%temp. [ $+ [ %ipp ] ],2,34),2,32)
- if ($readini($gfile(players.ini),%ipp,%steamid)) && (%gatherstatus == Started) {
- if (!$istok(flashbang hegrenade smokegrenade decoy,%nade,32)) { return }
- if (%team == Terrorists) { var %team = TERRORIST }
- if (%team == Counter-Terrorists) { var %team = CT }
- writeini -n $gfile(joined.ini) %ipp %steamid %team
- ;writeini -n %gamestats %steamid %nade $calc($readini(%gamestats,%steamid,%nade) +1)
- }
- return
- }
- if (*killed* iswm $gettok(%temp. [ $+ [ %ipp ] ],2,34)) {
- var %ini = $assini(%ipp), %killsini = $killsini(%ipp), %steamid = $getsteamid(%temp. [ $+ [ %ipp ] ]), %team = $getteam(%temp. [ $+ [ %ipp ] ]), %nick = $getname(%temp. [ $+ [ %ipp ] ]), %userid = $getuserid(%temp. [ $+ [ %ipp ] ])
- var %asteamid = $getsteamid(3,%temp. [ $+ [ %ipp ] ]), %ateam = $getteam(3,%temp. [ $+ [ %ipp ] ]), %anick = $getname(3,%temp. [ $+ [ %ipp ] ]), %weapon = $strip($gettok($gettok(%temp. [ $+ [ %ipp ] ],5,34),1,95)), %kill = $getkill(%temp. [ $+ [ %ipp ] ])
- if ($readini($gfile(players.ini),%ipp,%steamid)) && ($readini($gfile(players.ini),%ipp,%asteamid)) {
- if (%team == Terrorists) { var %team = TERRORIST }
- if (%team == Counter-Terrorists) { var %team = CT }
- if (%ateam == Terrorists) { var %ateam = TERRORIST }
- if (%ateam == Counter-Terrorists) { var %ateam = CT }
- writeini -n $gfile(joined.ini) %ipp %steamid %team | writeini -n $gfile(joined.ini) %ipp %asteamid %ateam
- if (%gatherstatus == Started) { set -u5 %lastkill. [ $+ [ %ipp ] ] %team
- ;;SPECIAL;;
- if ($network == GameSurge) {
- rconsend %ipp say %nick $+($chr(40),$gnick(%steamid),$chr(41)) killed %anick $+($chr(40),$gnick(%asteamid),$chr(41)) with %weapon
- if ($me ison $mainchan) { whatcmd $meorsay $mainchan $logo $anick(%steamid) $+($chr(40),%nick,$chr(41)) killed $anick(%asteamid) $+($chr(40),%anick,$chr(41)) with %weapon on server $+($chr(35),%idd) $logo }
- }
- if (%team != %ateam) { var %points = $killpoints(%steamid,%asteamid)
- if (!%firstkill. [ $+ [ %ipp ] ]) {
- set -u300 %firstkill. [ $+ [ %ipp ] ] %steamid | writeini -n %gamestats %steamid Entrykills $calc($readini(%gamestats,%steamid,Entrykills) +1)
- }
- writeini -n %gamestats %steamid Points $calc($readini(%gamestats,%steamid,Points) + %points)
- writeini -n %gamestats %asteamid Points $calc($readini(%gamestats,%asteamid,Points) - %points)
- writeini -n %gamestats %steamid Kills $calc($readini(%gamestats,%steamid,Kills) +1)
- writeini -n %gamestats %steamid %weapon $calc($readini(%gamestats,%steamid,%weapon) +1)
- writeini -n %gamestats %asteamid Deaths $calc($readini(%gamestats,%asteamid,Deaths) +1)
- if (%kill == Headshot) { writeini -n %gamestats %steamid Headshots $calc($readini(%gamestats,%steamid,Headshots) +1) }
- writeini -n $gfile(kills.ini) %ipp %steamid $calc($readini($gfile(kills.ini),%ipp,%steamid) +1)
- if ($checkclutch(%ipp,%team)) { var %clutch = $+(clutch,%steamid) | writeini -n $gfile(kills.ini) %ipp %clutch $calc($readini($gfile(kills.ini),%ipp,%clutch) +1) | writeini -n $gfile(lastkill.ini) %ipp %steamid %asteamid }
- }
- else {
- writeini -n %gamestats %steamid Points $calc($readini(%gamestats,%steamid,Points) -1)
- writeini -n %gamestats %asteamid Points $calc($readini(%gamestats,%asteamid,Points) -0.5)
- writeini -n %gamestats %steamid Teamkills $calc($readini(%gamestats,%steamid,Teamkills) +1)
- writeini -n %gamestats %steamid %weapon $calc($readini(%gamestats,%steamid,%weapon) +1)
- writeini -n %gamestats %asteamid Deaths $calc($readini(%gamestats,%asteamid,Deaths) +1)
- logit %ipp TEAMKILL: %nick ( $+ $gauth(%steamid) $+ ) -TK- %anick ( $+ $gauth(%asteamid) $+ ) with %weapon
- if ($gatherinfo(schat)) { schatsend $+(0,$chr(44),%idd,Server) $+($chr(35),%idd,:,$col(end)) $anick(%steamid) (Team: $teamcolor(%team) $+ ) killed $anick(%asteamid) (Team: $teamcolor(%ateam) $+ ) with %weapon $col(04,TEAMKILL) }
- if ($me ison $privchan) { whatcmd $meorsay $privchan $logo $col(04,TEAMKILL:) %nick $col(14,$chr(40)) $+ $anick(%steamid) $+ $col(14,$chr(41)) - $col(04,killed) - %anick $col(14,$chr(40)) $+ $anick(%asteamid) $+ $col(14,$chr(41)) with %weapon on server $+($chr(35),$serverid(%ipp)) $split Gatheradmin: $anick($gatherstatus(%ipp,admin)) $logo }
- }
- writeini -n $gfile(kills.ini) %ipp %ateam $calc($readini($gfile(kills.ini),%ipp,%ateam) +1)
- writeini -n %killsini %ateam %asteamid %asteamid
- if (%nick) && ($readini($gfile(userdata.ini),%steamid,ingamenick) != %nick) { writeini -n $gfile(userdata.ini) %steamid ingamenick %nick }
- if (%anick) && ($readini($gfile(userdata.ini),%asteamid,ingamenick) != %anick) { writeini -n $gfile(userdata.ini) %asteamid ingamenick %anick }
- return
- if ($ini(%ini,%asteamid)) {
- var %i = 1, %n = $ini(%ini,%asteamid,0) | while (%i <= %n) { var %x = $ini(%ini,%asteamid,%i), %dmg = $readini(%ini,%asteamid,%x)
- if (%dmg >= 40) && (%x != %asteamid) && (%x != %steamid) {
- writeini -n %gamestats %x Assists $calc($readini(%gamestats,%x,Assists) +1)
- writeini -n %gamestats %x Points $calc($readini(%gamestats,%x,Points) +0.3)
- echo -s %x assisted killing %asteamid with %dmg damage ( $calc($readini(%gamestats,%x,Assists) +1) )
- }
- inc %i
- }
- remini -n %ini %asteamid
- }
- }
- elseif (%gatherstatus == Round_End) && (%team == %ateam) {
- logit %ipp TEAMKILL: %nick ( $+ $gauth(%steamid) $+ ) -TK- %anick ( $+ $gauth(%asteamid) $+ ) with %weapon
- if ($gatherinfo(schat)) { schatsend $+(0,$chr(44),%idd,Server) $+($chr(35),%idd,:,$col(end)) $anick(%steamid) (Team: $teamcolor(%team) $+ ) killed $anick(%asteamid) (Team: $teamcolor(%ateam) $+ ) with %weapon $col(04,TEAMKILL) }
- if ($me ison $privchan) { whatcmd $meorsay $privchan $logo $col(04,TEAMKILL:) %nick $col(14,$chr(40)) $+ $anick(%steamid) $+ $col(14,$chr(41)) - $col(04,killed) - %anick $col(14,$chr(40)) $+ $anick(%asteamid) $+ $col(14,$chr(41)) with %weapon on server $+($chr(35),$serverid(%ipp)) $split Gatheradmin: $anick($gatherstatus(%ipp,admin)) $logo }
- }
- }
- return
- }
- if (*attacked* iswm $gettok(%temp. [ $+ [ %ipp ] ],2,34)) {
- var %steamid = $getsteamid(%temp. [ $+ [ %ipp ] ]), %team = $getteam(%temp. [ $+ [ %ipp ] ]), %asteamid = $getsteamid(3,%temp. [ $+ [ %ipp ] ]), %ateam = $getteam(3,%temp. [ $+ [ %ipp ] ])
- var %nick = $getname(%temp. [ $+ [ %ipp ] ]), %anick = $getname(3,%temp. [ $+ [ %ipp ] ]), %attack = $gettok(%temp. [ $+ [ %ipp ] ],7,34), %userid = $getuserid(%temp. [ $+ [ %ipp ] ]), %weapon = $strip($gettok(%temp. [ $+ [ %ipp ] ],5,34))
- if (%team == Terrorists) { var %team = TERRORIST }
- if (%team == Counter-Terrorists) { var %team = CT }
- if (%ateam == Terrorists) { var %ateam = TERRORIST }
- if (%ateam == Counter-Terrorists) { var %ateam = CT }
- if (%gatherstatus == Started) {
- if ($readini($gfile(players.ini),%ipp,%steamid)) && ($readini($gfile(players.ini),%ipp,%asteamid)) {
- if (%team != %ateam) {
- var %ini = $assini(%ipp), %dmg = $iif($readini(%ini,%asteamid,%steamid),$ifmatch,0) | writeini -n %ini %asteamid %steamid $calc(%dmg + %attack)
- }
- else {
- logit %ipp TEAMDAMAGE: %nick ( $+ $gauth(%steamid) $+ ) -TD- %anick ( $+ $gauth(%asteamid) $+ ) with %weapon and %attack damage
- if ($gatherinfo(schat)) { schatsend $+(0,$chr(44),%idd,Server) $+($chr(35),%idd,:,$col(end)) $anick(%steamid) (Team: $teamcolor(%team) $+ ) attacked $anick(%asteamid) (Team: $teamcolor(%ateam) $+ ) with %weapon $col(04,TEAMDAMAGE:) %attack }
- }
- }
- }
- elseif (%gatherstatus == Round_End) && (%team == %ateam) {
- logit %ipp TEAMDAMAGE: %nick ( $+ $gauth(%steamid) $+ ) -TD- %anick ( $+ $gauth(%asteamid) $+ ) with %weapon and %dmg damage
- if ($gatherinfo(schat)) { schatsend $+(0,$chr(44),%idd,Server) $+($chr(35),%idd,:,$col(end)) $anick(%steamid) (Team: $teamcolor(%team) $+ ) attacked $anick(%asteamid) (Team: $teamcolor(%ateam) $+ ) with %weapon $col(04,TEAMDAMAGE:) %attack }
- }
- return
- }
- if (*assisted killing* iswm $gettok(%temp. [ $+ [ %ipp ] ],2,34)) {
- var %steamid = $getsteamid(%temp. [ $+ [ %ipp ] ]), %team = $getteam(%temp. [ $+ [ %ipp ] ]), %asteamid = $getsteamid(3,%temp. [ $+ [ %ipp ] ]), %ateam = $getteam(3,%temp. [ $+ [ %ipp ] ])
- if (%team == Terrorists) { var %team = TERRORIST }
- if (%team == Counter-Terrorists) { var %team = CT }
- if (%ateam == Terrorists) { var %ateam = TERRORIST }
- if (%ateam == Counter-Terrorists) { var %ateam = CT }
- if (%gatherstatus == Started) {
- if ($readini($gfile(players.ini),%ipp,%steamid)) && ($readini($gfile(players.ini),%ipp,%asteamid)) {
- if (%team != %ateam) {
- writeini -n %gamestats %steamid Assists $calc($readini(%gamestats,%steamid,Assists) +1)
- writeini -n %gamestats %steamid Points $calc($readini(%gamestats,%steamid,Points) +0.3)
- }
- }
- }
- return
- }
- if (switched from team isin $gettok(%temp. [ $+ [ %ipp ] ],2,34)) {
- var %hltv = $remove($gettok(%temp. [ $+ [ %ipp ] ],3,60),$chr(62))
- if (%hltv != HLTV) && (%hltv != BOT) {
- var %name = $getname(%temp. [ $+ [ %ipp ] ]), %steamid = $getsteamid(%temp. [ $+ [ %ipp ] ]), %userid = $getuserid(%temp. [ $+ [ %ipp ] ]), %var = $gettok(%temp. [ $+ [ %ipp ] ],2-,34), %team = $remove($gettok(%var,$numtok(%var,32),32),$chr(60),$chr(62))
- if (%disconnected. [ $+ [ %steamid ] ]) { unset %disconnected. [ $+ [ %steamid ] ] | return }
- if (%team == Terrorists) { var %team = TERRORIST }
- if (%team == Counter-Terrorists) { var %team = CT }
- if ($gatherinfo(schat)) { schatsend $+(0,$chr(44),%idd,Server) $+($chr(35),%idd,:,$col(end)) $anick(%steamid) joined team %team }
- logit %ipp %name ( $+ $gauth(%steamid) $+ ) joined team %team
- writeini -n $gfile(joined.ini) %ipp %steamid %team
- if ($readini($gfile(players.ini),%ipp,%steamid)) || (%steamid == $gatherstatus(%ipp,admin)) {
- if (!$sameteam($score(%ipp,total))) { var %ct = $gfile(terrorist.ini), %t = $gfile(counter.ini) } | else { var %ct = $gfile(counter.ini), %t = $gfile(terrorist.ini) }
- if (%team == Spectator) {
- rconsend %ipp say $gnick(%steamid) $+ , u are on team $iif(%team == CT,Terrorist!,CounterTerrorist!)
- if ($gatherinfo(amx)) { rconsend %ipp amx_team $+($chr(35),%userid) $iif(%team == CT,T,CT) }
- return
- }
- var %ini = $iif(%team == CT,%ct,%t)
- if (!$readini(%ini,%ipp,%steamid)) {
- rconsend %ipp say $gnick(%steamid) $+ , u are on team $iif(%team == CT,Terrorist!,CounterTerrorist!)
- if ($gatherinfo(amx)) { rconsend %ipp amx_team $+($chr(35),%userid) $iif(%team == CT,T,CT) }
- }
- elseif ($ini($gfile(joined.ini),%ipp,0) >= $ini($gfile(players.ini),%ipp,0)) && (!$serverstatus(%ipp,sub)) && ($gatherstatus(%ipp) != Started) {
- if ($gatherstatus(%ipp,type) != Challenge) && ($score(%ipp,total) < 15) {
- if (!$readini($gfile(gatherstatus.ini),%ipp,lantjek)) && ($ini($gfile(players.ini),%ipp,0) >= 4) { .timerlantjek. $+ %ipp 1 2 tjeklan %ipp }
- }
- else { .timertjekteams. $+ %ipp 1 2 tjekteams %ipp }
- }
- }
- }
- return
- }
- if (joined team isin $gettok(%temp. [ $+ [ %ipp ] ],2,34)) {
- var %hltv = $remove($gettok(%temp. [ $+ [ %ipp ] ],3,60),$chr(62))
- if (%hltv != HLTV) && (%hltv != BOT) {
- var %name = $getname(%temp. [ $+ [ %ipp ] ]), %steamid = $getsteamid(%temp. [ $+ [ %ipp ] ]), %team = $gettok(%temp. [ $+ [ %ipp ] ],3,34), %userid = $getuserid(%temp. [ $+ [ %ipp ] ])
- if (%disconnected. [ $+ [ %steamid ] ]) { unset %disconnected. [ $+ [ %steamid ] ] | return }
- if (%team == Terrorists) { var %team = TERRORIST }
- if (%team == Counter-Terrorists) { var %team = CT }
- if ($gatherinfo(schat)) { schatsend $+(0,$chr(44),%idd,Server) $+($chr(35),%idd,:,$col(end)) $anick(%steamid) joined team %team }
- logit %ipp %name ( $+ $gauth(%steamid) $+ ) joined team %team
- writeini -n $gfile(joined.ini) %ipp %steamid %team
- if ($readini($gfile(players.ini),%ipp,%steamid)) || (%steamid == $gatherstatus(%ipp,admin)) {
- if (!$sameteam($score(%ipp,total))) { var %ct = $gfile(terrorist.ini), %t = $gfile(counter.ini) } | else { var %ct = $gfile(counter.ini), %t = $gfile(terrorist.ini) }
- if (%team == Spectator) {
- rconsend %ipp say $gnick(%steamid) $+ , u are on team $iif(%team == CT,Terrorist!,CounterTerrorist!)
- if ($gatherinfo(amx)) { rconsend %ipp amx_team $+($chr(35),%userid) $iif(%team == CT,T,CT) }
- return
- }
- var %ini = $iif(%team == CT,%ct,%t)
- if (!$readini(%ini,%ipp,%steamid)) {
- rconsend %ipp say $gnick(%steamid) $+ , u are on team $iif(%team == CT,Terrorist!,CounterTerrorist!)
- if ($gatherinfo(amx)) { rconsend %ipp amx_team $+($chr(35),%userid) $iif(%team == CT,T,CT) }
- }
- elseif ($ini($gfile(joined.ini),%ipp,0) >= $ini($gfile(players.ini),%ipp,0)) && (!$serverstatus(%ipp,sub)) && ($gatherstatus(%ipp) != Started) {
- if ($gatherstatus(%ipp,type) != Challenge) && ($score(%ipp,total) < 15) {
- if (!$readini($gfile(gatherstatus.ini),%ipp,lantjek)) && ($ini($gfile(players.ini),%ipp,0) >= 4) { .timerlantjek. $+ %ipp 1 2 tjeklan %ipp }
- }
- else { .timertjekteams. $+ %ipp 1 2 tjekteams %ipp }
- }
- }
- }
- return
- }
- if (STEAM USERID validated isin $gettok(%temp. [ $+ [ %ipp ] ],2,34)) {
- var %hltv = $remove($gettok(%temp. [ $+ [ %ipp ] ],3,60),$chr(62))
- if (%hltv != HLTV) && (%hltv != BOT) {
- var %name = $getname(%temp. [ $+ [ %ipp ] ]), %steamid = $getsteamid(%temp. [ $+ [ %ipp ] ]), %userid = $getuserid(%temp. [ $+ [ %ipp ] ])
- if ($tempplayers(%ipp)) { if (%steamid) { set -z %tempreg. [ $+ [ %steamid ] ] 60 | .timer $+ $+(%ipp,.,%steamid) 1 65 tempcheck %ipp } }
- }
- return
- }
- if (entered the game isin $gettok(%temp. [ $+ [ %ipp ] ],2,34)) {
- var %hltv = $remove($gettok(%temp. [ $+ [ %ipp ] ],3,60),$chr(62))
- if (%hltv != HLTV) && (%hltv != BOT) {
- var %name = $getname(%temp. [ $+ [ %ipp ] ]), %steamid = $getsteamid(%temp. [ $+ [ %ipp ] ]), %userid = $getuserid(%temp. [ $+ [ %ipp ] ]) | logit %ipp %name ( $+ $gauth(%steamid) $+ ) connected
- if ($gatherinfo(schat)) { schatsend $+(0,$chr(44),%idd,Server) $+($chr(35),%idd,:,$col(end)) $anick(%steamid) joined the server }
- if ($readini($gfile(kicked.ini),%ipp,%steamid)) { rconsend %ipp kickid %steamid Kicked! }
- elseif ($readini($gfile(players.ini),%ipp,%steamid)) || (%steamid == $gatherstatus(%ipp,admin)) {
- writeini -n $gfile(joined.ini) %ipp %steamid SPECTATOR
- if (%startup. [ $+ [ %ipp ] ]) {
- unset %startup. [ $+ [ %ipp ] ]
- if ($readini($gfile(gatherstatus.ini),%ipp,map)) {
- var %map = $ifmatch
- if ($workshop(%ipp,%map)) { var %x = $remove($ifmatch,workshop/) | rconsend %ipp host_workshop_map %x } | else { rconsend %ipp changelevel %map }
- }
- .timerrecheck. [ $+ [ %ipp ] ] 1 3 rechecksocket %ipp | .timer -o 1 5 rconset %ipp | return
- }
- if (!$sameteam($score(%ipp,total))) { var %ct = $gfile(terrorist.ini), %t = $gfile(counter.ini) } | else { var %ct = $gfile(counter.ini), %t = $gfile(terrorist.ini) }
- if ($gatherinfo(amx)) {
- if ($readini(%ct,%ipp,%steamid)) { rconsend %ipp amx_team $+($chr(35),%userid) CT } | elseif ($readini(%t,%ipp,%steamid)) { rconsend %ipp amx_team $+($chr(35),%userid) T }
- var %record = $recordname(%ipp,%steamid) | rconsend %ipp amx_record $+($chr(35),%userid) $+(",%record,")
- }
- .timer -o 1 1 rconsend %ipp say $gnick(%steamid) joined ( $+ $ini($gfile(joined.ini),%ipp,0) $+ / $+ $ini($gfile(players.ini),%ipp,0) $+ )
- }
- elseif ($admin($+($chr(35),$gauth(%steamid))) >= 8) {
- writeini -n $gfile(joined.ini) %ipp %steamid SPECTATOR | rconsend %ipp say Admin: $gnick(%steamid) joined the server!
- if ($gatherinfo(amx)) { rconsend %ipp amx_team $+($chr(35),%userid) SPEC }
- }
- elseif ($admin($+($chr(35),$gauth(%steamid))) >= 6) {
- writeini -n $gfile(joined.ini) %ipp %steamid SPECTATOR | rconsend %ipp say VIP: $gnick(%steamid) joined the server!
- if ($gatherinfo(amx)) { rconsend %ipp amx_team $+($chr(35),%userid) SPEC }
- }
- elseif ($tempplayers(%ipp)) { if (%steamid) { set -z %tempreg. [ $+ [ %steamid ] ] 60 | .timer $+ $+(%ipp,.,%steamid) 1 65 tempcheck %ipp } }
- else { rconsend %ipp kickid %steamid Not signed to gather! | rconsend %ipp say $gnick(%steamid) ( $+ %steamid $+ ) got auto kicked }
- }
- return
- }
- if (connected, address isin $gettok(%temp. [ $+ [ %ipp ] ],2,34)) {
- var %hltv = $remove($gettok(%temp. [ $+ [ %ipp ] ],3,60),$chr(62))
- if (%hltv != HLTV) && (%hltv != BOT) {
- var %steamid = $getsteamid(%temp. [ $+ [ %ipp ] ]), %userid = $getuserid(%temp. [ $+ [ %ipp ] ]), %nick = $getname(%temp. [ $+ [ %ipp ] ]), %addr = $gettok(%temp. [ $+ [ %ipp ] ],3,34), %addr2 = $gettok(%addr,1,58)
- if (%addr2) { writeini -n $gfile(userdata.ini) %steamid ipaddress %addr2 } | writeini -n $gfile(userdata.ini) %steamid ingamenick %nick
- if (%addr2) && ($ipbanned(%addr2)) { var %id = $ifmatch, %team = $null, %tid = $readini($gfile(gatherbans.ini),%id,tid)
- if (%id != %steamid) { rconsend %ipp kickid %steamid IP Banned!
- if ($readini($gfile(players.ini),%ipp,%steamid)) { remini -n $gfile(players.ini) %ipp %steamid
- if ($readini($gfile(counter.ini),%ipp,%steamid)) { remini -n $gfile(counter.ini) %ipp %steamid | var %team = ct } | if ($readini($gfile(terrorist.ini),%ipp,%steamid)) { remini -n $gfile(terrorist.ini) %ipp %steamid | var %team = t }
- if (%team) { if (!$sameteam($score(%ipp,total))) { fastsub %ipp $iif(%team == ct,t,ct) 1 } | else { fastsub %ipp %team 1 } }
- writeini -n $gfile(gatherbans.ini) %steamid admin :gatherbot: | writeini -n $gfile(gatherbans.ini) %steamid tid %tid | writeini -n $gfile(gatherbans.ini) %steamid type IP Ban
- writeini -n $gfile(gatherbans.ini) %steamid grund IP banned on another user [Steamid: %id $+ $chr(93) | writeini -n $gfile(gatherbans.ini) %steamid date $ctime
- if ($gatherinfo(php.exe)) { writeini -n $gfile($php.ini) bans %steamid %steamid | .timerphp.exe -o 1 0 run $+(",$php.exe,") -f $+(",$mircdir,$gfile($php.file),") }
- if ($gatherinfo(mysql.exe)) { writeini -n $gfile(upload.ini) bans steamid %steamid | .timer -o 1 0 run -p $+(",$mircdir,$gdir,MySQL.exe,") }
- whatcmd $meorsay $mainchan $logo $anick($gauth(%steamid)) got auto banned, since he is IP banned [Steamid: %id $+ $chr(93) $split Gatheradmin: $anick($gauth($gatherstatus(%ipp,admin))) $logo
- gatherbans
- }
- }
- elseif ($readini($gfile(kicked.ini),%ipp,%steamid)) { rconsend %ipp kickid %steamid Kicked! }
- elseif ($readini($gfile(players.ini),%ipp,%steamid)) || (%steamid == $gatherstatus(%ipp,admin)) { writeini -n $gfile(joined.ini) %ipp %steamid Connecting }
- elseif ($tempplayers(%ipp)) && (%steamid) { set -z %tempreg. [ $+ [ %steamid ] ] 60 | .timer $+ $+(%ipp,.,%steamid) 1 65 tempcheck %ipp }
- }
- elseif ($readini($gfile(kicked.ini),%ipp,%steamid)) { rconsend %ipp kickid %steamid Kicked! }
- elseif ($readini($gfile(players.ini),%ipp,%steamid)) || (%steamid == $gatherstatus(%ipp,admin)) { writeini -n $gfile(joined.ini) %ipp %steamid Connecting }
- elseif ($tempplayers(%ipp)) && (%steamid) { set -z %tempreg. [ $+ [ %steamid ] ] 60 | .timer $+ $+(%ipp,.,%steamid) 1 65 tempcheck %ipp }
- }
- return
- }
- if (disconnected isin $gettok(%temp. [ $+ [ %ipp ] ],2,34)) {
- var %hltv = $remove($gettok(%temp. [ $+ [ %ipp ] ],3,60),$chr(62))
- if (%hltv != HLTV) && (%hltv != BOT) && (%gatherstatus != Ended) {
- var %steamid = $getsteamid(%temp. [ $+ [ %ipp ] ]), %nick = $getname(%temp. [ $+ [ %ipp ] ]), %reason = $gettok(%temp. [ $+ [ %ipp ] ],3,34)
- set -z %disconnected. [ $+ [ %steamid ] ] 3 | logit %ipp %nick ( $+ $gauth(%steamid) $+ ) left the server with reason: %reason
- if ($gatherinfo(schat)) { schatsend $+(0,$chr(44),%idd,Server) $+($chr(35),%idd,:,$col(end)) $anick(%steamid) left the server with reason: %reason }
- if (%nick) && ($readini($gfile(userdata.ini),%steamid,ingamenick) != %nick) { writeini -n $gfile(userdata.ini) %steamid ingamenick %nick }
- if ($readini($gfile(joined.ini),%ipp,%steamid)) { remini -n $gfile(joined.ini) %ipp %steamid }
- if ($readini($gfile(ready.ini),%ipp,%steamid)) { remini -n $gfile(ready.ini) %ipp %steamid }
- if (%gatherstatus != Ended) && ($readini($gfile(players.ini),%ipp,%steamid)) { var %tid = $ifmatch
- var %new = $calc($ctime +300) | if (%new > %tid) || (%tid !isnum) { writeini -n $gfile(players.ini) %ipp %steamid %new | gathertimeout %ipp }
- if ($timer(lantjek. [ $+ [ %ipp ] ])) { .timerlantjek. [ $+ [ %ipp ] ] off }
- rconsend %ipp say %nick ( $+ $gnick(%steamid) $+ ) left the server
- }
- }
- return
- }
- if (committed suicide with isin $gettok(%temp. [ $+ [ %ipp ] ],2,34)) {
- var %steamid = $getsteamid(%temp. [ $+ [ %ipp ] ]), %team = $getteam(%temp. [ $+ [ %ipp ] ]), %nick = $getname(%temp. [ $+ [ %ipp ] ])
- if (%gatherstatus == Started) && ($readini($gfile(players.ini),%ipp,%steamid)) {
- if (%team == Terrorists) { var %team = TERRORIST }
- if (%team == Counter-Terrorists) { var %team = CT }
- writeini -n %gamestats %steamid Points $calc($readini(%gamestats,%steamid,Points) -0.8)
- writeini -n %gamestats %steamid Deaths $calc($readini(%gamestats,%steamid,Deaths) +1) | writeini -n $gfile(kills.ini) %ipp %team $calc($readini($gfile(kills.ini),%ipp,%team) +1)
- if (%nick) && ($readini($gfile(userdata.ini),%steamid,ingamenick) != %nick) { writeini -n $gfile(userdata.ini) %steamid ingamenick %nick }
- return
- var %ini = $assini(%ipp)
- if ($ini(%ini,%steamid)) {
- var %i = 1, %n = $ini(%ini,%steamid,0) | while (%i <= %n) { var %x = $ini(%ini,%steamid,%i), %dmg = $readini(%ini,%steamid,%x)
- if (%dmg >= 40) && (%x != %steamid) {
- writeini -n %gamestats %x Assists $calc($readini(%gamestats,%x,Assists) +1)
- writeini -n %gamestats %x Points $calc($readini(%gamestats,%x,Points) +0.3)
- }
- inc %i
- }
- remini -n %ini %steamid
- }
- }
- return
- }
- if (changed name to isin $gettok(%temp. [ $+ [ %ipp ] ],2,34)) {
- var %steamid = $getsteamid(%temp. [ $+ [ %ipp ] ]), %userid = $getuserid(%temp. [ $+ [ %ipp ] ]), %name = $gettok(%temp. [ $+ [ %ipp ] ],3,34), %aname = $getname(%temp. [ $+ [ %ipp ] ])
- if ($readini($gfile(players.ini),%ipp,%steamid)) {
- if ($gatherinfo(schat)) { schatsend $+(0,$chr(44),%idd,Server) $+($chr(35),%idd,:,$col(end)) $anick(%steamid) changed name from " $+ %aname $+ " to " $+ %name $+ " }
- writeini -n $gfile(userdata.ini) %steamid ingamenick %name
- }
- return
- }
- if (*userid name uniqueid connected ping loss state adr* iswm $1-) { set -u10 %consolestatus. [ $+ [ %ipp ] ] 1
- if (!%kick. [ $+ [ %ipp ] ]) && (!%check. [ $+ [ %ipp ] ]) && (!%tempcheck. [ $+ [ %ipp ] ]) && (!%whois. [ $+ [ %ipp ] ]) && (!%lancheck. [ $+ [ %ipp ] ]) && (!%startkick. [ $+ [ %ipp ] ]) && (!%endkick. [ $+ [ %ipp ] ]) {
- if ($gatherinfo(schat)) { schatsend $+(0,$chr(44),%idd,Server) $+($chr(35),%idd,:,$col(end)) %temp. [ $+ [ %ipp ] ] }
- }
- .timerend. [ $+ [ %ipp ] ] -m 1 500 endstatus %ipp | return
- }
- if (*userid name uniqueid connected ping loss state rate adr* iswm $1-) { set -u10 %consolestatus. [ $+ [ %ipp ] ] 1
- if ($readini($gfile(gatherstatus.ini),$1,startlink)) { remini -n $gfile(gatherstatus.ini) $1 startlink }
- if (!%kick. [ $+ [ %ipp ] ]) && (!%check. [ $+ [ %ipp ] ]) && (!%tempcheck. [ $+ [ %ipp ] ]) && (!%whois. [ $+ [ %ipp ] ]) && (!%lancheck. [ $+ [ %ipp ] ]) && (!%startkick. [ $+ [ %ipp ] ]) && (!%endkick. [ $+ [ %ipp ] ]) {
- if ($gatherinfo(schat)) { schatsend $+(0,$chr(44),%idd,Server) $+($chr(35),%idd,:,$col(end)) %temp. [ $+ [ %ipp ] ] }
- }
- return
- }
- if (*STEAM_*:*:* iswm $gettok($gettok(%temp. [ $+ [ %ipp ] ],3,34),1,32)) && (%consolestatus. [ $+ [ %ipp ] ]) {
- var %userid = $remove($gettok($gettok(%temp. [ $+ [ %ipp ] ],1,34),1,32),$chr(35)), %nick = $gettok(%temp. [ $+ [ %ipp ] ],2,34), %info = $gettok(%temp. [ $+ [ %ipp ] ],3,34)
- var %steamid = $gettok(%info,1,32), %ipadr = $gettok($gettok(%info,7,32),1,58), %name = $remove($gnick(%steamid),$chr(35)), %auth = $gauth(%steamid)
- if ($timer(end. [ $+ [ %ipp ] ])) { .timerend. [ $+ [ %ipp ] ] -m 1 500 endstatus %ipp }
- if (%userid !isnum) { var %userid = $remove($gettok($gettok(%temp. [ $+ [ %ipp ] ],1,34),2,32),$chr(35)) }
- if (!%ipadr) { var %ipadr = $gettok($gettok(%info,6,32),1,58) }
- if (*.* iswm %ipadr) {
- writeini -n $gfile(userdata.ini) %steamid ipaddress %ipadr
- if ($ipbanned(%ipadr)) { var %id = $ifmatch, %team = $null, %tid = $readini($gfile(gatherbans.ini),%id,tid)
- if (%id != %steamid) { rconsend %ipp kickid %steamid IP Banned!
- if ($readini($gfile(joined.ini),%ipp,%steamid)) { remini -n $gfile(joined.ini) %ipp %steamid }
- if ($readini($gfile(players.ini),%ipp,%steamid)) { remini -n $gfile(players.ini) %ipp %steamid
- if ($readini($gfile(counter.ini),%ipp,%steamid)) { remini -n $gfile(counter.ini) %ipp %steamid | var %team = ct }
- if ($readini($gfile(terrorist.ini),%ipp,%steamid)) { remini -n $gfile(terrorist.ini) %ipp %steamid | var %team = t }
- if (%team) { if (!$sameteam($score(%ipp,total))) { fastsub %ipp $iif(%team == ct,t,ct) 1 } | else { fastsub %ipp %team 1 } }
- writeini -n $gfile(gatherbans.ini) %steamid admin :gatherbot: | writeini -n $gfile(gatherbans.ini) %steamid tid %tid | writeini -n $gfile(gatherbans.ini) %steamid type IP Ban
- writeini -n $gfile(gatherbans.ini) %steamid grund IP banned on another user [Steamid: %id $+ $chr(93) | writeini -n $gfile(gatherbans.ini) %steamid date $ctime
- if ($gatherinfo(php.exe)) { writeini -n $gfile($php.ini) bans %steamid %steamid | .timerphp.exe -o 1 0 run $+(",$php.exe,") -f $+(",$mircdir,$gfile($php.file),") }
- if ($gatherinfo(mysql.exe)) { writeini -n $gfile(upload.ini) bans steamid %steamid | .timer -o 1 0 run -p $+(",$mircdir,$gdir,MySQL.exe,") }
- whatcmd $meorsay $mainchan $logo $anick($gauth(%steamid)) got auto banned, since he is IP banned [Steamid: %id $+ $chr(93) $split Gatheradmin: $anick($gauth($gatherstatus(%ipp,admin))) $logo
- gatherbans
- }
- return
- }
- }
- }
- if (%tempcheck. [ $+ [ %ipp ] ]) {
- if ($tempplayers(%ipp)) && (%tempreg. [ $+ [ %steamid ] ]) { rconsend %ipp say %nick got $duration(%tempreg. [ $+ [ %steamid ] ]) left to authenticate }
- elseif ($readini($gfile(kicked.ini),%ipp,%steamid)) { rconsend %ipp kick $+($chr(35),%userid) Kicked! }
- elseif ($readini($gfile(players.ini),%ipp,%steamid)) || (%steamid == $gatherstatus(%ipp,admin)) { writeini -n $gfile(joined.ini) %ipp %steamid SPECTATOR }
- elseif ($admin($+($chr(35),$gauth(%steamid))) >= 8) { writeini -n $gfile(joined.ini) %ipp %steamid SPECTATOR | rconsend %ipp say Admin: $gnick(%steamid) joined the server! }
- elseif ($admin($+($chr(35),$gauth(%steamid))) >= 6) { writeini -n $gfile(joined.ini) %ipp %steamid SPECTATOR | rconsend %ipp say VIP: $gnick(%steamid) joined the server! }
- elseif ($tempplayers(%ipp)) && (%tempreg. [ $+ [ %steamid ] ]) { rconsend %ipp say %nick got $duration(%tempreg. [ $+ [ %steamid ] ]) left to authenticate }
- else { rconsend %ipp kickid %steamid not signed to gather! | rconsend %ipp say $gnick(%steamid) ( $+ %steamid $+ ) got auto kicked }
- }
- if (%check. [ $+ [ %ipp ] ]) {
- if ($tempplayers(%ipp)) && (%tempreg. [ $+ [ %steamid ] ]) { rconsend %ipp say %nick got $duration(%tempreg. [ $+ [ %steamid ] ]) left to authenticate }
- elseif (!$readini($gfile(joined.ini),%ipp,%steamid)) {
- if ($readini($gfile(kicked.ini),%ipp,%steamid)) { rconsend %ipp kick $+($chr(35),%userid) Kicked! }
- elseif ($readini($gfile(players.ini),%ipp,%steamid)) || (%steamid == $gatherstatus(%ipp,admin)) { writeini -n $gfile(joined.ini) %ipp %steamid SPECTATOR }
- elseif ($admin($+($chr(35),$gauth(%steamid))) >= 8) { writeini -n $gfile(joined.ini) %ipp %steamid SPECTATOR | rconsend %ipp say Admin: $gnick(%steamid) joined the server! }
- elseif ($admin($+($chr(35),$gauth(%steamid))) >= 6) { writeini -n $gfile(joined.ini) %ipp %steamid SPECTATOR | rconsend %ipp say VIP: $gnick(%steamid) joined the server! }
- elseif ($tempplayers(%ipp)) && (%tempreg. [ $+ [ %steamid ] ]) { rconsend %ipp say %nick got $duration(%tempreg. [ $+ [ %steamid ] ]) left to authenticate }
- else { rconsend %ipp kickid %steamid not signed to gather! | rconsend %ipp say $gnick(%steamid) ( $+ %steamid $+ ) got auto kicked }
- }
- }
- if (%forceteams. [ $+ [ %ipp ] ]) && (!%tempreg. [ $+ [ %steamid ] ]) {
- var %team = $iif($readini($gfile(joined.ini),%ipp,%steamid),$ifmatch,SPECTATOR) | if (%team != Connecting) {
- if (!$sameteam($score(%ipp,total))) { var %ct = $gfile(terrorist.ini), %t = $gfile(counter.ini) } | else { var %ct = $gfile(counter.ini), %t = $gfile(terrorist.ini) }
- if ($readini(%ct,%ipp,%steamid)) && (%team != CT) { rconsend %ipp amx_team $+($chr(35),%userid) CT }
- elseif ($readini(%t,%ipp,%steamid)) && (%team != TERRORIST) { rconsend %ipp amx_team $+($chr(35),%userid) T }
- }
- }
- if (%kick. [ $+ [ %ipp ] ]) {
- var %admin = $gettok(%kick. [ $+ [ %ipp ] ],1,32), %kicknick = $gettok(%kick. [ $+ [ %ipp ] ],2-,32), %len = $len(%kicknick), %fnick = $left(%nick,%len)
- if ($+(*,%kicknick,*) iswm %nick) || (%kicknick == %fnick) || (%steamid == %kicknick) || (%userid isnum $remove(%kicknick,$chr(35))) {
- writeini -n $gfile(kicked.ini) %ipp %steamid %steamid | if ($readini($gfile(joined.ini),%ipp,%steamid)) { remini -n $gfile(joined.ini) %ipp %steamid }
- rconsend %ipp kickid %steamid Kicked! | unset %kick. [ $+ [ %ipp ] ] | unset %consolestatus. [ $+ [ %ipp ] ] | gatherkickban %ipp %steamid %admin
- rconsend %ipp say $gnick(%steamid) got kicked by $gnick($gauth(%admin))
- }
- }
- elseif (%startkick. [ $+ [ %ipp ] ]) && (!$readini($gfile(players.ini),%ipp,%steamid)) { rconsend %ipp kickid %steamid Gather started }
- elseif (%endkick. [ $+ [ %ipp ] ]) { rconsend %ipp kickid %steamid Gather ended }
- elseif (%lancheck. [ $+ [ %ipp ] ]) && (*.* iswm %ipadr) {
- if (!$readini($gfile(lancheck.ini),%ipp,%ipadr)) { writeini -n $gfile(lancheck.ini) %ipp %ipadr %ipadr }
- if (!$readini($gfile(lancheck.ini),%ipadr,%steamid)) { writeini -n $gfile(lancheck.ini) %ipadr %steamid %steamid }
- }
- elseif (%whois. [ $+ [ %ipp ] ]) {
- var %len = $len(%whois. [ $+ [ %ipp ] ]), %fnick = $left(%nick,%len)
- if ($+(*,%whois. [ $+ [ %ipp ] ],*) iswm %nick) || (%fnick == %whois. [ $+ [ %ipp ] ]) || (%steamid == %whois. [ $+ [ %ipp ] ]) || (%userid isnum $remove(%whois. [ $+ [ %ipp ] ],$chr(35))) {
- rconsend %ipp say %nick known as $gnick(%steamid) ( $+ %steamid $+ ) | unset %whois. [ $+ [ %ipp ] ] | unset %consolestatus. [ $+ [ %ipp ] ]
- }
- }
- elseif ($gatherinfo(schat)) && (!%check. [ $+ [ %ipp ] ]) && (!%tempcheck. [ $+ [ %ipp ] ]) && (!%forceteams. [ $+ [ %ipp ] ]) { schatsend $+(0,$chr(44),%idd,Server) $+($chr(35),%idd,:,$col(end)) %temp. [ $+ [ %ipp ] ] }
- return
- }
- if (*end iswm %temp. [ $+ [ %ipp ] ]) && (%consolestatus. [ $+ [ %ipp ] ]) {
- unset %consolestatus. [ $+ [ %ipp ] ] | .timerend. [ $+ [ %ipp ] ] off
- if (!%kick. [ $+ [ %ipp ] ]) && (!%check. [ $+ [ %ipp ] ]) && (!%whois. [ $+ [ %ipp ] ]) && (!%forceteams. [ $+ [ %ipp ] ]) && (!%lancheck. [ $+ [ %ipp ] ]) && (!%startkick. [ $+ [ %ipp ] ]) && (!%endkick. [ $+ [ %ipp ] ]) {
- if ($gatherinfo(schat)) { schatsend $+(0,$chr(44),%idd,Server) $+($chr(35),%idd,:,$col(end)) %temp. [ $+ [ %ipp ] ] }
- }
- if (%kick. [ $+ [ %ipp ] ]) { rconsend %ipp say $gettok(%kick. [ $+ [ %ipp ] ],2-,32) was not found! | unset %kick. [ $+ [ %ipp ] ] }
- if (%whois. [ $+ [ %ipp ] ]) { rconsend %ipp say User was not found! | unset %whois. [ $+ [ %ipp ] ] }
- if (%check. [ $+ [ %ipp ] ]) { unset %check. [ $+ [ %ipp ] ] }
- if (%forceteams. [ $+ [ %ipp ] ]) { unset %forceteams. [ $+ [ %ipp ] ] }
- if (%lancheck. [ $+ [ %ipp ] ]) { lancheck %ipp | unset %lancheck. [ $+ [ %ipp ] ] }
- if (%startkick. [ $+ [ %ipp ] ]) { unset %startkick. [ $+ [ %ipp ] ] }
- if (%endkick. [ $+ [ %ipp ] ]) { unset %endstartkick. [ $+ [ %ipp ] ] }
- if (%tempcheck. [ $+ [ %ipp ] ]) { unset %tempcheck. [ $+ [ %ipp ] ] }
- if (%pregame. [ $+ [ %ipp ] ]) { unset %pregame. [ $+ [ %ipp ] ] | .timer -o 1 1 pregame %ipp | .timer -o 1 2 rconsetpw %ipp }
- }
- }
- }
- alias endstatus {
- var %ipp = $1, %idd = $serverid(%ipp), %temp. [ $+ [ %ipp ] ] $chr(35) end | unset %consolestatus. [ $+ [ %ipp ] ]
- if (!%kick. [ $+ [ %ipp ] ]) && (!%check. [ $+ [ %ipp ] ]) && (!%tempcheck. [ $+ [ %ipp ] ]) && (!%whois. [ $+ [ %ipp ] ]) && (!%forceteams. [ $+ [ %ipp ] ]) && (!%lancheck. [ $+ [ %ipp ] ]) && (!%startkick. [ $+ [ %ipp ] ]) && (!%endkick. [ $+ [ %ipp ] ]) {
- if ($gatherinfo(schat)) { schatsend $+(0,$chr(44),%idd,Server) $+($chr(35),%idd,:,$col(end)) %temp. [ $+ [ %ipp ] ] }
- }
- if (%kick. [ $+ [ %ipp ] ]) { rconsend %ipp say $gettok(%kick. [ $+ [ %ipp ] ],2-,32) was not found | unset %kick. [ $+ [ %ipp ] ] }
- if (%whois. [ $+ [ %ipp ] ]) { rconsend %ipp say User was not found! | unset %whois. [ $+ [ %ipp ] ] }
- if (%check. [ $+ [ %ipp ] ]) { unset %check. [ $+ [ %ipp ] ] }
- if (%forceteams. [ $+ [ %ipp ] ]) { unset %forceteams. [ $+ [ %ipp ] ] }
- if (%lancheck. [ $+ [ %ipp ] ]) { lancheck %ipp | unset %lancheck. [ $+ [ %ipp ] ] }
- if (%startkick. [ $+ [ %ipp ] ]) { unset %startkick. [ $+ [ %ipp ] ] }
- if (%endkick. [ $+ [ %ipp ] ]) { unset %endstartkick. [ $+ [ %ipp ] ] }
- if (%tempcheck. [ $+ [ %ipp ] ]) { unset %tempcheck. [ $+ [ %ipp ] ] }
- if (%pregame. [ $+ [ %ipp ] ]) { unset %pregame. [ $+ [ %ipp ] ] | .timer -o 1 1 pregame %ipp | .timer -o 1 2 rconsetpw %ipp }
- }
- alias playedup {
- if ($gatherinfo(ftp)) {
- var %ftp = $ifmatch, %host = $gettok(%ftp,1,32), %user = $gettok(%ftp,2,32), %pass = $gettok(%ftp,3,32), %dir = $gettok(%ftp,4,32), %url = $gettok(%ftp,5,32)
- write playedinfo.html <div style="font-family: Arial, Helvetica, sans-serif; color: #555555; font-size: 14px;line-height: 1.5em;">I Dag: $gatherstats(chan,Today)</div>
- write playedinfo.html <div style="font-family: Arial, Helvetica, sans-serif; color: #555555; font-size: 14px;line-height: 1.5em;">I G $+ å $+ r: $gatherstats(chan,lastday)</div>
- write playedinfo.html <div style="font-family: Arial, Helvetica, sans-serif; color: #555555; font-size: 14px;line-height: 1.5em;">Denne uge: $gatherstats(chan,Thisweek)</div>
- write playedinfo.html <div style="font-family: Arial, Helvetica, sans-serif; color: #555555; font-size: 14px;line-height: 1.5em;">Denne m $+ å $+ ned: $gatherstats(chan,Jan)</div>
- write playedinfo.html <div style="font-family: Arial, Helvetica, sans-serif; color: #555555; font-size: 14px;line-height: 1.5em;">Total spillet: $gatherstats(chan,Played)</div>
- write playedinfo.html <div style="font-family: Arial, Helvetica, sans-serif; color: #555555; font-size: 14px;line-height: 1.5em;">Antal registeret: $lines($gfile(gatherusers.dat))</div>
- write -c upload.txt open %host | write upload.txt %user | write upload.txt %pass | write upload.txt bin | write upload.txt cd /var/www/html/stats
- write upload.txt dele playedinfo.html | write upload.txt put playedinfo.html | write upload.txt quit | write -c upload.bat @echo off | write upload.bat ftp -i -s:"upload.txt"
- write upload.bat del upload.txt | write upload.bat del playedinfo.html | write upload.bat del upload.bat | .timer 1 0 run upload.bat
- }
- }
Add Comment
Please, Sign In to add comment