From d62ece9626e1c0f2b553bbbcbc25077d1c9b2c64 Mon Sep 17 00:00:00 2001 From: Bukz Date: Fri, 1 Jun 2012 02:57:51 +0000 Subject: [PATCH] updates git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6817 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- config/mdarray.cfg | 2 +- config/scripts.cfg | 57 +++++++++++++++++++++++----------------------- 2 files changed, 29 insertions(+), 30 deletions(-) diff --git a/config/mdarray.cfg b/config/mdarray.cfg index ea9548ac..3795eb9e 100644 --- a/config/mdarray.cfg +++ b/config/mdarray.cfg @@ -194,7 +194,7 @@ MDArray_Modify_Subarray = [ MDArray_Delete_Subarray $arg1 $arg2 if (islists $new_subarray) [ - MDArray_New_Subarray $arg1 $arg2 (addpunct $new_subarray $brackets) + MDArray_New_Subarray $arg1 $arg2 (addpunct $new_subarray $BRACKETS) ] [ MDArray_New_Subarray $arg1 $arg2 (addpunct $new_subarray) ] diff --git a/config/scripts.cfg b/config/scripts.cfg index 791a74ef..674dc2f3 100644 --- a/config/scripts.cfg +++ b/config/scripts.cfg @@ -108,25 +108,24 @@ const WEAPONS "KNIFE PISTOL CARBINE SHOTGUN SMG SNIPER AR CPISTOL GRENADES AKIMB 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 $MODES) -// ktf ac_mines - calls a vote for keep the flag ac_mines -// echo (ktf -1) - returns 15 +const PUNCTUATION "QUOTES BRACKETS PARENTHESIS _$_ QUOTE PERCENT" +const MAX_BOT_MATCH_LENGTH 60 + +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] loop d $NUM_WEAPONS [ const (at $WEAPONS $d) $d ] -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 +loop r $NUM_MODES [ const (at $MODES $r) (format "if (= $arg1 -1) [ result %1 ] [ votemap %1 %2 ]" $r (addpunct arg1 $_$_)) ] +// ktf ac_mines - calls a vote for keep the flag ac_mines +// echo (ktf -1) - returns 15 // Mode/map-setting aliases. const votemap [ mode $arg1; map $arg2 ] -const lms [ votemap 3 $arg1 ] -const vip [ votemap 13 $arg1 ] +const lms [ votemap (surv -1) $arg1 ] +const vip [ votemap (htf -1) $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 "if (= $arg1 -1) [ result %1 ] [ result %2 ]" $k (addpunct (concat c $k) 2)) ] @@ -136,11 +135,11 @@ loop k 10 [ const (at "green blue yellow red gray white dbrown dred purple orang // Weapon switching/action utilities. const primary [ weapon (currentprimary) ] const ptoggle [ if (= (currentprimary) (curweapon)) [ $arg1 ] [ primary ] ] // Toggle between primary/specified weapon -const secondary [ weapon 1 ] +const secondary [ weapon $PISTOL ] const sndtoggle [ ptoggle secondary ] -const melee [ weapon 0 ] +const melee [ weapon $KNIFE ] const knftoggle [ ptoggle melee ] -const grenades [ weapon 8 ] +const grenades [ weapon $GRENADES ] const gndtoggle [ ptoggle grenades ] const altaction [ (concatword altaction_ (curweapon)) ] @@ -153,7 +152,7 @@ const quicknadethrow_old [ if (!= (curweapon) 7) [ grenades ] attack ] - onrelease [ sleep 1 [ if (= (curweapon) 7) [ weapon (prevweapon) ] ] ] + onrelease [ sleep 1 [ if (= (curweapon) $CPISTOL) [ weapon (prevweapon) ] ] ] ] loop i 10 [ (concatword altaction_ $i) = quicknadethrow ] // Quick nade throw is default @@ -273,8 +272,8 @@ const get_ent_attrs [ cp_entbuf = (getenttype); loop gea 4 [ add2list cp_entbuf const copyent [ if $editing [ get_ent_attrs - cp_entstr = (concatword (c 9) "(" (at $cp_entbuf 0) " " (at $cp_entbuf 1) " " (at $cp_entbuf 2) " " (at $cp_entbuf 3) " " (at $cp_entbuf 4) ")" (c 5)) // Output (a string): (enttype param1 param2 param3 param4) - echo (c 1)Note: (c 5)The current closest entity: $cp_entstr - has been copied. + cp_entstr = (concatword (orange) "(" (at $cp_entbuf 0) " " (at $cp_entbuf 1) " " (at $cp_entbuf 2) " " (at $cp_entbuf 3) " " (at $cp_entbuf 4) ")" (white)) // Output (a string): (enttype param1 param2 param3 param4) + echo (blue)Note: (white)The current closest entity: $cp_entstr - has been copied. ] ] @@ -286,8 +285,8 @@ const pasteent [ ] [ newent (at $cp_entbuf 0) (at $cp_entbuf 1) (at $cp_entbuf 2) (at $cp_entbuf 3) (at $cp_entbuf 4) ] - echo (c 1)Note: (c 5)The previously copied entity: $cp_entstr - has been pasted. - ] [ echo (c 3)Error: (c 5)pasteent requires an (c 1)initial (c 5)copyent to function. ] + echo (blue)Note: (white)The previously copied entity: $cp_entstr - has been pasted. + ] [ echo (red)Error: (white)pasteent requires an (blue)initial (white)copyent to function. ] ] ] @@ -297,7 +296,7 @@ const genhex [ loop ghl 6 [ if (rnd 2) [ tmp_hex = (concatword $tmp_hex (rnd 10)) ] [ tmp_hex = (concatword $tmp_hex (at [ A B C D E F ] (rnd 6))) ] ] - echo (c 3)Trying hexadecimal color: (c 5) $tmp_hex + echo (red)Trying hexadecimal color: (white) $tmp_hex result $tmp_hex ] @@ -306,7 +305,7 @@ const genwc [ if $editing [ tmp_wc = "" loop gwl 3 [ add2list tmp_wc (rrnd 1 256) ] - echo (c 3)Trying water color: (c 5) $tmp_wc + echo (red)Trying water color: (white) $tmp_wc watercolour (at $tmp_wc 0) (at $tmp_wc 1) (at $tmp_wc 2) ] ] @@ -318,16 +317,16 @@ const gencl [ loop gcl 3 [ add2list tmp_cl (rrnd 1 256) ] if $tmp_numargs [ if (|| (! (= $selx 0)) (! (= $sely 0))) [ - echo (c 3)Trying colored light: (c 5) $arg1 (at $tmp_cl 0) (at $tmp_cl 1) (at $tmp_cl 2) + echo (red)Trying colored light: (white) $arg1 (at $tmp_cl 0) (at $tmp_cl 1) (at $tmp_cl 2) newent light $arg1 (at $tmp_cl 0) (at $tmp_cl 1) (at $tmp_cl 2) - ] [ echo (c 3)Error: (c 5)If an argument "(radius)" is given for (concatword (c 1) gencl (c 5) ",") you must select a cube first. ] + ] [ echo (red)Error: (white)If an argument "(radius)" is given for (concatword (blue) gencl (red) ",") you must select a cube first. ] ] [ if (strcmp (getenttype) light) [ - echo (c 3)Trying colored light: (c 5) (getentattr 0) (at $tmp_cl 0) (at $tmp_cl 1) (at $tmp_cl 2) + echo (red)Trying colored light: (white) (getentattr 0) (at $tmp_cl 0) (at $tmp_cl 1) (at $tmp_cl 2) entset light (getentattr 0) (at $tmp_cl 0) (at $tmp_cl 1) (at $tmp_cl 2) - ] [ echo (c 3)Error: (c 5)The current closest entity: (c 9) (getenttype) (c 5)is not a light. ] + ] [ echo (red)Error: (white)The current closest entity: (orange) (getenttype) (white)is not a light. ] ] - ] [ echo (c 3)Error: (c 5)You must be in edit mode for (c 1)gencl (c 5)to function. ] + ] [ echo (red)Error: (white)You must be in edit mode for (blue)gencl (white)to function. ] ] // megabind - Binds a key to many different actions depending on the current game state. @@ -342,7 +341,7 @@ const storesets [ add2list $arg2 (getalias (at $arg1 $ssl)) ] [ badargs = 1; break ] ] - if $badargs [ delalias $arg2; echo (c 3)Error: (c 5)Bad "argument(s)" given! ] + if $badargs [ delalias $arg2; echo (red)Error: (white)Bad "argument(s)" given! ] ] ] @@ -380,7 +379,7 @@ _CAS_servername = "SERVER NAME" const customclaimadminscript [ if (strcmp (curserver 1) $_CAS_serverip) [ if (! (currole)) [ setadmin 1 $_CAS_serverpass ] [ setadmin 0; echo you relinquished admin status ] - ] [ echo (c 3)Error: (c 5)you're not connected to $_CAS_servername servers ] + ] [ echo (red)Error: (white)you're not connected to $_CAS_servername servers ] ] // Execute other .cfgs/scripts.