Item Sorting Script

So I've just slightly modified the script from the snippets section to move meta 4 items or higher from a personal hangar to ship cargo
Code:
function main()
{
   if !${Me.InStation}
      return
 
   ; Open cargo hold of ship for the duration of item manipulation
   EVE:Execute[OpenCargoHoldOfActiveShip]
   wait 30

 
   ; Open Hangar
   EVE:Execute[OpenHangarFloor]
   wait 25
 
   variable index:item MyHangarItems
   variable int i = 1
   variable int MyHangarItemsCount
   MyHangarItemsCount:Set[${Me.Station.GetHangarItems[MyHangarItems]}]
 
   do
   {
      echo ${MyHangarItems.Get[${i}].MetaLevel}
      if (${MyHangarItems.Get[${i}].MetaLevel} >= 4)
      {
         MyHangarItems.Get[${i}]:MoveTo[MyShip]
         wait 12
      }
   }  
   while ${i:Inc} <= ${MyHangarItemsCount}

   ; After everything is done ...let's clean up the stacks.
   Me.Ship:StackAllCargo

   ; Close cargo hold of ship
   EVE:Execute[OpenCargoHoldOfActiveShip]
   wait 12    

   echo Script Ended
}
However when it runs, it fails to go into the if statement within the while loop. I'm not sure what I'm missing as this script should be fairly basic and work.
 
Last edited:
Sadly that wasn't the bug. Just an error with the script on this computer. The computer I'm running it on actually has that . in the line. The script currently opens the ship cargo and the container and then subsequently outputs script ended. From putting in echo statements to see where it's at. It fails to enter into the if statement still
 

Teht

ComBot Author
Do some echos to find out why the if statement isn't working.


Code:
do
{
    echo ${MyHangarItems.Get[${i}].MetaLevel}
    if (${MyHangarItems.Get[${i}].MetaLevel} >= 4)
    {
        MyHangarItems.Get[${i}]:MoveTo[MyShip]
        wait 12
    }
} 
while ${i:Inc} <= ${MyHangarItemsCount}
And if you aren't already, indent dat thang. Every little bit helps, pretty code is easy to understand code.
 
oh it's indented, just didn't carry over. Running it with
Code:
echo ${MyHangarItems.Get[${i}].MetaLevel}
in the while loop outputs "NULL" for each item. I know it's running through each item as it's output the total stacks in my hangar when I've done
Code:
echo ${MyHangarItems.Get[${i}]}
outputs the item number I believe for each set of items
 

Amadeus

The Maestro
Staff member
The forums will indent your scripts; however, you have to use the [ CODE ] EzCode (i.e., the # button on the editor) ...not the [ QUOTE ] ezcode.

(Obviously, you'll leave out the spaces when you use [ CODE ] [ /CODE ])
 
Fixed the indent for the forums and updated script to what I'm currently trying to get to work. MetaLevel is still returning a value of NULL for some reason even though it's iterating through all the items in the hangar
 

Amadeus

The Maestro
Staff member
I'm looking into it. It may be possible that some members of the item datatype were removed from the game in a recent update in order to make the client more efficient. There really isn't a reason that the client needs to know the metalevel (other than when you "examine" something and it shows up in the UI window). But, it could just be hidden somewhere.

Anyway, the script is fine. The problem is that MetaLevel is not working as it did before and is always returning NULL.
 

Amadeus

The Maestro
Staff member
I think I have a fix for MetaLevel; however, I'm going to continue investigating and see if there is anything else I should add in while I do this big fix.
 
Top Bottom