need help with incremental variable

Advanced Macro Recorder/Editor.

Moderator: Pulover

Pluxx27
Posts: 3
Joined: 08 Nov 2017, 16:02

need help with incremental variable

09 Nov 2017, 09:34

Hey all,

I'm new to all of this. I'm using Pulovers macro.

Basically, I'm running a CNC machine that takes snapshots and certain positions. I want the snapshots to go from 1 - whatever the final point is. I can't figure out how to make a variable to do it. So far I've had to do it all be clicking and changing the number manually. Is there a way to make it incrementally go up without having to do it all by hand?

"Gosub, testirr
WinActivate, Save sample spectra to disk file... ahk_class #32770
Sleep, 333
Send, {1}
Click, 349, 217 Left, Down
Click, 349, 217 Left, Up
Gosub, moveforward
Sleep, 3000
Gosub, testirr
WinActivate, Save sample spectra to disk file... ahk_class #32770
Sleep, 333
WinActivate, Save sample spectra to disk file... ahk_class #32770
Sleep, 333
Send, {2}
Click, 349, 217 Left, Down
Click, 349, 217 Left, Up
Gosub, moveforward
Sleep, 3000
Gosub, testirr
WinActivate, Save sample spectra to disk file... ahk_class #32770
Sleep, 333
Send, {3}
Click, 349, 217 Left, Down
Click, 349, 217 Left, Up"

This is what I have so far i manually add in the
" Send, {3}
Click, 349, 217 Left, Down
Click, 349, 217 Left, Up"
User avatar
TheDewd
Posts: 1510
Joined: 19 Dec 2013, 11:16
Location: USA

Re: need help with incremental variable

09 Nov 2017, 10:14

Example:

This will Send a number, and then increase it each time.

Code: Select all

#SingleInstance, Force

Number := 1 ; Set initial number

Send, % "{" Number "}" ; Send "Number"
Number++ ; Increase Number by 1

Send, % "{" Number "}" ; Send "Number"
Number++ ; Increase Number by 1

Send, % "{" Number "}" ; Send "Number"
Number++ ; Increase Number by 1

Send, % "{" Number "}" ; Send "Number"
Number++ ; Increase Number by 1

Send, % "{" Number "}" ; Send "Number"
Number++ ; Increase Number by 1

Send, % "{" Number "}" ; Send "Number"
Number++ ; Increase Number by 1

Return to “Pulovers Macro Creator”

Who is online

Users browsing this forum: No registered users and 21 guests