Functions relating to Sim.
| int getEventTimeLeft |
( |
eventID |
| ) |
|
Use the getEventTimeLeft function to determine how much time remains until the event specified by eventID occurs.
- Parameters
-
| eventID | The 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
-
| eventID | The 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
-
| eventID | The 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
-
| eventID | The 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
Use the isObject function to check if the name or ID specified in handle is a valid object.
- Parameters
-
| handle | A 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
-
| objectName | A 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 |
( |
t |
, |
|
|
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
-
| t | The time to wait (in milliseconds) before executing functionName. |
| objID | An optional ID to associate this event with. |
| functionName | An 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