init-session script (used with ISBoxer)

Discussion of Inner Space

Moderators: Lavish Software Team, Moderators

Post Reply
Dragonwise
GamingTools Subscriber
Posts: 5
Joined: Mon May 27, 2013 7:08 am

init-session script (used with ISBoxer)

Post by Dragonwise » Wed Dec 10, 2014 2:09 am

This question seems more appropriate in the Inner Space forum than the ISBoxer forum. I could not find an appropriate category for Lavish Script questions there, so I am posting here.

My script is launched by a small init-session script.

Code: Select all

; Scripts/init-session/lotro-session.iss
function main()
{
    if ${LavishScript.Executable.Find["TurbineLauncher.exe"]} > 0
    {
        run lotro-launcher
    }
}
The lotro-launcher script has access to a couple of very useful ISBoxer global variables, as shown:

Code: Select all

; Scripts/lotro-launcher.iss
function main()
{
    ; TurbineLauncher will have no console, so we send output to a log file
    Log lotro-launcher.log
    echo " "
    echo "================================"
    echo "In TurbineLauncher.exe"
    echo "  CharacterSet: ${ISBoxerCharacterSet}"
    echo "          Slot: ${ISBoxerSlot}"
    echo "     Character: ${ISBoxerCharacter}"
    echo "================================"
    Log off
}
My question is: How can the script obtain the value for "Account name" (set in ISBoxer) for the character? Asked another way, how can the script get the <AccountName> XML value for the <Character>.

Note: The script does not have access to the ISBoxerSettings variable, which appears to contain the character settings. I have tried to Import ISBoxerToolkit.GeneralSettings.XML, but have not been successful with that approach.

Lax
Owner
Posts: 6634
Joined: Fri Jun 18, 2004 6:08 pm

Post by Lax » Sat Dec 13, 2014 9:14 am

Sorry I missed this question when it was originally posted.

ISBoxer doesn't store the account name field in the generated Inner Space configuration, so you cannot use the built-in settings system to access it. If it was in there, you would be able to use the built-in settings system just like ISBoxer would.

What other LOTRO players do/have done is 1. set up a separate Game Profile per Account, using the -username parameter to the launcher exe to set the username (e.g. TurbineLaunher.exe -username myaccount1), and then 2. set each Character in ISBoxer Toolkit to use the account-specific Game Profile.

But that shouldn't matter because the Virtual File already should be keeping your username on a per-Character basis. So I assume that's not what you're after... either way a separate Game Profile would get you the capability you seem to want though.


Another issue you may run into is that TurbineLauncher is not a 3d application, so your scripts may or may not run in the launcher at all. Inner Space will try to run them, I'm just letting you know it might not work. ;)

Dragonwise
GamingTools Subscriber
Posts: 5
Joined: Mon May 27, 2013 7:08 am

Post by Dragonwise » Mon Dec 15, 2014 4:54 pm

Lax wrote:ISBoxer doesn't store the account name field in the generated Inner Space configuration, so you cannot use the built-in settings system to access it. If it was in there, you would be able to use the built-in settings system just like ISBoxer would.
I'm puzzled by this. Are you referring to ISBoxerToolkitProfile.XML or something else? (I'm not sure what you mean by "generated configuration") I see the account name in this XML file on a per-character basis:

Code: Select all

  <Character>
    <ExecuteOnLoad>
      <RoundRobin>false</RoundRobin>
    </ExecuteOnLoad>
    <Name>MyCharacterName</Name>
    <AccountName>MyAccountName</AccountName>
    <SubAccountName />
    <ServerName />
    <ActualName>ActualCharacterName</ActualName>
    <Game>Lord of the Rings Online</Game>
    <GameProfile>Lord of the Rings Online Default Profile</GameProfile>
    ...
  </Character>
Unfortunately, I don't know how to retrieve the field from this XML file using LavishScript.

Regarding the last issue you mentioned, the script runs, but with some (expected) limitations. For example, I see that some objects return NULL:

Code: Select all

		echo "         Width&#58; $&#123;Display.Width&#125;"
		echo "        Height&#58; $&#123;Display.Height&#125;"
		echo "             X&#58; $&#123;Display.X&#125;"
		echo "             Y&#58; $&#123;Display.Y&#125;"
returns this:

Code: Select all

         Width&#58; NULL
        Height&#58; NULL
             X&#58; NULL
             Y&#58; NULL
Surprisingly, the GDIWindow object also returns NULL. This is not an issue, however. My only issue is figuring out a way to obtain the Account Name from the ISBoxer settings. My current workaround is a series of IF statements that determine the account name based on the character name. I would prefer to obtain the <AccountName> field from the XML file.

Thank you Joe for your excellent support!

Lax
Owner
Posts: 6634
Joined: Fri Jun 18, 2004 6:08 pm

Post by Lax » Mon Dec 15, 2014 5:35 pm

I'm puzzled by this. Are you referring to ISBoxerToolkitProfile.XML or something else? (I'm not sure what you mean by "generated configuration")
No. Inner Space cannot read ISBoxerToolkitProfile.XML. When you Export to Inner Space, compatible files (including XML files with a specific IS settings schema) for operating the configuration within the game are generated into the Inner Space\Scripts folder. The account name is not stored in these files by ISBoxer because it is not used at runtime by any built-in ISBoxer functions.

If you want to read it from that file your best bet would be to implement a complete XML parser as a LavishScript module, because there is not one. You can use LavishScript's straight file i/o (https://www.lavishsoft.com/wiki/index.php/DataType:file) and wing it if you want.

Dragonwise
GamingTools Subscriber
Posts: 5
Joined: Mon May 27, 2013 7:08 am

Post by Dragonwise » Tue Dec 16, 2014 6:52 pm

What you said just clicked. I can store the account info in a different XML file.
I created a script to initialize an XML database as follows:

Code: Select all

  LavishSettings&#58;AddSet[LotroCharacters]
  LavishSettings[LotroCharacters]&#58;AddSet[Characters]
  LavishSettings[LotroCharacters].FindSet[Characters]&#58;AddSet[MyCharacterName1]
  LavishSettings[LotroCharacters].FindSet[Characters]&#58;AddSet[MyCharacterName2]
  LavishSettings[LotroCharacters].FindSet[Characters]&#58;AddSet[MyCharacterName3]
  LavishSettings[LotroCharacters].FindSet[Characters].FindSet[MyCharacterName1]&#58;AddSetting[Account,MyAccountName1]
  LavishSettings[LotroCharacters].FindSet[Characters].FindSet[MyCharacterName2]&#58;AddSetting[Account,MyAccountName2]
  LavishSettings[LotroCharacters].FindSet[Characters].FindSet[MyCharacterName3]&#58;AddSetting[Account,MyAccountName3]
  LavishSettings[LotroCharacters]&#58;Export[MyLotroCharacters.xml]
To retrieve the account, I added the following to lotro-launcher.iss:

Code: Select all

  LavishSettings&#58;AddSet[LotroCharacters]
  LavishSettings[LotroCharacters]&#58;Import[MyLotroCharacters.xml]
  variable string account
  account&#58;Set[$&#123;LavishSettings[LotroCharacters].FindSet[Characters].FindSet[$&#123;ISBoxerCharacter&#125;].FindSetting[Account]&#125;]
This takes care of my requirements without the need for building an XML parser from scratch.

I really appreciate the powerful InnerSpace product and your excellent support, Joe!

Post Reply