Get the New Tools
#31
(19 Jan 11, 04:31AM)DES|V-Man Wrote: Technically, the configuration is in the RAM when you load the game -- at game start, each individual configuration setting is plugged in as the game loads.
If you wanted to make the saved.cfg temprary, I'm sure you could add a line in assaultcube.bat that renames saved.cfg and starts a new one, giving the effect you're describing.

Yeah you can. But I want moar officialness! Hehe.
Thanks given by:
#32
New update for tools.cfg!
Changes:
- The documentation is in a separate file. If you want to use it, feel free to put it in your scripts folder.
- "if_conline_has" now takes two more logic tests as its second argument! "and_also" and "or_else"!
- New commands:
serial -- Creates a series of aliases with the same base-name and numbered name-suffixes.
nestalias -- Creates an alias nested within itself; each time it is executed, it "sheds" a layer
delserial -- Deletes a series of aliases with the same base-name and numbered name-suffixes.
delfromlist -- Returns a list of strings based on a given list and a string to delete.
delfromlistend -- Returns a list of strings based on a given list and the number of elements to delete from its end.
delfromliststart -- Returns a list of strings based on a given list and the number of elements to delete from its beginning.
delfromlist_mult -- Loops "delfromlist" to return a list with multiple entries omitted.
replacestr -- Returns a list with one element replaced by another.
swapstrpos -- Returns a list with two elements switched.
validcnumlist -- Returns the (non-duplicated) client numbers.
whoisall -- Performs a "whois" on every client currently in the server.
kickbots -- Kicks multiple bots out of a bot game.
teamcount -- Returns the number of players in a given team.
curenemies -- Returns the current number of enemies you have in the game.
curhighestcn -- Returns the highest valid client number found in the current game.
curdeaths -- Returns the current number of deaths a client currently has.
curfrags -- Returns the current number of frags a client currently has.
curratio -- Returns the current ratio (frags / deaths) of a client.
curscore -- Returns the current score of a client.
checkint -- Checks a given argument and determines if it is an integer or not.
Thanks given by:
#33
Pointing out a typo:

Line 309:

alias hialphlist [A B C D E F G H I J K L M N O P Q R S T U V W Z Y Z]

should read:

alias hialphlist [A B C D E F G H I J K L M N O P Q R S T U V W X Y Z]

...my mistake. :X
Thanks given by:
#34
Fixed. Thanks Bukz.
Okay, NOW go get the new version! XD
Thanks for posting for me, Ron.
Thanks given by:
#35
May I suggest adding a version of serial that only creates the alias if it doesn't already exist? (Useful for menu's "setting holders" if you know what I mean)
Thanks given by:
#36
:O
I should have thought of that. Good idea.
Thanks given by:
#37
Another update!
Changes:
- Made it so "serial" only creates given aliases if they don't already exist
- "storeargs" -- stores arguments passed to it by the containing alias
- "sloop" -- adds sleep to a loop
- "recursive" -- creates an alias which calls itself recursively with a given sleep
- "isfloat", "isint", and "isnumber" by Kirin replaced "checkint" (Sorry Bukz, hope you still luv me)
- "conloop" is now created using "recursive"

These are in preparation for a couple really cool scripts. Please please please let me know if there's anything awry in this update!
Thanks given by:
#38
V-Man stop double post

I mean, GJ.
Thanks given by:
#39
Double post!
tools.cfg update 1.1.0.9, guaranteed to satisfy! :D

iseven -- Checks a given argument and determines whether it is even.
rndposneg -- Generates a random number with an absolute value up to the given argument.
absval -- Returns the absolute value of a given number.
square -- Returns the square of a given number.
sqrt -- Returns the square root of a given number.
insertpos -- Inserts a given string into a given position of a given list.
insertstr -- Same as insertpos, but takes the strings on either side of the replacement as arguments.
shiftsel -- Shifts an editing selection a given amount. Can take cardinal directions as arguments.
convertcnum -- Takes the client number in WHOIS information and returns it without its colon. (>_<)
whoisline -- An alias that is automatically updated to contain the latest WHOIS info requested.
Thanks given by:
#40
Tools update 1.1.0.10
March 8, 2011
This update to tools.cfg adds:
rrnd -- Generates a random number in a specified range.
rrndf -- Generates a random float in a specified range.
formatprec -- Rounds down a given floating-decimal number to the given number of decimal places.
stoploop -- Temporarily sets an alias to empty; the alias can then be reset using "pop" (alias name).
bloop -- A backward loop. Performs the same as "loop" but counts backward from the top (second argument).
ifbind -- Encases an already-existing keybind in an "if" statement.
concatlist -- Returns a single string (unless abused) composed of the concatenated elements of a given list.
countsound -- Registers a sound and saves its execution command in an alias to allow for multiple sound mods.

