Page 1 of 1

need help with incremental variable

Posted: 09 Nov 2017, 09:34
by Pluxx27
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"

Re: need help with incremental variable

Posted: 09 Nov 2017, 10:14
by TheDewd
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