Project

General

Profile

 

Also available in: PDF

EQ2 Account Features: displaying and/or searching via script

To use this test script, create a file in your /innerspace/scripts folder called EQ2AccountFeatures.iss and place the entire text below. Then, you can run the script by typing the following command in the InnerSpace console (while in the game): run EQ2AccountFeatures.   (Note:  You must be loaded into the game as an active character for this to work.)

 

function main()
{
    variable int Counter = 1
    variable index:string AccountFeatures
    variable iterator Iterator

    EQ2:GetAccountFeatures[AccountFeatures]
    AccountFeatures:GetIterator[Iterator]
    echo "This EQ2 account has ${AccountFeatures.Used} features."

    ; To View as a ordered list, vertical
    if ${Iterator:First(exists)}
    {
        do
        {
            echo "${Counter}: ${Iterator.Value}"
            Counter:Inc
        }
        while ${Iterator:Next(exists)}
    }

    ;;;
    ; To view as a simple list, with each feature separated by space, simply uncomment the next line (i.e., remove the semicolon)
    ;;;
    ;echo ACCOUNT FEATURES: ${AccountFeatures.Expand}

    ;;;
    ; To view as a simple list, with each feature separated by comma, simply uncomment the next line (i.e., remove the semicolon)
    ;;;
    ;echo ACCOUNT FEATURES: ${AccountFeatures.ExpandComma}

    ;;;
    ; To view, represented as a JSON array, simply uncomment the next line (i.e., remove the semicolon)
    ;;;
    ;echo ACCOUNT FEATURES: ${AccountFeatures.AsJSON}


    ;;; 
    ; To search for a specific feature, use something similar to the following, which is an example of searching to see if "Age of Discovery" exists 
    ; in the current player's EQ2 account
    ;;;
    if (${AccountFeatures.Expand.Find["Age of Discovery"]} > 0)
    {
        echo "This EQ2 account has 'Age of Discovery' available."
    }
    else
    {
        echo "This EQ2 account does NOT have 'Age of Discovery' available."
    }
}