git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6812 e016b1c5-ed68-44aa-a2f7-31cac88cffde

This commit is contained in:
Bukz
2012-05-29 17:02:42 +00:00
parent ef8d536ea9
commit 2fcec2c859
12 changed files with 90 additions and 80 deletions
+13 -4
View File
@@ -103,16 +103,23 @@ const resetbinds [ run resetbinds; echo (c 3)All binds have been reset to defaul
const changeteam [ if (< (curteam) 4) [ team (at "RVSF CLA RVSF-SPECT CLA-SPECT" (curteam)) ] ]
const NUM_WEAPONS 10
const NUM_MODES 22
const WEAPONS "KNIFE PISTOL CARBINE SHOTGUN SMG SNIPER AR CPISTOL GRENADES AKIMBO"
const NUM_WEAPONS (listlen $WEAPONS)
const MODES "tdm coop dm surv ts ctf pf btdm bdm lss osok tosok bosok htf tktf ktf tpf tlss bpf blss bts btosok"
const NUM_MODES (listlen $NUM_MODES)
// ktf ac_mines - calls a vote for keep the flag ac_mines
// echo (ktf -1) = returns 15
loop d $NUM_WEAPONS [ const (at $WEAPONS $d) $d ]
loop r $NUM_MODES [ const (at $MODES $r) (addpunct (concat votemap $r (addpunct arg1 3)) 2) ]
loop r $NUM_MODES [ const (at $MODES $r) (addpunct (format "if (= $arg1 -1) [ result %1 ] [ votemap %1 %2 ]" $r (addpunct arg1 3)) 2) ]
loop f $NUM_MODES [ const (toupper (at $MODES $f)) $f ]
const PUNCTUATION "quotes brackets parenthesis _$_ quote percent"
loop g (listlen $PUNCTUATION) [ const (at $PUNCTUATION $g) $g ]
// echo (addpunct "hello world" $parenthesis) - output: (hello world)
// echo (addpunct "hello world" $brackets) - output: [hello world]
const MAX_BOT_MATCH_LENGTH 60
// Mode/map-setting aliases.
@@ -122,7 +129,9 @@ const lms [ votemap 3 $arg1 ]
const vip [ votemap 13 $arg1 ]
// Helper aliases for (c) - easy color insertion. (e.g. echo (red)Hello (blue)world! (white)My fov today is: (orange) $fov)
loop k 10 [ const (at "green blue yellow red gray white dbrown dred purple orange" $k) (format "result %1" (addpunct (concat c $k) 2)) ]
loop k 10 [ const (at "green blue yellow red gray white dbrown dred purple orange" $k) (format "if (= $arg1 -1) [ result %1 ] [ result %2 ]" $k (addpunct (concat c $k) 2)) ]
// echo (blue -1) - returns 1
// echo (purple -1) - returns 8
// Weapon switching/action utilities.
const primary [ weapon (currentprimary) ]