EQ2Interface - View Single Post - Operators and conditionals
View Single Post
Unread 04-30-2019, 10:03 AM
Regn Regn is offline
A Young Mystail Rat
Join Date: Dec 2013
Server: Everfrost
Posts: 5

I hope it's ok that I add code examples that I've made work. If you know something I don't in terms of having to be careful with /GameData.General.Time let me know.


Code purpose:
To concatenate the AA Experience string with square brackets, allowing e.g. AA Experience to be displayed in square brackets next to AA Points like so: "173 [43.5%]".

Code example:
<?xml version="1.0" encoding="utf-8"?>

<Page Name="Main">
  <Text Name="AAXPValue" DynamicData="/GameData.Achievement.ExperienceCurrent" />
  <Text Name="Init" DynamicData="/GameData.General.Time" DynamicDataFilter="FFFE" OnTextChanged="Parent.DisplayArea.AAXPDisplay.Text=('[') ## Parent.AAXPValue.LocalText ## (']')" />
  <Page Name="DisplayArea">
    <Text Name="AAXPDisplay" LocalText="N/A" />
Code output:
Code explanation:
  • AAXPValue contains the DynamicData string that we want to concat.
  • Init is an idea that I've borrowed from one of Drums xml files, and edited for a simpler purpose.
  • Init uses the DynamicData called GameData.General.Time for the sole purposes of triggering OnTextChanged, which then makes our desired change to AAXPDisplay.

Code note:
  • You will have to add the required Page and Text properties to Main, DisplayArea, and AAXPDisplay. I removed these properties for the purpose of keeping the code easy to read and understand.
  • Don't swap out the square brackets with parenthesis. Your EQ2 client will crash if you try to run it with parenthesis.
  • AA Points were not added in the code example to avoid confusion.

Last edited by Regn : 04-30-2019 at 10:20 AM.
Reply With Quote