diff --git a/config/scripts.cfg b/config/scripts.cfg index 6d9247fa..1a07b69b 100644 --- a/config/scripts.cfg +++ b/config/scripts.cfg @@ -161,7 +161,7 @@ quicknadethrow_old = [ loop i 10 [ (concatword altaction_ $i) = quicknadethrow ] // Quick nade throw is default altaction_5 = [ setscope 1; onrelease [ setscope 0 ] ] // Sniper -altaction_7 = [ setburst 1; onrelease [ setburst 0 ] ] // Combat pistol +// altaction_7 = [ setburst 1; onrelease [ setburst 0 ] ] // Combat pistol // TODO uncomment when this becomes a priority/testing, for now lets save an unused alias - Bukz // altaction_8 = [ attack ] // Grenade // with this comment, you throw the nade and the nade is unselected : Brahma oldsens = $sensitivity @@ -265,28 +265,32 @@ add2list = [ if (strcmp "" (getalias $arg1)) [ $arg1 = $arg2 ] [ $arg1 = (concat // rrnd - Returns a ranged random integer. rrnd = [ + (rnd (- $arg2 $arg1)) $arg1 ] -// copyent & pasteent - Quickly copy/paste the current closest entity. -ent_type = none +// copyent & pasteent - Quickly copy/paste the current closest entity. Initialize the two aliases below as "NULL" for error catching. +// If /config/saved.cfg is readable/writable, errors are only possible up until the very first use of /copyent. +cp_entbuf = NULL +cp_entstr = NULL get_ent_attrs = [ if $editing [ - ent_attrs = "" - loop gea 4 [ - add2list ent_attrs (getentattr $gea) - ] + cp_entbuf = (getenttype) + loop gea 4 [ add2list cp_entbuf (getentattr $gea) ] ] ] copyent = [ if $editing [ - ent_type = (getenttype) 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. ] ] pasteent = [ if $editing [ - newent $ent_type (at $ent_attrs 0) (at $ent_attrs 1) (at $ent_attrs 2) (at $ent_attrs 3) + if (&& (! (strcmp $cp_entbuf NULL)) (! (strcmp $cp_entstr NULL))) [ + 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. ] ] ]