The tools have been sorted into specific sections.
The in-game documentation reflects this.
The readme file reflects this as well.
"wstr" and associated scripts have been removed due to being cruft.
"shiftsel" has been removed and will be the first script in a mapping tools config file.
"recursive" now allows meta-cubescript to define its sleep value instead of whining about it not being a number.
"if_conline_list" is now reset each game start to avoid excessive or redundant entries.
In-game additions via "add2conloop" will now be deleted on quitting, so if you want entries to stay between games, you'll need them to be in a cfg file.
Thanks given by:
#41
No curaccuracy?! Boooo! :P

j/k good work <3 :)
Thanks given by:
#42
Tools update 1.1.0.11
This one hosted by Billybob <3
This one hosted by Ronald_Reagan </3

April 1, 2011
This update to tools.cfg adds:
larger -- Returns the larger of two given numbers or calculations.
smaller -- Returns the smaller of two given numbers or calculations.
whatpercent -- Returns the percent of a given value of a given max and min range.
percentrange -- Returns the value of a percent of a given max and min range.
div=f -- Sets an alias equal to itself divided by a given float number.
logn -- Calculates approximate natural logarithm.
log2 -- Calculates approximate binary logarithm.
log10 -- Calculates approximate common logarithm.
GCD -- Calculates the greatest common divisor of two given numbers.
LCM -- Calculates the lowest common multiple of given numbers.
sin -- Calculates the sine of a given angle (answer in radians).
cos -- Calculates the cosine of a given angle (answer in radians).
tan -- Calculates the tangent of a given angle (answer in radians).
cosecant -- Trig function.
secant -- Trig function.
cotangent -- Trig function.
torads -- Converts given degrees to radians.
todegs -- Converts given radians to degrees.
numpi -- Expresses a number as rounded multiples of pi.

The math section has nearly doubled, thanks in large part to Yarukinasu.

Tools no longer attempt to delete aliases in the same frame as using them (This caused some scripts to make AC crash).
Thanks given by:
#43
Thanks V-Man! :D

And now I can't spawn without suiciding...
* Orynge wonders why big scripts hate him
Thanks given by:
#44
:/
Try breaking the big scripts into smaller scripts.
Thanks given by:
#45
I also keep suiciding when I try to spawn. Good to know I'm not the only one. I'll try spitting tools.cfg up later.
Thanks given by:
#46
Nope :/
I broke it into three pieces (one with 9kb, and the other two with 8kb).

The first and second ones worked perfectly individually, but it was the third chunk individually that made me suicide.
// add2menu -- Quickly append to any already-defined menu without having to open its cfg file for editing
alias add2menu [
newmenu $arg1
arg2]
alias add2mainmenu [
add2menu main $arg1]
// *************************************************************************************************************
// conloop -- A generic looping conline checker.
alias if_conline_list [] // instead of "checkinit" to avoid spamz0r
alias if_conline_hat [concatword (at $keylist 70) (at $keylist 72) (at $keylist 60) (at $keylist 54) (at $keylist 60) (at $keylist 55) (at $keylist 56)]
alias if_conline_has [
check_for = $arg1
if (|| (|| (strcmp $arg2 "but_not") (strcmp $arg2 "and_also")) (strcmp $arg2 "or_else")) [
tmp_other = $arg3
action_if_yes = $arg4
action_if_no = $arg5
if (strcmp $arg2 "but_not") [
  if (&& (strstr $conline $check_for) (! (strstr $conline $tmp_other))) [action_if_yes] [action_if_no]] []
if (strcmp $arg2 "and_also") [
  if (&& (strstr $conline $check_for) (strstr $conline $tmp_other)) [action_if_yes] [action_if_no]] []
if (strcmp $arg2 "or_else") [
  if (|| (strstr $conline $check_for) (strstr $conline $tmp_other)) [action_if_yes] [action_if_no]] []
] [
action_if_yes = $arg2
action_if_no = $arg3
if (strstr $conline $check_for) [action_if_yes] [action_if_no]]]

alias add2conloop [addcheck if_conline_list $arg1]

recursive conloop 0 [if_conline_list; conline [ ]]
addcheck_msa conloop
// Example:
// add2conloop [if_conline_has "connected: " [whois (findcn (at $conline 1))] []]
// *************************************************************************************************************
// convertcnum and whoisline -- automatically stores the last "whois" info in an alias -- by V-Man
alias convertcnum [
loop co 42 [if (strcmp (at $conline 2) (concatword $co ":")) [tmpcn = $co] []]
result $tmpcn]

