Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
make macro rep X amount then shutdown and run other macro
#1
Is there a way to make a macro rep X amount of times then shutdown the macro that is running and run another macro
Example

Macro 1
rep 100 then shutdown after reping 100 times and run macro2

Macro2
Smile 8)
#2
How do you want to set X? And how to shut down? Eg from Macro3 etc.
#3
MR_B Wrote:Is there a way to make a macro rep X amount of times then shutdown the macro that is running and run another macro
Example

Macro 1
rep 100 then shutdown after reping 100 times and run macro2

Macro2


Code:
Copy      Help
rep 100
,;commands here
mac "Macro2"
end
An old blog on QM coding and automation.

The Macro Hook
#4
here is another way
rep 100
,;commands here
,atend "Macro2"
#5
Gintaras Wrote:How do you want to set X? And how to shut down? Eg from Macro3 etc.
X is set from dialog
and i want the macro to shutdown.

example:
i want Macro1 to rep 100 times (it is a long macro) and then i want it to shutdown Macro1 and then run macro 2
Smile 8)
#6
mine will do that if you dont need millisecond timing on whether m1 and m2 can be running at the exact same time.
An old blog on QM coding and automation.

The Macro Hook
#7
In dialog:
int x=how many times to repeat
mac "Macro1" "" x

Macro1:
function x
rep x
,...

mac "Macro2"
#8
Gintaras Wrote:In dialog:
int x=how many times to repeat
mac "Macro1" "" x

Macro1:
function x
rep x
,...

mac "Macro2"
tyvm, can you show me and example dialog plz? so i know if im doing it right :lol:
Smile 8)
#9
Better show your dialog and I'll say if you do it right.
#10
Gintaras Wrote:Better show your dialog and I'll say if you do it right.
i cant right now till i get home
Smile 8)
#11
Gintaras Wrote:Better show your dialog and I'll say if you do it right.
Ok here is my dialog.

Nothing has chnaged this is the exact dialog.

Code:
Copy      Help
function# hDlg message wParam lParam
if(hDlg) goto messages
if(wParam) goto messages2
str controls = "13"
str cb13who
cb13who = "10[]15[]20[]25[]30[]35[]40[]45[]55[]60[]65[]70[]75[]80[]85[]90[]95[]100"
int D; rget D "cb13who" "\MyAppName" 0 0; if(D>20) D=20
Save cb13who D

str thismacro=
;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 210 79 "Choose My Rep amount"
;1 Button 0x54030001 0x4 16 56 48 14 "OK"
;2 Button 0x54030000 0x4 72 56 48 14 "Cancel"
;13 ComboBox 0x54230243 0x0 6 10 56 213 "who"
;3 Static 0x54000000 0x0 68 10 48 12 "REP AMOUNT"
;END DIALOG
;DIALOG EDITOR: "" 0x2020002 "" ""

thismacro.replacerx("^" " " 8)
if(!ShowDialog(thismacro &Options_Dialog &controls 0 2)) ret
D=val(cb13who); rset D "cb13who" "\MyAppName"


ret
;messages

double+ x_speed
sel message
,if(!x_speed) x_speed=0.1
,;;;REP AMOUNT
,_i=x_speed*1000
,sel _i
,,case 59 _i=56
,,case 60 _i=57
,,case 61 _i=58
,,case 62 _i=59
,,case 63 _i=60
,,case 64 _i=61
,,case 65 _i=62
,,case 66 _i=63
,,case 67 _i=64
,,case 68 _i=65
,,case 69 _i=66
,,case 70 _i=67
,,case 71 _i=68
,,case 72 _i=69
,,case 73 _i=70
,,case 74 _i=71
,,case 75 _i=72
,,case 76 _i=73
,,case 78 _i=74
,,case else ret 1
,CB_SelectItem(id(13 hDlg) _i)
,
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case CBN_SELENDOK<<16|13
,_i=CB_SelectedItem(lParam)
,,sel _i
,,,case 56 x_speed=10
,,,case 57 x_speed=15  
,,,case 58 x_speed=20
,,,case 59 x_speed=25  
,,,case 60 x_speed=30
,,,case 61 x_speed=35    
,,,case 62 x_speed=40  
,,,case 63 x_speed=45
,,,case 64 x_speed=50
,,,case 65 x_speed=55
,,,case 66 x_speed=60
,,,case 67 x_speed=65
,,,case 68 x_speed=70
,,,case 69 x_speed=75
,,,case 70 x_speed=80
,,,case 71 x_speed=85
,,,case 72 x_speed=90
,,,case 73 x_speed=95
,,,case 74 x_speed=100
,case IDOK
,case IDCANCEL
ret 1


CAN YOU TELL ME IF THIS IS RIGHT? LOL AND MABEY GIVE ME SOME HINTERS HOW TO MAKE IT EASYER TO CHANGE THE REP AMOUNT IN THE DIALOG INSTEAD OF SELECTING IT. TYVM BRO

Code:
Copy      Help
Macro3
rep x_speed
Smile 8)
#12
instead of all those case statements why not just have x=_i-3 or 4?
An old blog on QM coding and automation.

The Macro Hook
#13
ken gray Wrote:instead of all those case statements why not just have x=_i-3 or 4?
cause i dont know how lol im not that good with dialog. Cry im trying to learn Smile
Smile 8)
#14
Any word on if this code is right? And if so how to use it in the macro?
Smile 8)


Forum Jump:


Users browsing this thread: 1 Guest(s)