Project

General

Profile

 

Also available in: PDF

HOWTO: Fitting Window Interaction

function main()
{
    variable index:fittingslot FittingSlots
    variable iterator FittingSlotsIterator
    variable int Counter = 0 
    
          if (!${EVEWindow[Fitting](exists)})
          {
              Me.Station:OpenFitting
              do
              {
                  waitframe
              }
              while !${EVEWindow[Fitting](exists)}
              wait 20
          }
          
          echo "Current CPU Usage:         ${EVEWindow[Fitting].CPU}%"
          echo "Current Power Usage:       ${EVEWindow[Fitting].Power}%"
          echo "Current Calibration Usage: ${EVEWindow[Fitting].Calibration}%"
    
    EVEWindow[Fitting]:GetSlots[FittingSlots]
    echo "FittingSlots: Used: ${FittingSlots.Used}"

    FittingSlots:GetIterator[FittingSlotsIterator]
   
   
    if ${FittingSlotsIterator:First(exists)}
    do
    {
        echo "ID:               ${FittingSlotsIterator.Value.ID}"
        echo "Name:             ${FittingSlotsIterator.Value.Name}"
        echo "IsEmpty:          ${FittingSlotsIterator.Value.IsEmpty}"
        if (!${FittingSlotsIterator.Value.IsEmpty})
        {
            echo "IsOnline:         ${FittingSlotsIterator.Value.IsOnline}"
          echo "ContainsCharge:   ${FittingSlotsIterator.Value.ContainsCharge}"
            echo "Module:           ${FittingSlotsIterator.Value.Module} (${FittingSlotsIterator.Value.Module.ToItem.Name})"
            
        }
        echo "============================================"
        Counter:Inc
        
                ;;;;;;;
                ;; NOTES:
                ;;
                ;; 1. To Unfit a charge from a module:  FittingSlotsIterator.Value:UnfitCharge
                ;; 2. To Unfit a module:   FittingSlotsIterator.Value:Unfit
                ;; 3. To put a module online:  FittingSlotsIterator.Value:PutOnline
                ;; 4. To put a module offline:  FittingSlotsIterator.Value:PutOffline
                ;; (For putting modules off/online, ISXEVE will make sure you don't call one you shouldn't; however, best practice would 
                ;;  be to check ${FittingSlotsIterator.Value.IsOnline} and then call the one that is appropriate...rather than guessing
                ;;
    }
    while ${FittingSlotsIterator:Next(exists)}
}

;;;;;;;;;;;;;;;;;;;;
;; Additional Notes:
;; 
;; 1. To strip all modules from a ship:   MyShip:StripFitting
;; 2. Please note that the 'item' datatype already has a method "FitToActiveShip"