diff options
author | Emistry Haoyan <equinox1991@gmail.com> | 2019-05-14 23:44:20 +0800 |
---|---|---|
committer | Emistry Haoyan <equinox1991@gmail.com> | 2019-05-14 23:44:20 +0800 |
commit | 1f9c83ef453741b7029b5706c7cd52edc7ce9039 (patch) | |
tree | 2f97f8e9ab5f62476fb3c18d80e02023d9a8d3e4 /doc | |
parent | 647a3d2513746a17636bea354ad5a56c1db853e1 (diff) | |
download | hercules-1f9c83ef453741b7029b5706c7cd52edc7ce9039.tar.gz hercules-1f9c83ef453741b7029b5706c7cd52edc7ce9039.tar.bz2 hercules-1f9c83ef453741b7029b5706c7cd52edc7ce9039.tar.xz hercules-1f9c83ef453741b7029b5706c7cd52edc7ce9039.zip |
Add *cap_value script command
- add `cap_value(value, min, max)` script command.
- avoid the ugly nested `min()` and `max()` combo if needed.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/script_commands.txt | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/doc/script_commands.txt b/doc/script_commands.txt index 516454365..2cbeff37b 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -8536,6 +8536,18 @@ Example: --------------------------------------- +*cap_value(<number>, <min>, <max>) + +Returns the number but capped between <min> and <max>. + +Example: + // capped between 0 ~ 100 + .@value = cap_value(10, 0, 100); // .@value will be equal to 10 + .@value = cap_value(1000, 0, 100); // .@value will be equal to 100 + .@value = cap_value(-10, 3, 100); // .@value will be equal to 3 + +--------------------------------------- + *md5("<string>") Returns the md5 checksum of a number or string. |