Author Topic: Activating by Mouse Move with [IF] Specific Macro .. Need Help  (Read 2959 times)

DariosCZ

  • Guest
Activating by Mouse Move with [IF] Specific Macro .. Need Help
« on: January 01, 2018, 07:07:00 PM »
Hello guys,
I want to use any "if" command in voice attack but i realy dont know if its possible or not...
so ..                 1) - Is useing "If" or "when" with multiple commands possible in voice attack ?
if it is possible   2) - i looking to way how to create this macro ..
     .. for example.

N0                                 "Activate Macro"
                                                l
N1                       (IF) Mouse Position = [x; y>250]
                           /                                               \
N2                    True............................................False
               (Do normal Action [Once] )       (Do normal Action [Once] )
                             l                                                 l
N3                (Back to N1)                                  (Back to N1)

PS. I think I just need to know how to activate it with mouse move with using [x;y]
I hope its any way to do this. Thank you so much for any Advice.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4761
  • RTFM
Re: Activating by Mouse Move with [IF] Specific Macro .. Need Help
« Reply #1 on: January 01, 2018, 08:29:39 PM »
Code: [Select]
Start Loop While : [{EXP:1=1}] Equals '1'
    Begin Text Compare : [{EXP: {MOUSESCREENX} < 250 AND {MOUSESCREENY} < 250}] Equals '1'
        Begin Boolean Compare : [~doneOnce] Equals False
            Write '[Blue] This will run once' to log
            Set Boolean [~doneOnce] to True
        End Condition
    Else
        Set Boolean [~doneOnce] to False
    End Condition
End Loop
You can use the condition builder rather than the "{EXP:}" token, but you'll have to store the cursor position into variables if you want to avoid using "{EXP:}" altogether(and if you're using it anyway, you might as well do both checks in one go, I recon).

Do note that in multi-monitor setups, any monitor to the left of the main monitor will result in negative coordinates, so you'd have to add a ">= 0" check as well.

You can have the loop check a variable, if you want the ability to stop it at will(Either from another command, or with some additional logic, when the same command is executed a second time).

DariosCZ

  • Guest
Re: Activating by Mouse Move with [IF] Specific Macro .. Need Help
« Reply #2 on: January 02, 2018, 11:20:15 PM »
Thank you, it works .. but its in cycle .. its any way that do action only if condition change?

DariosCZ

  • Guest
Re: Activating by Mouse Move with [IF] Specific Macro .. Need Help
« Reply #3 on: January 03, 2018, 01:31:28 AM »
Thank you i have it  ;D