-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGZH_2x4_friend_hard_GLA.ahk
142 lines (131 loc) · 3.41 KB
/
GZH_2x4_friend_hard_GLA.ahk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
; This entire line is a comment.
; dash | %USERPROFILE%\AppData\Local\Programs\AutoHotkey\UX\AutoHotkeyUX.exe "ui-dash.ahk"
; WindowSpy | %USERPROFILE%\AppData\Local\Programs\AutoHotkey\UX\AutoHotkeyUX.exe "WindowSpy.ahk"
; https://www.autohotkey.com/docs/v2/lib/WinMove.htm
; WinMove X, Y, Width, Height, WinTitle, WinText, ExcludeTitle, ExcludeText
;
; https://www.autohotkey.com/boards/viewtopic.php?t=119814
#Requires AutoHotkey v2
MyWinTitle := "Command & Conquer (TM) Generals Zero Hour"
if WinExist(MyWinTitle)
{
WinGetPos &Xpos, &Ypos , &Wpos, &Hpos , "A" ; Use the window found by WinExist. | https://www.autohotkey.com/docs/v1/lib/WinGetPos.htm
MsgBox "MyWinTitle is at " Xpos " , " Ypos " , " Wpos " , " Hpos
WinActivate ; Use the window found by WinExist.
; WinMove 100, 100, 1600 , 1024, MyWinTitle
; multiplier button = 1200 300
; Enter server from main menu
; Enter_server_from_main_menu()
create_game_from_main_menu()
clash_4_x_4()
}
MyWinTitle := "Command Prompt"
;if WinExist(MyWinTitle)
; WinMove 100, 100, 100, 512, MyWinTitle
;MyWinTitle := "смотреть онлайн"
;if WinExist(MyWinTitle)
; WinMove 1345 , 18 , 1192 , 672, MyWinTitle
;MyWinTitle := "YouTube"
;if WinExist(MyWinTitle)
; WinMove 1353 , 789 , 1201 , 596, MyWinTitle
;MyWinTitle := "ישראל נלחמת"
;if WinExist(MyWinTitle)
; WinMove 1659 , 699 , 886 , 660, MyWinTitle
;else
; Run, chrome.exe "https://www.youtube.com/watch?v=JpS383vI1_I" " --new-window "
;{
;
;
;}
; AHK | Error: Target window not found.
; AHK | ahk see if WinTitle exist | WinExist(WinTitle, WinText, ExcludeTitle, ExcludeText)
; AHK | open web page
; Run, chrome.exe "https://www.youtube.com/watch?v=JpS383vI1_I" " --new-window "
; ==== Functions ====
Enter_server_from_main_menu()
{
MouseMove 1200, 300, 50
Click
sleep 2000 ;(wait 2 seconds)
Click
}
create_game_from_main_menu()
{
my_click_on(1200,300)
sleep 2000 ;(wait 2.0 seconds)
my_click_on(1200,300)
my_click_on(350,920)
}
clash_4_x_4()
{
; Select second as Hard Army
; set_line_as_hard_army(2)
; Select 3rd as Hard Army
set_line_as_hard_army(3)
; Select 4th as Hard Army
set_line_as_hard_army(4)
; Select 5th as Hard Army
set_line_as_hard_army(5)
; Select 6th as Hard Army
set_line_as_hard_army(6)
; Select 7th as Hard Army
; set_line_as_hard_army(7)
; Select 8th as Hard Army
; set_line_as_hard_army(8)
set_line_as_group1(1)
; set_line_as_group1(2)
set_line_as_group2(3)
set_line_as_group2(4)
set_line_as_group2(5)
set_line_as_group2(6)
; set_line_as_group2(7)
; set_line_as_group2(8)
set_line_as_GLA(3)
set_line_as_GLA(4)
set_line_as_GLA(5)
set_line_as_GLA(6)
}
my_click_on(mX,mY)
{
; MouseMove, mX, mY, 50 ; slow oftion
; MouseMove, mX, mY, 5 ; fater option
; MouseMove mX, mY, 50 ; fater option
SendMode("Event")
MouseMove(mX, mY, 5)
Click
sleep 400 ;(wait 0.4 seconds)
}
set_line_as_hard_army(line_num)
{
mX := 350
mY := 230 + (line_num-1) * 40
my_click_on(mX,mY)
my_click_on(mX,mY + 150)
}
set_line_as_GLA(line_num)
{
mX := 700
mY := 230 + (line_num-1) * 40
my_click_on(mX,mY)
my_click_on(mX,mY + 120)
}
set_line_as_group1(line_num)
{
mX := 1020
mY := 230 + (line_num-1) * 40
my_click_on(mX,mY)
my_click_on(mX,mY + 60)
}
set_line_as_group2(line_num)
{
mX := 1020
mY := 230 + (line_num-1) * 40
my_click_on(mX,mY)
my_click_on(mX,mY + 90)
}
Esc::ExitApp ; Pres Esc to get here
;Esc:: ; Pres Esc to get here
; Suspend
; ExitApp
; ;Pause,, 1 ; for v1
;Return