25 Jun 11, 07:04AM
Since I never use it anymore, I thought it may be a good idea, or a bad idea, to post my autogemakick script. Here it is: http://ompldr.org/vOGhlMQ/autogemakick.cfg
Or if you do not trust that link, here it is:
Or maybe someone has found this script? _///\(O_O)/\\\_... I am not even sure whether this works anymore. Also, I think CubeScript needs to support multi-line comments... Or maybe not ;~; I never know what to make anymore.
Or if you do not trust that link, here it is:
[SELECT ALL] Code:
// autogemakick script by |FOX|Yarukinasu
// to enable or disable the autogemakick, type /autogemakick
// prefix increment operator
++ = [ += $arg1 1 ]
// a name that cannot be a name
EMPTY = 0000000000000000
// names of the gema maps
GEMA_MAPS = [
G3M4 G3M@ G3MA G3m4 G3m@ G3mA G3ma GEM4 GEM@ GEMA GEMa GEm4 GEm@ GEma
Gem4 Gem@ GemA Gema g3M4 g3M@ g3Ma g3m4 g3m@ g3mA g3ma gEM4 gEM@ gEMA
gEMa gEm4 gEm@ gEmA gEma geM4 geM@ geMa gem@ gemA gema jigsaw ]
// maximum number of clients connected
MAX_CN = 20
// convincing reasons
REASONS = [
if (= $arg1) [ tmpreason = "killing" ] [
if (= $arg1 1) [ tmpreason = "team killing" ] [
if (= $arg1 2) [ tmpreason = "excessive killing" ] [
if (= $arg1 3) [ tmpreason = "excessive and team killing" ] [
if (= $arg1 4) [ tmpreason = "flag spamming" ] [
if (= $arg1 5) [ tmpreason = "changeteam spamming" ] [
if (= $arg1 6) [ tmpreason = "name spamming" ] ] ] ] ] ] ]
result (format "no %1 on gema pl0x~" $tmpreason) ]
// the switch for autogemakickloop
agk = 0
// the list of killers' names
killernamelist = ""
// toggles the autogemakick
autogemakick = [
if $agk [
echo (c 3) "autogemakick is disabled..."; agk = 0 ] [
echo (c 0) "autogemakick is enabled..."; agk = 1 ]
repeat_autogemakick ]
// this loop does the following:
// 1. compares the ffdstat and the old_ffdstat, and if they are unequal,
// check for a player that fragged, team killed, or flag spammed
// 2. says the time it took for a player to score
// 3. kicks the spammers: changeteam spam and name change spam
autogemakickloop = [
update_connectedcn
update_ffdstat
if (strnot $ffdstat $old_ffdstat) [
loop i $MAX_CN [
if (|| [ at $old_connectedcn $i ] [ ! (at $connectedcn $i) ]) [
if (isconnected $i) [
iindex = (* $i 3)
numflag = (at $ffdstat $iindex)
old_numflag = (at $old_ffdstat $iindex)
numfrag = (at $ffdstat (+ $iindex 1))
old_numfrag = (at $old_ffdstat (+ $iindex 1))
numdeath = (at $ffdstat (+ $iindex 2))
old_numdeath = (at $old_ffdstat (+ $iindex 2))
flagdif = (- $numflag $old_numflag)
fragdif = (- $numfrag $old_numfrag)
deathdif = (- $numdeath $old_numdeath)
if (> $fragdif) [
vote 2
if (checkkillername (findpn $i)) [
ban $i (REASONS 2) ] [
kick $i (REASONS 0) ] ] [
if (&& [ <= $fragdif -1 ] [ != $deathdif 1 ]) [
vote 2
if (checkkillername (findpn $i)) [
ban $i (REASONS 3) ] [
kick $i (REASONS 1) ] ] [
if (= $flagdif 1) [
if (= $numflag 1) [
tmpgematime = (div (- (millis) (at $gematimes $i)) 1000)
minutepassed = (div $tmpgematime 60)
secondpassed = (mod $tmpgematime 60)
if (<= $minutepassed 1) [
if $minutepassed [
tmpminute = "1 minute" ] [
tmpminute = "" ] ] [
tmpminute = (concat $minutepassed "minutes") ]
if (<= $secondpassed 1) [
tmpsecond = "1 second" ] [
tmpsecond = (concat $secondpassed "seconds") ]
if (&& $minutepassed [ strnot $tmpsecond ]) [
tmpsecond = (concat " and" $tmpsecond) ]
statmessage = (concat (findpn $i) "finished the gema in")
say (format "%1 %2%3." $statmessage $tmpminute $tmpsecond) ] [
if (>= $numflag 3) [
if (>= $numflag 5) [
vote 2
forceteam $i ] [
say (REASONS 4) ] ] ] ] ] ] ] ] ]
changeskin ]
update_old ffdstat
if (strnot $connectedcn $old_connectedcn) [
loop i $MAX_CN [
if (&& [ at $connectedcn $i ] [ ! (at $old_connectedcn $i) ]) [
gematimes = (update_list $gematimes $i (millis)) ] ] ]
update_old connectedcn
update_teamlist
if (strnot $teamlist $old_teamlist) [
loop i $MAX_CN [
if (&& [ != (at $teamlist $i) -1 ] [ != (at $old_teamlist $i) -1 ]) [
if (&& [ <= (at $teamlist $i) 1 ] [ <= (at $old_teamlist $i) 1 ]) [
if (!= (at $teamlist $i) (at $old_teamlist $i)) [
tmpincrement = (+ (at $changeteam_log $i) 1)
changeteam_log = (update_list $changeteam_log $i $tmpincrement) ] ] ] ] ]
update_old teamlist
if (strnot $changeteam_log $old_changeteam_log) [
loop i $MAX_CN [
if (>= (at $changeteam_log $i) 10) [
kick $i (REASONS 5)
changeteam_log = (update_list $changeteam_log $i 0) ] ] ]
update_old changeteam_log
update_namelist
if (strnot $namelist $old_namelist) [
loop i $MAX_CN [
if (&& [ strnot (at $namelist $i) $EMPTY ] [ strnot (at $old_namelist $i) $EMPTY ]) [
if (strnot (at $namelist $i) (at $old_namelist $i)) [
tmpincrement = (+ (at $name_log $i) 1)
name_log = (update_list $name_log $i $tmpincrement) ] ] ] ]
update_old namelist
if (strnot $name_log $old_name_log) [
loop i $MAX_CN [
if (>= (at $name_log $i) 10) [
kick $i (REASONS 6)
name_log = (update_list $name_log $i 0) ] ] ]
update_old name_log
if (isgema) [ sleep 0 autogemakickloop ] ]
// changes skin vigorously
changeskin = [
if (curteam) [
myskin = 4; maxskin = 5 ] [ // RVSF / SPECTATOR
myskin = 3; maxskin = 3 ] // CLA
tmpcount = 0
changeskinloop ]
// extension of the changeskin
changeskinloop = [
if (>= $myskin $maxskin) [
myskin = 0 ] [
++ myskin ]
skin $myskin
++ tmpcount
if (< $tmpcount 60) [ sleep 60 changeskinloop ] ]
// checks whether the killer has been killing
checkkillername = [
tmpkillername = $arg1
tmpnum = 0
loop i (listlen $killernamelist) [
if (strcmp (at $killernamelist $i) $tmpkillername) [
++ tmpnum ] ]
if (>= $tmpnum 3) [
tmpkillernamelist = ""
tmplistlen = (listlen $killernamelist)
loop i $tmplistlen [
if (strnot (at $killernamelist $i) $tmpkillername) [
tmpkillernamelist = (concat $tmpkillernamelist (at $killernamelist $i)) ] ]
killernamelist = $tmpkillernamelist
result 1 ] [
killernamelist = (concat $killernamelist $tmpkillername)
result 0 ] ]
// initializes a list and updates the old list
init = [
$arg1 = ""
loop i $MAX_CN [
$arg1 = (concat (getalias $arg1) $arg2) ]
update_old $arg1 ]
// if the client number if connected, return 1; otherwise, return 0
isconnected = [ result (strnot (findpn $arg1)) ]
// if the current map is a gema, return 1; otherwise, return 0
isgema = [
ig = 0
if (&& $agk [ = (curmode) 5 ]) [
loop i (listlen $GEMA_MAPS) [
if (strstr (curmap) (at $GEMA_MAPS $i)) [ ig = 1 ] ] ]
result $ig ]
// updates the connectedcn
update_connectedcn = [
connectedcn = ""
loop i $MAX_CN [
connectedcn = (concat $connectedcn (isconnected $i)) ] ]
// updates the connectedcn and the old_connectedcn
update_connectedcns = [ update_connectedcn; update_old connectedcn ]
// updates the ffdstat and the old_ffdstat
update_ffdstats = [ update_ffdstat; update_old ffdstat ]
// updates the ffdstat
update_ffdstat = [
ffdstat = ""
loop i $MAX_CN [
f = (at (pstat_score $i)) // FLAGS
ff = (concat $f (at (pstat_score $i) 1)) // FLAGS + FRAGS
ffd = (concat $ff (at (pstat_score $i) 2)) // FLAGS + FRAGS + DEATHS
ffdstat = (concat $ffdstat $ffd) ] ]
// updates a list
update_list = [
checkinglist = $arg1
ulcn = $arg2
ulvalue = $arg3
tmplist = ""
loop i $ulcn [
tmplist = (concat $tmplist (at $checkinglist $i)) ]
tmplist = (concat $tmplist $ulvalue)
loop i (- (- $MAX_CN 1) $ulcn) [
tmplist = (concat $tmplist (at $checkinglist (+ (+ $ulcn 1) $i))) ]
result $tmplist ]
// updates the namelist
update_namelist = [
namelist = ""
loop i $MAX_CN [
if (isconnected $i) [
namelist = (concat $namelist (findpn $i)) ] [
namelist = (concat $namelist $EMPTY) ] ] ]
// updates the namelist and the old_namelist
update_namelists = [ update_namelist; update_old namelist ]
// updates the old list
update_old = [ (concatword "old_" $arg1) = (getalias $arg1) ]
// updates the teamlist
update_teamlist = [
teamlist = ""
loop i $MAX_CN [ teamlist = (concat $teamlist (at (pstat_score $i) 4)) ] ]
// updates the teamlist and the old_teamlist
update_teamlists = [ update_teamlist; update_old teamlist ]
// this should be executed immediately after a new map has been loaded
repeat_autogemakick = [
init changeteam_log 0
init gematimes (millis)
init name_log 0
update_ffdstats
update_connectedcns
update_namelists
update_teamlists
autogemakickloop ]
// returns 1 if two strings are not equal; otherise, returns 0
strnot = [ result (! (strcmp $arg1 $arg2)) ]
// adds the repeat_autogemakick in mapstartalways
// equivalent to addcheck_msa [ if $agk [ repeat_autogemakick ] ]
// thanks to V-Man's tools.cfg
if (! (strstr (getalias mapstartalways) "if $agk [ repeat_autogemakick ]")) [
add2alias mapstartalways [ if $agk [ repeat_autogemakick ] ] ]
Or maybe someone has found this script? _///\(O_O)/\\\_... I am not even sure whether this works anymore. Also, I think CubeScript needs to support multi-line comments... Or maybe not ;~; I never know what to make anymore.