Author Topic: What's Wrong with my Conditional?  (Read 7995 times)

Abs

  • Guest
What's Wrong with my Conditional?
« on: September 06, 2016, 08:46:37 PM »
Hey,

I just bought this today...I can't seem to make conditionals work. Is it set up correctly?

I see in the screenshot that the PAGENAME variable didn't have TXT: in front of it...that's why I had, but I'm trying different things, and took the screen midway through.



Abs

iceblast

  • Sr. Member
  • ****
  • Posts: 372
Re: What's Wrong with my Conditional?
« Reply #1 on: September 06, 2016, 09:24:47 PM »
You don't need to set a variable. the Token {ACTIVEWINDOWTITLE} is enough. I use mine to change profiles, but you can have it do anything you like.

Hope this helps!

Begin Text Compare : [{ACTIVEWINDOWTITLE}] Starts With 'Developer'
        Change to profile, 'Windows Mode with CSS editing'
    Else If Text Compare : [{ACTIVEWINDOWTITLE}] Contains 'Total Commander'
        Change to profile, 'Windows Mode with CSS editing'
    Else If Text Compare : [{EXP:'{TXT:ACTIVEWINDOWTITLE}' LIKE '*Opera' And NOT '{TXT:ACTIVEWINDOWTITLE}' LIKE '*Edit Style*'}] Equals '1'
        Change to profile, 'Windows Mode with CSS editing'
    Else If Text Compare : [{EXP:'{TXT:ACTIVEWINDOWTITLE}' LIKE '*Torch' And NOT '{TXT:ACTIVEWINDOWTITLE}' LIKE '*Edit Style*'}] Equals '1'
        Change to profile, 'Busy'
    Else If Text Compare : [{EXP:'{ACTIVEWINDOWTITLE}' LIKE '*Torch' AND '{ACTIVEWINDOWTITLE}' LIKE '*Edit*'}] Equals '1'
    Else If Text Compare : [{ACTIVEWINDOWTITLE}] Contains 'Virtual Pool'
        Change to profile, 'Virtual Pool'
    End Condition


Abs

  • Guest
Re: What's Wrong with my Conditional?
« Reply #2 on: September 06, 2016, 09:34:14 PM »
Neat! It's like they say, there's more than one way to skin a cat! :)

I ended up getting it to work...my error was that I had set my variable as a variable {ACTIVEWINDOWTITLE} when it should have been text value...This is what it ended up looking like.



Thanks!

Abs

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2826
Re: What's Wrong with my Conditional?
« Reply #3 on: September 06, 2016, 10:18:48 PM »
Also, you don't need to use a token to do your text compare, as PAGENAME is already a text variable.  You'll probably not notice the difference, just one less hoop for you (and the code) to jump through:

Begin Text Compare: [PAGENAME] Contains 'Facebook'


Hope that helps ;)

Abs

  • Guest
Re: What's Wrong with my Conditional?
« Reply #4 on: September 07, 2016, 06:53:30 AM »
Thanks, Gary! I bought Voice Attack yesterday, and am already up to 183 commands. This is freaking amazing!

Abs

Technomancer

  • Jr. Member
  • **
  • Posts: 98
  • I have a bad feeling about this...
Re: What's Wrong with my Conditional?
« Reply #5 on: September 07, 2016, 08:47:25 AM »
Thanks, Gary! I bought Voice Attack yesterday, and am already up to 183 commands. This is freaking amazing!

Abs

"Hello, my name is Abs and I'm a VA addict..."

"Hello, Abs...welcome to the club."   ;)

iceblast

  • Sr. Member
  • ****
  • Posts: 372
Re: What's Wrong with my Conditional?
« Reply #6 on: September 07, 2016, 10:14:59 AM »
LOL! Yes, Welcome to the Club!

Abs

  • Guest
Re: What's Wrong with my Conditional?
« Reply #7 on: September 07, 2016, 03:05:55 PM »
Hahaha! Thanks, guys. I haven't even touched games, yet....this is just for every day stuff like my browser, emails, etc.

Abs

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4747
  • RTFM
Re: What's Wrong with my Conditional?
« Reply #8 on: September 16, 2016, 10:50:59 AM »
Also, you don't need to use a token to do your text compare, as PAGENAME is already a text variable.
To add to the ways to "skin a cat", you can use the "{ACTIVEWINDOWTITLE}" token directly, rather than setting a variable with its value.

I.E.
Code: [Select]
Begin Text Compare : [{ACTIVEWINDOWTITLE}] Contains 'Facebook'