First try - plz help

Chameleon

Member
just trying to make some script

2 days of reading documents and still can't make my ship warping to belt or bookmark

may somebody give me example or told how to do it?

p/s/ sorry for bad English
 

shaliuno

Active Member
Here we go

Code:
#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


*/
 

Chameleon

Member
thnks alot that helps to start ..

i try to use your code to make another task
*find ship in space near me
*aproach it

______________________
Code:
function main()
		{
		; 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
		ConsoleClear
		EVE:DoGetEntities[BeltsIndex, GroupID]
		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
		{
			if ${BeltsIterator.Value.TypeID} == 20187
			{
			${BeltsIterator.Value.TypeID}:Aproach
			return
			}
			 echo Belt: ${BeltsIterator.Value} ${BeltsIterator.Value.Name} ${BeltsIterator.Value.TypeID}
			
		}

		while ${BeltsIterator:Next(exists)}
}
_
________________________
it's find all ships near me
but it's not approaching ^)
what i do wrong?
and newbie question: you wrote that in simply text editor or some special program?
 
Last edited:
Top Bottom