Posts: 502
Threads: 20
Joined: Dec 2010
(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.
Posts: 3,462
Threads: 72
Joined: Jun 2010
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.
Posts: 1,331
Threads: 44
Joined: Jun 2010
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
Posts: 3,780
Threads: 33
Joined: Jun 2010
Fixed. Thanks Bukz.
Okay, NOW go get the new version! XD
Thanks for posting for me, Ron.
Posts: 1,331
Threads: 44
Joined: Jun 2010
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)
Posts: 3,780
Threads: 33
Joined: Jun 2010
:O
I should have thought of that. Good idea.
Posts: 3,780
Threads: 33
Joined: Jun 2010
16 Feb 11, 06:28PM
(This post was last modified: 16 Feb 11, 07:50PM by V-Man.)
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!
Posts: 1,823
Threads: 20
Joined: Jun 2010
16 Feb 11, 10:12PM
(This post was last modified: 16 Feb 11, 10:12PM by Gibstick.)
V-Man stop double post
I mean, GJ.
Posts: 3,780
Threads: 33
Joined: Jun 2010
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.
Posts: 3,780
Threads: 33
Joined: Jun 2010
09 Mar 11, 09:34AM
(This post was last modified: 09 Mar 11, 09:41AM by V-Man.)
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.
Posts: 1,331
Threads: 44
Joined: Jun 2010
No curaccuracy?! Boooo! :P
j/k good work <3 :)
Posts: 3,780
Threads: 33
Joined: Jun 2010
01 Apr 11, 07:04AM
(This post was last modified: 01 Apr 11, 07:12AM by Ronald_Reagan.)
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).
Posts: 2,067
Threads: 11
Joined: Jun 2010
01 Apr 11, 07:29AM
(This post was last modified: 01 Apr 11, 07:33AM by Orynge.)
Thanks V-Man! :D
And now I can't spawn without suiciding...
* Orynge wonders why big scripts hate him
Posts: 3,780
Threads: 33
Joined: Jun 2010
:/
Try breaking the big scripts into smaller scripts.
Posts: 502
Threads: 20
Joined: Dec 2010
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.
Posts: 2,067
Threads: 11
Joined: Jun 2010
01 Apr 11, 08:27AM
(This post was last modified: 01 Apr 11, 08:28AM by Orynge.)
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.
Posts: 3,780
Threads: 33
Joined: Jun 2010
Back everything up. Don't do anything too hasty. Stop listening to screamo.
Posts: 502
Threads: 20
Joined: Dec 2010
01 Apr 11, 08:33AM
(This post was last modified: 01 Apr 11, 08:35AM by eftertanke.)
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.
Posts: 3,780
Threads: 33
Joined: Jun 2010
Don't lose too much sleep.
Posts: 502
Threads: 20
Joined: Dec 2010
(01 Apr 11, 08:37AM)V-Man Wrote: Don't lose too much sleep.
Too late. Haha.
Posts: 2,067
Threads: 11
Joined: Jun 2010
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.
Posts: 3,780
Threads: 33
Joined: Jun 2010
Whut?? LOL Now that's messed up. Maybe just wait for 1105?
I'll fix it tomorrow...
Posts: 502
Threads: 20
Joined: Dec 2010
01 Apr 11, 09:01AM
(This post was last modified: 01 Apr 11, 09:02AM by eftertanke.)
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.
Posts: 1,331
Threads: 44
Joined: Jun 2010
01 Apr 11, 09:30AM
(This post was last modified: 01 Apr 11, 09:36AM by Bukz.)
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. :)
Posts: 38
Threads: 1
Joined: Mar 2011
Yeah Bukz.... it's got to be all that crazy math stuff. /end sarcasm
Posts: 150
Threads: 54
Joined: Nov 2010
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 :)
Posts: 25
Threads: 0
Joined: Dec 2010
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.
Posts: 502
Threads: 20
Joined: Dec 2010
02 Apr 11, 05:42AM
(This post was last modified: 02 Apr 11, 05:46AM by eftertanke.)
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.
Posts: 3,780
Threads: 33
Joined: Jun 2010
Maaaan, eff you. <3
Happy April fools day, everyone. XD
The real version is up now. :-P
Posts: 38
Threads: 1
Joined: Mar 2011
|