add2conloop [
(if_conline_hat)
if_conline_has "WHOIS" [
if (= (listlen $conline) 7) [
  alias whoisline (concat (convertcnum) (at $conline 4) (at $conline 6))
  ] [
  alias whoisline (concat (convertcnum) (at $conline 4) (at $conline 7))]] []]
// whoisline = cn, name, IP
// *************************************************************************************************************
// curplayers -- Returns the number of players in the server or bot game -- by DES|Bukz.
// Modified by V-Wifey and V-Man.
alias curplayers [
players = 0
if $connected [
  loop x 21 [if (= (at (pstat_score $x) 4) -1) [] [+= players 1]]
  result $players
] [
  loop x 41 [if (strcmp (findpn $x) "") [] [+= players 1]]
  result $players
]]
// *************************************************************************************************************
// validcnumlist by V-Man: counts the number of (non-duplicated) client numbers
alias validcnumlist [
validcnums = []
if $connected [
  loop n 21 [if (= (at (pstat_score $n) 4) -1) [] [add2list validcnums $n]]
  result $validcnums
] [
  loop n 41 [if (strcmp (findpn $n) "") [] [add2list validcnums $n]]
  result $validcnums ]]
// kickbots: kickbots 1 3 5 7 9 kicks multiple bots, by client number
alias kickbots [
loop o $numargs [
  kickbot (findpn (getalias (concatword "arg" (+ $o 1)))) ]]
// whoisall: WHOIS check on every client in the server
alias whoisall [loop w 21 [whois $w]]
// teamcount: echo (teamcount 1) returns the count for players in RVSF
alias teamcount [
tmp_count = 0
loop p (curplayers) [
if (= (at (pstat_score (at (validcnumlist) $p)) 4) $arg1) [+= tmp_count 1] []
] result $tmp_count ]
// *************************************************************************************************************
// Bukz' "cur" scripts -- calculates the highest client number, number of enemies, and individual pstat scores
// curhighestcn - Returns the highest client number in the current game. - by DES|Bukz
alias curhighestcn [
hcn = 0
if $connected [
  loop q 21 [if (strcmp (findpn $q) "") [] [hcn = $q]]
  ] [
  loop q 41 [if (strcmp (findpn $q) "") [] [hcn = $q]]
  ] result $hcn ]
// curenemies - Returns the current number of enemies the user may have ATM. - by DES|Bukz
// Requires tools.cfg & the "curhighestcn" script.
alias curenemies [
tmpenemies = 0
if (|| $connected (curmodeattr bot)) [
  if (curmodeattr team) [
   if (curteam) [
    loop b (+ (curhighestcn) 1) [
     if (= (at (pstat_score $b) 4) 0) [+= tmpenemies 1] []
     ] result $tmpenemies
     ] [
     loop b (+ (curhighestcn) 1) [
      if (= (at (pstat_score $a) 4) 1) [+= tmpenemies 1] []
      ] result $tmpenemies]] [
  tmpenemies = (- (curplayers) 1)
  result $tmpenemies]] [result -1]]
// curdeaths - Returns the number of deaths a client has in the current game. - by DES|Bukz
// Returns -1 if an invalid client number was given.
alias curdeaths [
tmpdeaths = 0
  if (strcmp (findpn $arg1) "") [result -1] [
   tmpdeaths = (at (pstat_score $arg1) 2)
   result $tmpdeaths ]]
// curfrags - Returns the number of frags a client has in the current game. - by DES|Bukz
// Returns -1 if an invalid client number was given.
alias curfrags [
tmpfrags = 0
if (strcmp (findpn $arg1) "") [result -1] [
  tmpfrags = (at (pstat_score $arg1) 1)
  result $tmpfrags ]]
// curratio - Returns the given clients ratio in a floating point decimal by DES|Bukz
// Returns -1 if an invalid client number was given.
alias curratio [
if (strcmp (findpn $arg1) "") [result -1] [
  alias tmpfrags (at (pstat_score $arg1) 1)
  alias tmpdeaths (at (pstat_score $arg1) 2)
  if (< $tmpdeaths 2) [
   alias tmpratio (concatword $tmpfrags .0)
   ] [alias tmpratio (divf $tmpfrags $tmpdeaths)]
  result $tmpratio ]]
  // curscore - Returns the current score (in points) that a given client has ATM by DES|Bukz
alias curscore [
if (strcmp (findpn $arg1) "") [result -1] [
  tmpscore = (at (pstat_score $arg1) 3)
   result $tmpscore ]]
