About click.... Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
Marcosa1020
Posts: 160
Joined: 23 Sep 2015, 19:15

About click....

Post by Marcosa1020 » 02 Sep 2017, 07:56

Hello,
I don't understand, I have three program for A, B, C.
Program A: Send {Click, 15, 516, 2} Sleep 600
Program B: Send {Click, 15, 506, 2} Sleep 600
Program C: Send {Click, 15, 496, 2} Sleep 600
When I press F5, if D4 = 1 then active program A.
When I press F5, if D4 = 2 then active program A & program B.
When I press F5, if D4 = 3 then active program A & program B & program C.
Due to program A B C are very many rows, I don't write like "CODE B".
My idea is "CODE A". Could you help me ?
Thank you for see my question.

Code: Select all

;CODE A
#NoTrayIcon
Gui, Color, C000000
Gui +AlwaysOnTop +LastFound +HWNDa_ID
WinSet, Transparent, 250
Gui, Font, S10 C000000 , Tahoma
Gui, Show, x131 y91 h150 w200,Click
Gui, Add, Text, x4 y50 c00FFFF, X:
Gui, Add, Text, x4 y20 c00FFFF, E:
Gui, Add, DropDownList, x27 y20 w30 h200 vD3, 0||1|2|3|4|5|6|7|8
Gui, Add, Edit, x27 y50 w30 h24 vcardx
Gui, Add, Text, x65 y50 c00FFFF, Y:
Gui, Add, Text, x65 y20 c00FFFF, S:
Gui, Add, DropDownList, x87 y20 w30 h200 vD4, 0||1|2|3|4|5|6|7|8
Gui, Add, Edit, x87 y50 w30 h24 vcardy

; Set  Type A: Send {Click, 15, 516, 2} Sleep 600
; Set Type B: Send {Click, 15, 506, 2} Sleep 600
; Set Type C: Send {Click, 15, 496, 2} Sleep 600


SetTimer, aa, 500 
return

aa:
WinGet, a1_ID, ID, A
If ( a_ID != a1_ID )
k_ID = %a1_ID%
return

Pause::Pause
F6::Reload

F5::
Gui, Submit, NoHide
If (D4 = 1)
{
Active program A
}
If (D4 = 2)
{
Active program A & program B
}
If (D4 = 3)
{
Active program A & program B & program C
}
return
GuiClose:
ExitApp

Code: Select all

; CODE B
#NoTrayIcon
Gui, Color, C000000
Gui +AlwaysOnTop +LastFound +HWNDa_ID
WinSet, Transparent, 250
Gui, Font, S10 C000000 , Tahoma
Gui, Show, x131 y91 h150 w200,Click
Gui, Add, Text, x4 y50 c00FFFF, X:
Gui, Add, Text, x4 y20 c00FFFF, E:
Gui, Add, DropDownList, x27 y20 w30 h200 vD3, 0||1|2|3|4|5|6|7|8
Gui, Add, Edit, x27 y50 w30 h24 vcardx
Gui, Add, Text, x65 y50 c00FFFF, Y:
Gui, Add, Text, x65 y20 c00FFFF, S:
Gui, Add, DropDownList, x87 y20 w30 h200 vD4, 0||1|2|3|4|5|6|7|8
Gui, Add, Edit, x87 y50 w30 h24 vcardy

SetTimer, aa, 500 
return

aa:
WinGet, a1_ID, ID, A
If ( a_ID != a1_ID )
k_ID = %a1_ID%
return

Pause::Pause
F6::Reload

F5::
Gui, Submit, NoHide
If (D4 = 1)
{
Send {Click, 15, 516, 2}
Sleep 600
}
If (D4 = 2)
{
Send {Click, 15, 516, 2}
Sleep 600
Send {Click, 15, 506, 2}
Sleep 600
}
If (D4 = 3)
{
Send {Click, 15, 516, 2}
Sleep 600
Send {Click, 15, 506, 2}
Sleep 600
Send {Click, 15, 496, 2}
Sleep 600
}
return
GuiClose:
ExitApp

Marcosa1020
Posts: 160
Joined: 23 Sep 2015, 19:15

Re: About click....

Post by Marcosa1020 » 02 Sep 2017, 23:14

Hi,
Any suggestion or ideas ?

Guest

Re: About click....  Topic is solved

Post by Guest » 03 Sep 2017, 00:57

Code: Select all

Gui, Add, DropDownList, x87 y20 w30 h200 vD4, 0||1|2|3|4|5|6|7|8
Gui,Show
clicks:=["15, 516, 2","15, 506, 2","15, 496, 2"]
return

F5::
	clk:=[] 
	Gui, Submit, NoHide
	for a,b in clicks {
		if(d4>=a) {
			clk.push(b)
		}
	}
	for c,d in clk {
		click,% d
		Sleep,600
	} 
return

Marcosa1020
Posts: 160
Joined: 23 Sep 2015, 19:15

Re: About click....

Post by Marcosa1020 » 03 Sep 2017, 05:23

游客 wrote:

Code: Select all

Gui, Add, DropDownList, x87 y20 w30 h200 vD4, 0||1|2|3|4|5|6|7|8
Gui,Show
clicks:=["15, 516, 2","15, 506, 2","15, 496, 2"]
return

F5::
	clk:=[] 
	Gui, Submit, NoHide
	for a,b in clicks {
		if(d4>=a) {
			clk.push(b)
		}
	}
	for c,d in clk {
		click,% d
		Sleep,600
	} 
return
Thank you, but I don't understand the following

Code: Select all

clk:=[] 
	Gui, Submit, NoHide
	for a,b in clicks {
		if(d4>=a) {
			clk.push(b)
		}
	}
	for c,d in clk {
		click,% d
		Sleep,600
	} 
If program A:
Send {Click, 15, 516, 2} Sleep 600
Send {Click, 15, 512, 2} Sleep 700
Send {Click, 15, 509, 2} Sleep 650
Send {Click, 15, 507, 2} Sleep 680
Send {Click, 15, 506, 2} Sleep 600
Program B:
Send {Click, 15, 506, 2} Sleep 600
Send {Click, 15, 504, 2} Sleep 700
Send {Click, 15, 502, 2} Sleep 600
Program C:
Send {Click, 15, 496, 2} Sleep 700
Send {Click, 15, 495, 2} Sleep 800
Send {Click, 15, 492, 2} Sleep 700

How do I to modify it ? Can Be Simple ? Thank you for your patience.

Post Reply

Return to “Ask For Help”