I'm trying to to use the Leaveship method of the items datatype.
I can't get it to work when using searching through the Hangerships items
I was writing a script to get into each one of my ships and fly it to a destination then leave the ship and then return to my original station and then repeat till there are no more ships left
the error i'm getting is
Error:No such 'variable' method 'LeaveShip' @hsIterator.Value:LeaveShip
Error parsing data sequence ''
Dumping script stack
--------------------
I assume i'm using the wrong collection of items
below is the script i was using.
I can't get it to work when using searching through the Hangerships items
I was writing a script to get into each one of my ships and fly it to a destination then leave the ship and then return to my original station and then repeat till there are no more ships left
the error i'm getting is
Error:No such 'variable' method 'LeaveShip' @hsIterator.Value:LeaveShip
Error parsing data sequence ''
Dumping script stack
--------------------
I assume i'm using the wrong collection of items
below is the script i was using.
Code:
function main()
{
variable index:item hsIndex
variable iterator hsIterator
variable string shipName
if (${Me.InStation})
{
Me:DoGetHangarShips[hsIndex]
hsIndex:GetIterator[hsIterator]
shipName:Set[${Me.Ship}]
if ${hsIterator:First(exists)}
{
do
{
if ${hsIterator.Value.GivenName.Equal[${shipName}]}
{
echo "obj_Ship: Leaving Ship named ${hsIterator.Value.GivenName}."
hsIterator.Value:LeaveShip
wait 10
break
}
}
while ${hsIterator:Next(exists)}
}
}
}