summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-02-11 10:40:52 +0000
committerFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-02-11 10:40:52 +0000
commita24b7ddbd3dcc44f9a158414340283b2aa25ff6d (patch)
tree4de4a7ee7a8003650a828dff3b5101963d5d90fe /doc
parent1142aaf9e81d4532aa3f49fbc4a69a8a53976999 (diff)
downloadhercules-a24b7ddbd3dcc44f9a158414340283b2aa25ff6d.tar.gz
hercules-a24b7ddbd3dcc44f9a158414340283b2aa25ff6d.tar.bz2
hercules-a24b7ddbd3dcc44f9a158414340283b2aa25ff6d.tar.xz
hercules-a24b7ddbd3dcc44f9a158414340283b2aa25ff6d.zip
* Expanded the script command 'input': (bugreport:811)
- two new optional arguments 'min' and 'max' - return value indicating if it's in the correct range - config variables for the default value of the arguments: 'input_min_value' and 'input_max_value' in script_athena.conf git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12192 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'doc')
-rw-r--r--doc/script_commands.txt21
1 files changed, 15 insertions, 6 deletions
diff --git a/doc/script_commands.txt b/doc/script_commands.txt
index 1a9987587..865b82fe6 100644
--- a/doc/script_commands.txt
+++ b/doc/script_commands.txt
@@ -4,7 +4,7 @@
//= A reference manual for the eAthena scripting language.
//= Commands are sorted depending on their functionality.
//===== Version ===========================================
-//= 3.12.20071227
+//= 3.14.20080211
//=========================================================
//= 1.0 - First release, filled will as much info as I could
//= remember or figure out, most likely there are errors,
@@ -97,6 +97,8 @@
//= Corrected description of scope and npc variables. [FlavioJS]
//= 3.13.20080104
//= Updated 'setcell' desc to match latest code changes [ultramage]
+//= 3.14.20080211
+//= Updated 'input' (new arguments and return value). [FlavioJS]
//=========================================================
This document is a reference manual for all the scripting commands and functions
@@ -1303,7 +1305,7 @@ the Cancel button, this function will return 255 instead.
---------------------------------------
-*input <variable>;
+*input(<variable>{,<min>{,<max>}})
This command will make an input box pop up on the client connected to the
invoking character, to allow entering of a number or a string. This has many
@@ -1349,11 +1351,18 @@ allow the player to enter text. Otherwise, only numbers will be allowed.
close;
}
-Notice that in current SVN, you may not input a negative number with this
-command. This was done to prevent exploits in badly written scripts, which would
+Normally you may not input a negative number with this command.
+This is done to prevent exploits in badly written scripts, which would
let people, for example, put negative amounts of zeny into a bank script and
-receive free zeny as a result. Unfortunately it limits the uses of the 'input'
-command quite a bit.
+receive free zeny as a result.
+
+Since trunk r12192 the command has two optional arguments and a return value.
+The default value of 'min' and 'max' can be set with 'input_min_value' and
+'input_max_value' in script_athena.conf.
+For numeric inputs the value is capped to the range [min,max]. Returns 1 if
+the value was higher than 'max', -1 if lower than 'min' and 0 otherwise.
+For string inputs it returns 1 if the string was longer than 'max', -1 is
+shorter than 'min' and 0 otherwise.
---------------------------------------