[Crossfire-wiki] [Crossfire DokuWiki] page changed: client_side_scripting:client_scripting_interface-basic_howto

no-reply_wiki at metalforge.org no-reply_wiki at metalforge.org
Fri Aug 2 14:08:43 CDT 2013


A page in your DokuWiki was added or changed. Here are the details:

Date        : 2013/08/02 14:08
User        : katia
Edit Summary: usage of watch to get request's results

@@ -166,8 +166,9 @@
  Wow! This mean we know when food is low and we can ask our script to invoke restoration (remember the __issue__ command?) when our character's food gets below 50! No starvation anymore.
  
  ===== What's next? =====
  There are two things you can still do with Script. The first is to request a bit of informations. The client then tells the script what it wants to know. The second thing is triggering an action of the script from client interface. The command scripttell allows player to say something to a script. The script will get the exact command typed by player. See below for command list.
+ 
  
  ==== Commands to client ====
  Here is a list of command the script can send to client.
  
@@ -194,14 +195,16 @@
  | map near | Return the 3x3 grid of the map centered on the player |
  | map all | Return all the known map information |
  | map <x> <y> | Return the information about square x,y in the current map (relative to player position)|
  </box>
+ 
+ :!: in order to get the result of the request into your script's stdin you have to "watch request <data type>" before you do the request.
  
    * //issue <repeat> <must_send> <command>// - send <command> to server on behalf of client. <repeat> is the number of times to execute command <must_send> tells whether or not the command must sent at all cost (1 or 0). <repeat> and <must_send> are optional parameters. See [[#The Issue Command]] for more details.
    * //issue mark <tag>// - special case of issue command. only gets the command 'mark' and a object tag
    * //issue lock <new state> <tag>// - special case of issue command. Only gets the command 'lock' with 2 parameters
-   * //draw <color> <text>// - draw the following text on client interface with given color. Usefull for debugging and may help you to forget about using the stderr
-   * //monitor// - start monitoring commands send from client to server. Doesn't take any parameter.
+   * //draw <color> <text>// - draw the following text on client interface with given color. Usefull for debugging and may help you to forget about using the stderr.
+   * //monitor// - start monitoring commands send from client to server. Doesn't take any parameter. This goes to the script's stdin automatically.
    * //unmonitor// - stop monitoring commands send from client to server. Doesn't take any parameter.
  
  ==== Information from client ====
  Here is an incomplete list of information strings send by client to script. Those informations are sent only because the client asked them, except for scripttell.


IP-Address  : 186.52.76.19
Old Revision: http://wiki.metalforge.net/doku.php/client_side_scripting:client_scripting_interface-basic_howto?rev=1355407642
New Revision: http://wiki.metalforge.net/doku.php/client_side_scripting:client_scripting_interface-basic_howto

-- 
This mail was generated by DokuWiki at
http://wiki.metalforge.net/



More information about the crossfire-wiki mailing list