This is for people in alliances that only publish one POS location per system. This script warps from moon to moon and logs all the control towers that it finds. Make sure the system is safe before running this script! Do not run this script in a system where hostile control towers are anchored!!
Code:
#define CATEGORYID_CELESTIAL 2
#define GROUPID_MOON 8
#define CATEGORYID_STRUCTURE 23
#define GROUPID_CONTROL_TOWER 365
variable string LogFile
function atexit()
{
call LogEcho "EVE POS Finder Script -- Ended"
return
}
function LogEcho(string aString)
{
echo "${aString}"
redirect -append "${LogFile}" echo "${aString}"
}
function WarpWait()
{
variable bool Warped = FALSE
variable int Count
for (Count:Set[0] ; ${Count}<10 ; Count:Inc)
{
if ${Me.ToEntity.Mode} == 3
{
call LogEcho "Warping..."
break
}
wait 20
}
while ${Me.ToEntity.Mode} == 3
{
Warped:Set[TRUE]
wait 20
}
call LogEcho "Dropped out of warp"
wait 20
return ${Warped}
}
function WarpToID(int Id)
{
if (${Id} <= 0)
{
call LogEcho "Error: WarpToID: Id is <= 0 (${Id})"
return
}
if !${Entity[${Id}](exists)}
{
call LogEcho "Error: WarpToID: No entity matched the ID given."
return
}
/* The warp-in point for a moon is usually quite far */
/* away from the actual moon entity. Most of the time */
/* it is just over 5 million meters from the moon. */
while ${Entity[${Id}].Distance} >= 5500000
{
call LogEcho "Warping to ${Entity[${Id}].Name}"
Entity[${Id}]:WarpTo
call WarpWait
}
}
; 'Args' is an array
function main(... Args)
{
LogFile:Set["${Script.CurrentDirectory}/${Universe[${Me.SolarSystemID}]}-pos.log"]
call LogEcho "EVE POS Finder Script"
call LogEcho "EVE POS Finder will log to ${LogFile}"
variable index:entity moonIndex
variable iterator moonIterator
variable index:entity posIndex
variable iterator posIterator
EVE:DoGetEntities[moonIndex,CategoryID,CATEGORYID_CELESTIAL,GroupID,GROUPID_MOON]
moonIndex:GetIterator[moonIterator]
if ${moonIterator:First(exists)}
do
{
call WarpToID ${moonIterator.Value.ID}
EVE:DoGetEntities[posIndex,CategoryID,CATEGORYID_STRUCTURE,GroupID,GROUPID_CONTROL_TOWER]
posIndex:GetIterator[posIterator]
if ${posIterator:First(exists)}
do
{
call LogEcho "==================== POS Found! ===================="
call LogEcho "++ Name -- ${posIterator.Value.Name}"
call LogEcho "++ Alliance -- ${posIterator.Value.Alliance} (${posIterator.Value.AllianceTicker})"
call LogEcho "++ Corporation -- ${posIterator.Value.Corporation} (${posIterator.Value.CorporationTicker})"
;; only works if player is in local
;; call LogEcho "++ Owner -- ${posIterator.Value.Owner.Name}"
call LogEcho "++ Group -- ${posIterator.Value.Group} (${posIterator.Value.GroupID})"
call LogEcho "++ Type -- ${posIterator.Value.Type} (${posIterator.Value.TypeID})"
call LogEcho "===================================================="
}
while ${posIterator:Next(exists)}
}
while ${moonIterator:Next(exists)}
}