Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Depawns the current group.

Arguments: f(Immediately)->

Parameters:

...

 If the group does not despawn immediately it will wait until it is idle, e.g. not fighting or fleeing, to despawn.

...

 

Arguments: f(Immediately)->

Parameters:

[in]
Immediately0 or 1, with 1 indicating an immediate despawn
Code Block
()despawn(0); // despawn group.
()despawn(1); // immediately despawn the group.

...

Registers a trigger on HP increases. Whenever the HP level of a bot crosses the threshold upwards it will trigger the specified user event. The treshold threshold is a factor of the total HP. Several triggers can be registered on the same group, even with the same threshold and event.

Arguments: f(Threshold),f(user_event_n)->

Parameters:

[in]
Threshold

...

the HP threshold factor
[in]
user_event_nthe user event to trigger
Code Block
()addHpUpTrigger(0.5, 4); // emit user event 4 if a bot increases HP by 50%

 

addHpDownTrigger_ff_

Registers a trigger on HP decreases. Whenever the HP level of a bot crosses the threshold downwards it will trigger the specified user event. The threshold is a factor of the total HP. Several triggers can be registered on the same group, even with the same threshold and event.

Arguments: f(Threshold),f(user_event_n

...

)->

Parameters:

[in]
Thresholdthe HP threshold factor
[in]
user_event_nthe user event to trigger

...

Code Block
()addHpUpTrigger(0.5, 45); // emit user event 45 if a bot increasesdecreases HP by 50%

 

delHpUpTrigger_ff_

...

Arguments: f(Threshold),f(user_event_n)->

Parameters:

[in]
Thresholdthe HP threshold factor
[in]
user_event_nthe user event to trigger
Code Block
()delHpUpTrigger(0.5, 4);

 

...

delHpDownTrigger_ff_

Unregisters a trigger on HP decreases for any triggers matching both the Threshold and user_event_n parameters.

Arguments: f(Threshold),f(user_event_n)->

Parameters:

[in]
Thresholdthe HP threshold factor
[in]
user_event_nthe user event to trigger
Code Block
()delHpDownTrigger(0.5, 4);

 

...

 

addHpUpTrigger_fs_

Registers a trigger on HP increases. Whenever the HP level of a bot crosses the threshold upwards it will trigger the specified script function. The threshold is a factor of the total HP. Several triggers can be registered on the same group, even with the same threshold and function.

Arguments: f(Threshold),s(Callback)->

Parameters:

[in]
Thresholdthe HP threshold factor
[in]
Callbackthe script callback to trigger
Code Block
()addHpUpTrigger(0.5, "onHPIncrease"); // call script function onHPIncrease if a bot increases HP by 50%

 

addHpDownTrigger_fs_

Registers a trigger on HP decreases. Whenever the HP level of a bot crosses the threshold downwards it will trigger the specified script function. The threshold is a factor of the total HP. Several triggers can be registered on the same group, even with the same threshold and function.

Arguments: f(Threshold),s(Callback)->

Parameters:

[in]
Thresholdthe HP threshold factor
[in]
Callbackthe script callback to trigger
Code Block
()addHpUpTrigger(0.5, "onHPDecrease"); // call script function onHPDecrease if a bot decreases HP by 50%

 

delHpUpTrigger_fs_

Unregisters a trigger on HP increases for any triggers matching both the Threshold and Callback parameters.

Arguments: f(Threshold),s(Callback)->

Parameters:

[in]
Thresholdthe HP threshold factor
[in]
Callbackthe script callback to be triggered
Code Block
()delHpUpTrigger(0.5, 4"onHPIncrease");

 

delHpDownTrigger_fs_

Unregisters a trigger on HP decreases for any triggers matching both the Threshold and Callback parameters.

Arguments: f(Threshold),s(Callback)->

Parameters:

[in]
Thresholdthe HP threshold factor
[in]
Callbackthe user event to trigger
Code Block
()delHpDownTrigger(0.5, "onHPDecrease");

addNamedEntityListener_ssf_

Associates a listener with a named entity property. Whenever that field changes the specified user event is triggered. Valid property names are:

  • state
  • param1
  • param2

The name of the entity cannot be listened to because it cannot change. Several listeners (even with the same parameters) can be associated to each property. 

Arguments: s(Name),s(Property),f(user_event_n)->

Parameters:

[in]
Namethe name of the named entity to listen to
[in]
Propertythe property of the named entity to listen to
[in]
user_event_nthe user event to trigger
Code Block
 ()addNamedEventListener("Invasion", "state", 6);