Main   GitHub

Functions
SimFunctions

Functions

void cancel (eventID)
 
int getEventTimeLeft (eventID)
 
int getScheduleDuration (eventID)
 
int getTimeSinceStart (eventID)
 
bool isEventPending (eventID)
 
bool isObject (handle)
 
int nameToID (objectName)
 
int schedule (t, objID||0, functionName, arg0,..., argN)
 

Detailed Description

Functions relating to Sim.

Function Documentation

void cancel ( eventID  )

Use the cancel function to cancel a previously scheduled event as specified by eventID.

Parameters
eventIDThe numeric ID of a previously scheduled event.
Returns
No return value.
See Also
getEventTimeLeft, getScheduleDuration, getTimeSinceStart, isEventPending, schedule, obj.schedule
int getEventTimeLeft ( eventID  )

Use the getEventTimeLeft function to determine how much time remains until the event specified by eventID occurs.

Parameters
eventIDThe numeric ID of a previously scheduled event.
Returns
Returns a non-zero integer value equal to the milliseconds until the event specified by eventID will occur. However, if eventID is invalid, or the event has passed, this function will return zero.
See Also
cancel, getScheduleDuration, getTimeSinceStart, isEventPending, schedule, obj.schedule
int getScheduleDuration ( eventID  )

Use the getScheduleDuration function to determine how long the event associated with eventID was scheduled for.

Parameters
eventIDThe numeric ID of a previously scheduled event.
Returns
Returns a non-zero integer value equal to the milliseconds used in the schedule call that created this event. However, if eventID is invalid, this function will return zero.
See Also
cancel, getEventTimeLeft, getTimeSinceStart, isEventPending, schedule, obj.schedule
int getTimeSinceStart ( eventID  )

Use the getTimeSinceStart function to determine how much time has passed since the event specified by eventID was scheduled.

Parameters
eventIDThe numeric ID of a previously scheduled event.
Returns
Returns a non-zero integer value equal to the milliseconds that have passed since this event was scheduled. However, if eventID is invalid, or the event has passed, this function will return zero.
See Also
cancel, getEventTimeLeft, getScheduleDuration, isEventPending, schedule, obj.schedule
bool isEventPending ( eventID  )

Use the isEventPending function to see if the event associated with eventID is still pending. When an event passes, the eventID is removed from the event queue, becoming invalid, so there is no discnerable difference between a completed event and a bad event ID.

Parameters
eventIDThe numeric ID of a previously scheduled event.
Returns
Returns true if this event is still outstanding and false if it has passed or eventID is invalid.
See Also
cancel, getEventTimeLeft, getScheduleDuration, getTimeSinceStart, schedule, obj.schedule
bool isObject ( handle  )

Use the isObject function to check if the name or ID specified in handle is a valid object.

Parameters
handleA name or ID of a possible object.
Returns
Returns true if handle refers to a valid object, false otherwise
int nameToID ( objectName  )

Use the nameToID function to convert an object name into an object ID. This function is a helper for those odd cases where a string will not covert properly, but generally this can be replaced with a statement like: ("someName")

Parameters
objectNameA string containing the name of an object.
Returns
Returns a positive non-zero value if the name corresponds to an object, or a -1 if it does not.
int schedule ( ,
objID||  0,
functionName  ,
arg0  ,
  ...,
argN   
)

Use the schedule function to schedule functionName to be executed with optional arguments at time t (specified in milliseconds) in the future. This function may be associated with an object ID or not. If it is associated with an object ID and the object is deleted prior to this event occurring, the event is automatically canceled.

Parameters
tThe time to wait (in milliseconds) before executing functionName.
objIDAn optional ID to associate this event with.
functionNameAn unadorned (flat) function name.
arg0,..,argN- Any number of optional arguments to be passed to functionName.
Returns
Returns a non-zero integer representing the event ID for the scheduled event.
See Also
cancel, getEventTimeLeft, getScheduleDuration, getTimeSinceStart, isEventPending, obj.schedule


Copyright © 2013 GarageGames, LLC. All Rights Reserved.