regping( sectionname, priority )


Parameters

  Type Description
sectionname section name of a section
priority numeric event priority

_result

Not set.

Descriptions

Registers the section specified by sectionname to handle ping events. The ping event handler is called if no higher priority events are occurring when a robot is scanned by another robot's radar.  

Ping events are triggered by the _ping variable. When a ping event handler completes, the _ping variable is automatically set to false causing the event to end. When a robot is scanned by another robot the following system variables are updated to provide information about the ping: _pingbearing, _pingheading,  and _pingfriendly. Robots only track information about the most recent ping event, causing all _ping variables to be reset for each ping.  

The priority value should be a whole number, decimals are ignored. Lower numbers are higher priority. The highest priority possible is 1. If two events registered with the same priority occur at the same time, it is unspecified which event handler will be called. 

When an event handler is registered or re-registered, it becomes immediately active. Use the pingevents command to temporarily deactivate a registered event handler.

See Also

pingevents, _ping, _pingbearing, _pingheading_pingfriendly, event summary