
Prototype: GemRB.ExecuteString(String[,Slot])

Description: Executes an In-Game Script Action in the current Area Script Context. This means that LOCALS will be treated as the current area's variable.

Parameters: String - a gamescript action
            Slot   - a player slot
Return value: N/A

Example:
 GemRB.ExecuteString("ActionOverride([PC], Attack(NearestEnemyOf(Myself)) )")

The above example will force a player (most likely Player1) to attack an enemy, issuing the command as it would come from the current area's script. The current gametype must support the scripting action.

 GemRB.ExecuteString("Attack(NearestEnemyOf(Myself))", 2)

The above example will force Player2 to attack an enemy, as the example will run in that actor's script context.

See also: EvaluateString, gamescripts

