#define GROUPID_ASTEROIDBELT 9
function main()
{
;declaring variable to initialis objectdef object_TestingSomething
declarevariable TestingSomething object_TestingSomething global
;cleraing console to get rid of old data
ConsoleClear
;loop function to make ship warp from belt to belp
while TRUE
{
TestingSomething:WarpToNextBelt
wait 20
}
}
objectdef object_TestingSomething
{
method Initialize()
{
; declaring vars to store belts data
variable index:entity BeltsIndex
variable iterator BeltsIterator
; we request belts list to store in BeltsIndex by GroupID by GROUPID_ASTEROIDBELT i.e. 9 as defined in 1st line
EVE:DoGetEntities[BeltsIndex, GroupID, GROUPID_ASTEROIDBELT]
BeltsIndex:GetIterator[BeltsIterator]
;its belt number to warp to as belts are stored in BeltsIndex
variable int BeltNumber = 1
; here we check and ECHO all found belts
if ${BeltsIterator:First(exists)}
do
{
echo Belt: ${BeltsIterator.Value} ${BeltsIterator.Value.Name}
}
while ${BeltsIterator:Next(exists)}
}
method WarpToNextBelt()
{
; if were in warp, dont to anything
if ${Me.ToEntity.Mode} == 3
{
return
}
; if beltnumber is 0 or has value than total belts in sytem we go to ELSE and set it to 1 to go from beginning
; if ok, we warp to BeltNumber that look for position in BeltsIndex
if ${BeltNumber} <= ${BeltsIndex.Used}
{
Entity[${BeltsIndex[${BeltNumber}].ID}]:WarpTo
echo Warping to ${Entity[${BeltsIndex[${BeltNumber}].ID}]}
BeltNumber:Inc
}
else
{
echo BeltNumber is ${BeltNumber}. We warped through all belts. Ending script.
endscript ${Script.Filename}
}
}
}
/*
Didn't test script on live server as its too late, so wrote it by memory, should work anyway.
;)
AND:
with bookmarks you have the same BUT
index:entity >>> index:bookmark
because bookmark is not entity, (unless you bookmark a station or any celestial object but still no big difference)
and use
EVE:DoGetBookmarks[BookmarksAvailable]
but make use you got bookmarks only of the current system, otherwise you'll need to filter them out which is an additional portion of code
*/