Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Help me with a macro command please


  • Please log in to reply
9 replies to this topic
clirous
  • Members
  • 6 posts
  • Last active: May 27 2015 03:50 PM
  • Joined: 26 May 2015

example i set 5 points at 5 locations.

then i want if i press f1 first time

mouse will left click on the first location.

then second f1 => click the 2nd location 

and do the same action as above till the 5th and if i keep pressing f1 i will reset to click the 1st location 

 

im newbie, just know some basic command like send, controlclick... 
anyone can help me pls

thanks  :(  :(  :(  :(  :(



Xtra
  • Members
  • 954 posts
  • Last active: Jul 23 2016 09:04 PM
  • Joined: 29 Sep 2013

Edit X,Y as needed.

f1::Click5Rotation()    ; Simple usage.


Click5Rotation(){ ;Note: x1, y1    x2, y2    x3, y3    x4, y4    x5, y5
    static c:=0, Loc:=[[111,111],[222,222],[333,333],[444,444],[555,555]]
    c := (c+=1)<=5 ? c : c:=1
    click % Loc[c,1] "," Loc[c,2]
}


clirous
  • Members
  • 6 posts
  • Last active: May 27 2015 03:50 PM
  • Joined: 26 May 2015

 

Edit X,Y as needed.

f1::Click5Rotation()    ; Simple usage.


Click5Rotation(){ ;Note: x1, y1    x2, y2    x3, y3    x4, y4    x5, y5
    static c:=0, Loc:=[[111,111],[222,222],[333,333],[444,444],[555,555]]
    c := (c+=1)<=5 ? c : c:=1
    click % Loc[c,1] "," Loc[c,2]
}

can i ask? what is "loc:=" for? can u use Send or ControlClick instead of Loc ? 



clirous
  • Members
  • 6 posts
  • Last active: May 27 2015 03:50 PM
  • Joined: 26 May 2015

 

Edit X,Y as needed.

f1::Click5Rotation()    ; Simple usage.


Click5Rotation(){ ;Note: x1, y1    x2, y2    x3, y3    x4, y4    x5, y5
    static c:=0, Loc:=[[111,111],[222,222],[333,333],[444,444],[555,555]]
    c := (c+=1)<=5 ? c : c:=1
    click % Loc[c,1] "," Loc[c,2]
}

please help me, ur code works., but it still ks mouse, is there anyway that not ks mouse ??  :(  :(  :(



Shadowpheonix
  • Members
  • 268 posts
  • Last active:
  • Joined: 10 Feb 2014

can i ask? what is "loc:=" for? can u use Send or ControlClick instead of Loc ? 

 

Loc is an Object containing an array of locations to click.  It is used here so that you do not need multiple different Click commands.

 

 

please help me, ur code works., but it still ks mouse, is there anyway that not ks mouse ??  :(  :(  :(

 

I am not sure what you mean by "ks" here.  Do you mean your mouse stops working completely after you run the script, or do you mean the mouse does work while the script is running, or do you mean something else entirely?



clirous
  • Members
  • 6 posts
  • Last active: May 27 2015 03:50 PM
  • Joined: 26 May 2015

Loc is an Object containing an array of locations to click.  It is used here so that you do not need multiple different Click commands.

 

 

 

I am not sure what you mean by "ks" here.  Do you mean your mouse stops working completely after you run the script, or do you mean the mouse does work while the script is running, or do you mean something else entirely?

i mean the mouse moves bro, i dont want to the mouse move  :)  like the controlclick command doesnt move mouse 



clirous
  • Members
  • 6 posts
  • Last active: May 27 2015 03:50 PM
  • Joined: 26 May 2015

btw can u make it send some strings instead of clicking ??  :D



Xtra
  • Members
  • 954 posts
  • Last active: Jul 23 2016 09:04 PM
  • Joined: 29 Sep 2013

Using controlclick:

f1::Click5Rotation()    ; Simple usage.

Click5Rotation(){ ; X,Y  x1, y1    x2, y2    x3, y3    x4, y4    x5, y5
    static c:=0, Loc:=[[111,111],[222,222],[333,333],[444,444],[555,555]]
    c := (c+=1)<=5 ? c : c:=1
    ControlClick, % "x" Loc[c,1] " y" Loc[c,2], A,,,, Pos
}              ; Clicks in active window(change A to your wintitle if needed)


Xtra
  • Members
  • 954 posts
  • Last active: Jul 23 2016 09:04 PM
  • Joined: 29 Sep 2013

btw can u make it send some strings instead of clicking ??  :D

 

Example with text strings:

f1::Send5Text()

Send5Text(){
    static c:=0, Text:=["Text1","Text2","Text3","Text4","Text5"]
    Send % Text[(c+=1)<=5 ? c : c:=1]
}


clirous
  • Members
  • 6 posts
  • Last active: May 27 2015 03:50 PM
  • Joined: 26 May 2015

wow thank you very much Xtra !!  :shy:  :shy:  :shy:  :D