Script Functions.
[API Functions]

These functions allow the manipulation of scripts. More...

Functions

F2LINK unsigned int F2CALL f2_script_enum (unsigned int *sids, unsigned int len)
 Enumerates the script ids of all running scripts.
F2LINK unsigned int F2CALL f2_script_argv (unsigned int sid, const char **argv, unsigned int len, int *flags)
 Retrieves the run arguments and flags for a running script.
F2LINK Script_Error F2CALL f2_script_run (const char **argv, unsigned int len, int flags, unsigned int *sid)
 Runs a script.
F2LINK Script_Error F2CALL f2_script_kill (unsigned int sid)
 Kills a running script.

Detailed Description

These functions allow the manipulation of scripts.


Function Documentation

F2LINK unsigned int F2CALL furn2::f2_script_argv ( unsigned int  sid,
const char **  argv,
unsigned int  len,
int *  flags 
)

Retrieves the run arguments and flags for a running script.

Parameters:
[in] sid The script ID.
[out] argv Array of CONSTANT pointers to fill with string addresses.
[in] len Length of the argv array.
[out] flags int buffer to be filled with run flags. May be NULL.
Returns:
The number of pointers copied to the argv array.
Remarks:
If argv is NULL, the function copies the flags and returns the number of total arguments.

F2LINK unsigned int F2CALL furn2::f2_script_enum ( unsigned int *  sids,
unsigned int  len 
)

Enumerates the script ids of all running scripts.

Parameters:
[out] sids int array to fill with script ids.
[in] len Length of the sids array.
Returns:
The number of sids copied to the sids array.
Remarks:
If sids is NULL, nothing is copied and the function returns the number of running scripts.

F2LINK Script_Error F2CALL furn2::f2_script_kill ( unsigned int  sid  ) 

Kills a running script.

Parameters:
[in] sid The script ID.
Returns:
An error code.
See also:
Script_Error

F2LINK Script_Error F2CALL furn2::f2_script_run ( const char **  argv,
unsigned int  len,
int  flags,
unsigned int *  sid 
)

Runs a script.

Parameters:
[in] argv Run arguments.
[in] len Length of the argv array.
[in] flags Run flags.
[out] sid int buffer to be filled with the created script's script id. May be NULL.
Returns:
An error code.
Remarks:
The first string in the argv array is the script's name. All other strings are arguments passed to the script when it executes. If the SCRIPTRUN_UNIQUE flag is set and a copy of the script with the same arguments is already running, a SCRIPT_NOTUNIQUE error will be returned.

Note that you won't always get a SCRIPT_FAILED error when the script fails because scripts are only loaded and executed immediately if the player is in a logged in state. All other times, they are suspended.

See also:
Script_Error Script_RunFlags


Generated on Tue Jun 24 12:24:07 2008 for Furnarchy Module by  doxygen 1.5.5