Both sides previous revisionPrevious revisionNext revision | Previous revision |
client_side_scripting:client_scripting_interface-basic_howto [2021/04/11 16:58] – Reorganize top partmedia | client_side_scripting:client_scripting_interface-basic_howto [2025/07/16 13:10] (current) – scriptkillall is now available in the GTK client partmedia |
---|
* ''scripttell <id> <string>'': send text to currently running script <id> | * ''scripttell <id> <string>'': send text to currently running script <id> |
* ''scriptkill <id>'': stop currently running script <id> | * ''scriptkill <id>'': stop currently running script <id> |
* ''scriptkillall'' (JXClient only): stop all currently running scripts | * ''scriptkillall'': stop all currently running scripts |
| * JXClient only: |
| * Unique alphanumeric substrings of <path> may be used as <id> so that script names may be used in lieu of numbers |
===== Writing Scripts ===== | ===== Writing Scripts ===== |
The script must be executable (e.g. ''chmod +x'' with an appropriate shebang). For some languages, it may be necessary to write a wrapper script to start the program. Additionally, on Windows systems where the shebang is not supported, the player must provide a means of running such a script. For example ''script python <path-to-script>'' if you are using python. | The script must be executable (e.g. ''chmod +x'' with an appropriate shebang). For some languages, it may be necessary to write a wrapper script to start the program. Additionally, on Windows systems where the shebang is not supported, the player must provide a means of running such a script. For example ''script python <path-to-script>'' if you are using python. |
The ''issue'' interface command runs a given command as if a user typed it into the command window. It takes 3 arguments: //repeat//, the number of times to repeat the command (typically used for dropping items); //must_send//, an integer either zero or one; and //command//, the command to execute. | The ''issue'' interface command runs a given command as if a user typed it into the command window. It takes 3 arguments: //repeat//, the number of times to repeat the command (typically used for dropping items); //must_send//, an integer either zero or one; and //command//, the command to execute. |
| |
| ==== Environment ==== |
| |
| Scripts have access to the following environment variables: |
| |
| * CF_PLAYER_NAME |
| * CF_SERVER_NAME |
| |
==== Monitoring ==== | ==== Monitoring ==== |