User Tools

Site Tools


scripting:functions_custom_events_overview

This is an old revision of the document!


Functions

Functions are defined in your script as shown in this example:

<codedoc> Function IsItemASword( $itemNum ) {

if ( $itemNum = 112 )		// Sword
{
	return( 1 )
}
else if ( $itemNum = 113 )	// Sword 2	
      {
	return( 1 )
}
return( 0 )

} </codedoc>

This example function would be called from another part of your script like this: <codedoc>

$isSword = IsItemASword( $gTaskItem1 )

</codedoc>

Functions can have any number of parameters, and always return a value.

scripting/functions_custom_events_overview.1332700527.txt.gz · Last modified: (external edit)