Quantcast Operators and conditionals - Page 2 - EQ2Interface
EQ2Interface.com
Search Downloads


Go Back   EQ2Interface > Developer Discussion > XML Modification Help & Info

Reply
Thread Tools Search this Thread Display Modes
  #26  
Unread 05-26-2007, 12:06 AM
Othesus's Avatar
Othesus Othesus is offline
A Griffon
This person is a EQ2Map developer.
Interface Author - Click to view interfaces
 
Join Date: Mar 2005
Server: Lucan DLere
Posts: 847
Default

Just a note about the syntax for the ! (negation) operator. It has to be enclosed in single quotes, like:

Parent.ShineyTestButton.Activated='!'Parent.Info.Visible
Reply With Quote
  #27  
Unread 11-23-2008, 11:42 AM
Genen Genen is offline
A Young Mystail Rat
 
Join Date: Feb 2005
Server: Blackburrow
Posts: 5
Default

Can I run counters?

Example:

I have a label displayed on a window. Let's call it 'TotalLabel'

If TotalLabel.Localtext is '0', then I will see a '0' on the window.

How do I increment that by 1?

Does "Parent.TotalLabel.Localtext=Parent.TotalLabel.Localtext + 1" work?

Any existing windows out there I can look at for examples?
Reply With Quote
  #28  
Unread 11-23-2008, 12:38 PM
gm9 gm9 is offline
gm10-1
Premium Member
EQ2Interface Super Mod
Featured
 
Join Date: Feb 2006
Posts: 6,479
Default

Yes. Also see here.
__________________
P R O F I T U I ∙ R E B O R N [Auto-Updater] | [Portal] | [F.A.Q.] | [Support Forums]
~ Retired ~
If it does not work, you likely installed it incorrectly. Always try a clean install before reporting bugs.
Reply With Quote
  #29  
Unread 01-08-2009, 06:54 AM
samejima samejima is offline
A Griffon
Interface Author - Click to view interfaces
 
Join Date: Jul 2005
Server: Unrest
Posts: 156
Default

HOW IN GODS NAME DO YOU GET A WORKING AND OR STATEMENT I give up!
Reply With Quote
  #30  
Unread 01-08-2009, 07:02 AM
gm9 gm9 is offline
gm10-1
Premium Member
EQ2Interface Super Mod
Featured
 
Join Date: Feb 2006
Posts: 6,479
Default

As far as I found you can only ever do one operation at the same time, so you can't do any kind of nested statements including two comparisons. At least I gave up trying as well. So you need to do two separate comparisons.
__________________
P R O F I T U I ∙ R E B O R N [Auto-Updater] | [Portal] | [F.A.Q.] | [Support Forums]
~ Retired ~
If it does not work, you likely installed it incorrectly. Always try a clean install before reporting bugs.
Reply With Quote
  #31  
Unread 01-08-2009, 07:06 AM
samejima samejima is offline
A Griffon
Interface Author - Click to view interfaces
 
Join Date: Jul 2005
Server: Unrest
Posts: 156
Default

Quote:
Originally Posted by SOE_Bobble View Post
Nicely done.

I have access to the code and didn't even know this existed. So I went into the UIScriptEngine code tonight but didn't find any other secrets treasures.

Operators:
= - assignment
== != - comparison
< <= - less than
> >= - greater than
&& || - AND OR
! - negative
+ - * / - math
## - concat
?: - conditional
$ - assignment. calls "/<lhs> <rhs>"


Did anyone ever figure out the syntax for the conditional operator? If not, the spacing rules and () syntax of ## might be a clue.

Bobble
So that doesn't exist or just not working properly? I just want to do if x= y || z
Reply With Quote
  #32  
Unread 01-08-2009, 07:21 AM
gm9 gm9 is offline
gm10-1
Premium Member
EQ2Interface Super Mod
Featured
 
Join Date: Feb 2006
Posts: 6,479
Default

