filtertarget
The filtertarget command is used to filter targets from the block's target list. Keep in mind, values that MATCH the comparison will be filtered from the list.



"then(filtertarget,comparison, method of comparison, value)"


Argument Function
comparison The type of comparison being done. (See table)
method of comparison The method in which the value is being compared (>, <, =, >=, <=).
value The value being compared.



Comparison Description
health The health of the targets being filtered.
distance The distance to the target being filtered. (From the middle of the block.)
leader Whether or not the enemy is a leader or not. (Enemies only!) (Use true/false, and only compare with "=")
sight Whether or not the block has sight of the target, or if there is another block in the way of the target. (Use true/false, and only compare with "=")
x The x position of the target. (For blocks, this is the upper left hand corner)
y The y position of the target. (For blocks, this is the upper left hand corner)
self Filters out any targets that are or are not this block. (Use true/false, and only compare with "=")
collision Whether or not the target is colliding with the block. (Use true/false, and only compare with "=")
moving Whether or not the target is moving. (Use true/false, and only compare with "=")



And example of the filtertarget command used in a script is as follows...




The following script uses the targetting system to poison enemies and players in range.


if(always)
{
then(cleartarget)

then(addtarget,player)
then(addtarget,enemy)
then(filtertarget,distance,<,196)

then(statustarget,poison,20)
}