<RetVar> = A variable where the requested information is stored as an array.
<RefObj> = A variable containing a sector.
This command returns an array of all asteroids that are in the as <RefObj> selected sector. However, this will only return asteroids that are visible on the sector map.
Example:
$sector=[PLAYERSHIP] -> get sector
$asteroid.arr=$sector -> get asteroid array from sector
$size= size of array $asteroid.arr
while $size
|dec $size=
|$asteroid=$asteroid.arr[$size]
|$resource=$asteroid -> get resource waretype of asteroid
|$yield=$asteroid -> get asteroid yield
|$position.arr=$asteroid -> get position as array
|write to player logbook: printf: fmt='The asteroid at %s has the resource %s with a yield of %s.', $position.arr, $resource, $yield, null, null
end
return null
This will get all asteroids in the player sector. Afterwards it will find out for every asteroid its position, resource and yield and will then write these information with a message to the logbook.
Command Location:
- »» Universe and Sector Commands
<RetVar> = <RefObj> get asteroid array from sector