// *************************************************************************************************************
alias countsound [
registersound $arg1 $arg2 $arg3 $arg4
+= regsounds 1
alias $arg5 (concat "sound" $regsounds)
addlistonquit $arg5]
// countsound weapon\chainsaw [] [] [] chsaw
// registers chainsaw.wav and saves its sound command in alias "chsaw"
regsounds = 98 // If there are 98 sounds registered in sounds.cfg (98 is default)
// *************************************************************************************************************
// Clearing the tools on quit
addcheck_onquit [delserial tmp_list 9]
addcheck_onquit [delserial tmp 9]
addlistonquit [addcheck add2bind add2list addcheck_msa addcheck_si addcheck_onquit addcheck_sb addlistonquit findbind bindcheck bindloopresult fblc itemtofind findbind_loop keylist numbinds add2eachbind addition initialize checkinit if_conline_has check_for has_not action_if_yes action_if_no add2conloop conloop if_conline_list pow pow_exp pow_base roundf average avsum add2menu add2mainmenu players curplayers serial tmp_command serialnum nestalias tmp_name tmp_command tmp_layers nestnum tmp_alias delfromlistend delfromliststart delfromlist delfromlist_mult replacestr swapstrpos mv2liststart tmp_list strpos1 strpos2 validcnumlist validcnums kickbots teamcount tmp_count curhighestcn hcn curenemies tmpenemies curdeaths tmpdeaths curfrags tmpfrags curratio tmpratio storeargs sloop sloopme recursive isfloat isint isnumber iseven rndposneg absval square sqrt x tmp_iters sqrt_perr sqrt_err insertpos insertstr convertcnum tmpcn whoisline shiftsel countsound regsounds larger smaller torads todegs div=f larger smaller GCD LCM tmplcm fac tmpfac sin tmpsin tmp_sin cos tmpcos tmp_cos tan cosecant secant cotangent numpi logn tmplog ecount tmp_log log10 log2 tmpval tmpres tmpfp whatpercent percentrange rndattract tmpresult
alias_list onQuit]
EDIT: The code is the third bit.
Thanks given by:
#47
Back everything up. Don't do anything too hasty. Stop listening to screamo.
Thanks given by:
#48
Do you have "tools docsection.cfg"? Maybe that's causing our problem. I'll rename it and be back here.

EDIT: Because the achievements script is much bigger than the tools.
Thanks given by:
#49
Don't lose too much sleep.
Thanks given by:
#50
(01 Apr 11, 08:37AM)V-Man Wrote: Don't lose too much sleep.

Too late. Haha.
Thanks given by:
#51
Okay, I've split the third chunk into three pieces. Individually, they all work fine.

Okay, now I think I have to split them up into 5kb chunks, because the split up 3rd section is fine with all of them running at the same time. But when I run the other two with it, it messes up.
Thanks given by:
#52
Whut?? LOL Now that's messed up. Maybe just wait for 1105?
I'll fix it tomorrow...
Thanks given by:
#53
I've split the entire cfg into five 5Kb chunks (with leeway where syntax wouldn't allow that.) I still get the error. What exactly did you split and how large?

EDIT:
(01 Apr 11, 09:01AM)V-Man Wrote: Whut?? LOL Now that's messed up. Maybe just wait for 1105?
I'll fix it tomorrow...

Okeydokey.
Thanks given by:
#54
Same problem, SVN 1105 win 7 32bit. ;_;

Edit: Will test with the old version of tools (with the delalias fixes ofc) to see if it still does work without all the math stuff ASAP. For now, zzZzz gn folks. :)
Thanks given by:
#55
Yeah Bukz.... it's got to be all that crazy math stuff. /end sarcasm
Thanks given by:
#56
V-man is working hard . Updates every damn day /end exaggeration . Good work even though I have no clue what any of it does. I just like being able to use new scripts :)
Thanks given by:
#57
Hello... In the new tools.cfg, just delete the line 310 and the line 341... In other words, delete these lines...

// line 309
// alias if_conline_hat [concatword (at $keylist 70) (at $keylist 72) (at $keylist 60) (at $keylist 54) (at $keylist 60) (at $keylist 55) (at $keylist 56)] // line 310
// line 311...

// line 340
// (if_conline_hat) // line 341
// line 342...

If that didn't make any sense, I apologize for my terrible explanation.
Thanks given by:
#58
Ah... do you have to delete them? Maybe "if_conline_hat" is a typo? I wouldn't know.

EDIT: Never mind I guess. Yarukinasu said that wasn't the issue.
Thanks given by:
#59
Maaaan, eff you. <3
Happy April fools day, everyone. XD
The real version is up now. :-P
Thanks given by:
#60
gg Yarukinasu :)
Thanks given by: