How do you do that?

Zandros

Script Author: VGA
Am I doing this correctly? The following code always echo "TotalPawns=0"

Code:
function main()
{	variable int TotalPawns
	variable index:entity CurrentPawns
	TotalPawns:Set[${GetEntities[CurrentPawns]}]
	echo TotalPawns=${TotalPawns}
}
 

Amadeus

The Maestro
Staff member
To fix your snippet, you would do this:

Code:
function main()
{    variable int TotalPawns
    variable index:entity CurrentPawns
    Aion:GetEntities[CurrentPawns]    ;; Note: You can pass more arguments to this to narrow your search if you wish ..anything that the Entity TLO will accept will work here.
    echo TotalPawns=${TotalPawns.Used}
}

Here is a sample script that I used for testing:
Code:
function main()
{
    variable index:entity Entities
    Aion:GetEntities[Entities]
    echo Populating Entities List:: ${Entities.Used} Entities total

    ;; testing
    echo The second entity in the array is: ${Entities.Get[2].Name}, level ${Entities.Get[2].Level}, at ${Entities.Get[2].Location}.
    echo The third actor in the array is: ${Entities.Get[3].Name}, level ${Entities.Get[3].Level}, at ${Entities.Get[3].Location}.
}
 
Top Bottom