User Tools

Site Tools


client_side_scripting:client_scripting_interface-basic_howto_staging

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
client_side_scripting:client_scripting_interface-basic_howto_staging [2021/08/11 12:51]
boingman
client_side_scripting:client_scripting_interface-basic_howto_staging [2021/08/26 13:42] (current)
boingman
Line 4: Line 4:
 ===== A Note on Newlines ===== ===== A Note on Newlines =====
 All newline characters used in the scripting interface consist of the singular "​\n"​ (decimal 10, hexadecimal 0x0a) character, aka Unix-style newlines. No other newline schemes are supported by the interface. A note to Windows users: Simple printline code or a .bat file echo command will not work. All newline characters used in the scripting interface consist of the singular "​\n"​ (decimal 10, hexadecimal 0x0a) character, aka Unix-style newlines. No other newline schemes are supported by the interface. A note to Windows users: Simple printline code or a .bat file echo command will not work.
 +
 +======= Existing Format ======
 +
 +==== Commands to client ====
 +Here is a list of command the script can send to client.
 +
 +  * //watch <command type>// - watch the given command from server-client protocol. <command type> specifies the commands we want to watch. Set to empty to get all commands.
 +    * Besides what is already documented, watch also supports "​tick",​ "​drawextinfo"​ (for most servers), and "​drawinfo"​ (for very old servers)
 +    * The "​tick"​ argument will provide the script with "watch tick <​integer>",​ as a tick of the server'​s clock.
 +    * "​drawextinfo"​ provide the script with text printed in the Messages text area. The format is "watch drawextinfo <​integer>​ <​integer>​ <​message>"​. For some very old servers (none of them which are online at the time of writing), "​drawextinfo"​ is not supported and you must fall back to "​drawinfo",​ which has the arguments "watch drawinfo <​integer>​ <​message>"​.
 +  * //unwatch <command type>// - unwatch the given command from server-client protocol. <command type> specifies the commands we want to watch. Set to empty to get all commands.
 +  * //request <data type>// - Request a piece of information from client memory. Following is a table of <data type> allowed:
 +
 +^ Data Type ^ Comment ^
 +| range  ​   | Return the type and name of the currently selected range attack |
 +| stat <​type> ​    | Return the specified stats |
 +| stat stats | Return Str,​Con,​Dex,​Int,​Wis,​Pow,​Cha |
 +| stat cmbt | Return wc,​ac,​dam,​speed,​weapon_sp |
 +| stat hp | Return hp,​maxhp,​sp,​maxsp,​grace,​maxgrace,​food |
 +| stat xp | Return level,​xp,​skill-1 level,​skill-1 xp,... |
 +| stat resists | Return resistances |
 +| weight | Return maxweight, weight |
 +| flags | Return flags (fire, run) |
 +| items inv | Return a list of items in the inventory, one per line |
 +| items actv | Return a list of inventory items that are active, one per line |
 +| items on | Return a list of items under the player, one per line |
 +| items cont | Return a list of items in the open container, one per line |
 +| map pos | Return the players x,y within the current map |
 +| 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)|
 +| player ​     | Return the player'​s tag and title |
 +| skills ​     | Return a list of all skill names, one per line (see also stat xp) |
 +| spells ​     | Return a list of known spells, one per line |
 +| stat paths  | Return spell paths: attuned, repelled, denied |
 +
 +Note: player, skills, spells, stat path were added between versions 1.11 and 1.50 of the GTK2 client.\\
 +
  
 ======= Unfinished Business ====== ======= Unfinished Business ======
  
-*** Request Commands ***+==== The "​request stat <​type>"​ command ====
  
-VERIFIED +^ Stat Type ^ Comment ^ 
-Send: "​request ​flags" +flags | Return ​"​request flags <​firing>​ <​running>​ <gtk-compat/obsolete?>" where values ​are integers 1 and 0 for true and false, respectively,​ and indicate whether or not a player is currently firing or running. ​FIXME: Verify obsolesence | 
-Format: ​request flags <​firing>​ <​running>​ <​obsolete-ignore- FIXME: Verify obsolesence + 
-Note: Values ​are integers 1 and 0 for true and false, respectively,​ and indicate whether or not a player is currently firing or running.+*** Request Commands ***
  
 VERIFIED VERIFIED
client_side_scripting/client_scripting_interface-basic_howto_staging.txt · Last modified: 2021/08/26 13:42 by boingman