Oh no that works fine. Example:
y=(a == 10)
z=(a == 5)
COND=y || z
x=COND ? true : false
Will be true for values of a = 5 or 10 and false for anything else.
__________________
P R O F I T U I ∙ R E B O R N [Auto-Updater] | [Portal] | [F.A.Q.] | [Support Forums]
~ Retired ~
If it does not work, you likely installed it incorrectly. Always try a clean install before reporting bugs.
Reply With Quote
  #33  
Unread 01-08-2009, 07:25 AM
samejima samejima is offline
A Griffon
Interface Author - Click to view interfaces
 
Join Date: Jul 2005
Server: Unrest
Posts: 156
Default

OK I was trying to do stuff like

Cond= a==10 || a==5

with that being said would this be a valid statment


y=(a == 10)
z=(a == 5)
x=(COND ? true : false) COND=y || z

And this?
x=(COND ? true : false) COND=y || z y=(a == 10) z=(a == 5)

trying to keep it all on one line for a change instead of pressing return 1000x
Reply With Quote
  #34  
Unread 01-08-2009, 07:35 AM
gm9 gm9 is offline
gm10-1
Premium Member
EQ2Interface Super Mod
Featured
 
Join Date: Feb 2006
Posts: 6,479
Default

Quote:
Originally Posted by samejima View Post
OK I was trying to do stuff like

Cond= a==10 || a==5
That's basically what I tried to express above (and what should be mentioned earlier in this thread), you can't combine different operations (here == and ||), the parser doesn't pick it up correctly, you need to put them in separate statements that you reference via variables. You can combine similar operations though, so COND = a || b || c || d works.

Quote:
Originally Posted by samejima View Post
with that being said would this be a valid statment


y=(a == 10)
z=(a == 5)
x=(COND ? true : false) COND=y || z

And this?
x=(COND ? true : false) COND=y || z y=(a == 10) z=(a == 5)

trying to keep it all on one line for a change instead of pressing return 1000x
I find it easier to read with linebreaks but both ways work, it's purely cosmetic.
__________________
P R O F I T U I ∙ R E B O R N [Auto-Updater] | [Portal] | [F.A.Q.] | [Support Forums]
~ Retired ~
If it does not work, you likely installed it incorrectly. Always try a clean install before reporting bugs.

Last edited by gm9 : 01-08-2009 at 07:37 AM.
Reply With Quote
  #35  
Unread 01-08-2009, 07:37 AM
samejima samejima is offline
A Griffon
Interface Author - Click to view interfaces
 
Join Date: Jul 2005
Server: Unrest
Posts: 156
Default

All my code is normally done with line breaks but for this I just want to keep it on one line, plus I was just curious after trying for so long!!! thanks for the help.
Reply With Quote
  #36  
Unread 04-30-2019, 10:03 AM
Regn Regn is offline
A Young Mystail Rat
 
Join Date: Dec 2013
Server: Everfrost
Posts: 5
Default

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.

Concatenation

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:
Code:
<?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" />
  </Page>
  
</Page>
Code output:
Code:
[100%]
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
  #37  
Unread 05-05-2019, 07:31 PM
Drumstix42's Avatar
Drumstix42 Drumstix42 is offline
A Griffon
Featured
 
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
Send a message via AIM to Drumstix42 Send a message via MSN to Drumstix42 Send a message via Yahoo to Drumstix42
Default

Pretty interesting that concatenating parenthesis in a string causes the game to crash, LOL. There might be a work around using like an ascii/unicode version of parenthesis instead, but not sure
__________________
"I'm afraid you're guilty of thought-crime. Don't bother getting the door, we'll let ourselves in..."
<Donate to DrumsUI> < [DrumsUI] Updater > < [DrumsUI] Full Interface> < Drumstix42 on Twitch.tv
>
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 09:16 AM.


Our Network
EQInterface | EQ2Interface | War.MMOUI | WoWInterface | VGInterface | LoTROInterface | MMOInterface