-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path06 - [PT] Select Device Types.ahk
153 lines (127 loc) · 5.33 KB
/
06 - [PT] Select Device Types.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
143
144
145
146
147
148
149
150
151
152
153
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
$1:: ;NETWORK DEVICES
MouseGetPos, absXpos, absYpos, id
WinGetTitle, title, ahk_id %id%
If (InStr(title, "Cisco Packet Tracer")) ;NETWORK DEVICES
{
SetDefaultMouseSpeed, 0 ; makes mouse travel instantly
CoordMode, Mouse, Screen ; sets getPos to screen based
MouseGetPos, StartX, StartY ; gets your beginning mouse pos
CoordMode, Mouse, Relative ; sets the mouse to check relative to active window
MouseMove, 23, 933 ; moves mouse to correct button
Click ; clicks button
CoordMode, Mouse, Screen ; sets it back to screen mode, in case mouse wasn't in window
MouseMove, StartX, StartY ; sends mouse back to starting pos
}
else Send 1
Return
$2:: ;END DEVICES
MouseGetPos, absXpos, absYpos, id
WinGetTitle, title, ahk_id %id%
If (InStr(title, "Cisco Packet Tracer")) ;END DEVICES
{
SetDefaultMouseSpeed, 0 ; makes mouse travel instantly
CoordMode, Mouse, Screen ; sets getPos to screen based
MouseGetPos, StartX, StartY ; gets your beginning mouse pos
CoordMode, Mouse, Relative ; sets the mouse to check relative to active window
MouseMove, 52, 929 ; moves mouse to correct button
Click ; clicks button
CoordMode, Mouse, Screen ; sets it back to screen mode, in case mouse wasn't in window
MouseMove, StartX, StartY ; sends mouse back to starting pos
}
else Send 2
Return
$3:: ;COMPONENTS
MouseGetPos, absXpos, absYpos, id
WinGetTitle, title, ahk_id %id%
If (InStr(title, "Cisco Packet Tracer")) ;COMPONENTS
{
SetDefaultMouseSpeed, 0 ; makes mouse travel instantly
CoordMode, Mouse, Screen ; sets getPos to screen based
MouseGetPos, StartX, StartY ; gets your beginning mouse pos
CoordMode, Mouse, Relative ; sets the mouse to check relative to active window
MouseMove, 84, 933 ; moves mouse to correct button
Click ; clicks button
CoordMode, Mouse, Screen ; sets it back to screen mode, in case mouse wasn't in window
MouseMove, StartX, StartY ; sends mouse back to starting pos
}
else Send 3
Return
$4:: ;CONNECTIONS
MouseGetPos, absXpos, absYpos, id
WinGetTitle, title, ahk_id %id%
If (InStr(title, "Cisco Packet Tracer")) ;CONNECTIONS
{
SetDefaultMouseSpeed, 0 ; makes mouse travel instantly
CoordMode, Mouse, Screen ; sets getPos to screen based
MouseGetPos, StartX, StartY ; gets your beginning mouse pos
CoordMode, Mouse, Relative ; sets the mouse to check relative to active window
MouseMove, 117, 933 ; moves mouse to correct button
Click ; clicks button
CoordMode, Mouse, Screen ; sets it back to screen mode, in case mouse wasn't in window
MouseMove, StartX, StartY ; sends mouse back to starting pos
}
else Send 4
Return
$5:: ;MISC
MouseGetPos, absXpos, absYpos, id
WinGetTitle, title, ahk_id %id%
If (InStr(title, "Cisco Packet Tracer")) ;MISC
{
SetDefaultMouseSpeed, 0 ; makes mouse travel instantly
CoordMode, Mouse, Screen ; sets getPos to screen based
MouseGetPos, StartX, StartY ; gets your beginning mouse pos
CoordMode, Mouse, Relative ; sets the mouse to check relative to active window
MouseMove, 149, 933 ; moves mouse to correct button
Click ; clicks button
CoordMode, Mouse, Screen ; sets it back to screen mode, in case mouse wasn't in window
MouseMove, StartX, StartY ; sends mouse back to starting pos
}
else Send 5
Return
$6:: ;MULTIUSER CONNECTIONS
MouseGetPos, absXpos, absYpos, id
WinGetTitle, title, ahk_id %id%
If (InStr(title, "Cisco Packet Tracer")) ;MULTIUSER CONNECTIONS
{
SetDefaultMouseSpeed, 0 ; makes mouse travel instantly
CoordMode, Mouse, Screen ; sets getPos to screen based
MouseGetPos, StartX, StartY ; gets your beginning mouse pos
CoordMode, Mouse, Relative ; sets the mouse to check relative to active window
MouseMove, 181, 933 ; moves mouse to correct button
Click ; clicks button
CoordMode, Mouse, Screen ; sets it back to screen mode, in case mouse wasn't in window
MouseMove, StartX, StartY ; sends mouse back to starting pos
}
else Send 6
Return
; -------------------------Collection Pos Info----------------------------
NumpadEnter::
CoordMode, Mouse, Screen
MouseGetPos, absXpos, absYpos
;MsgBox
CoordMode, Mouse, Relative
MouseGetPos, relXpos, relYpos
MsgBox Relative X=%relXpos% Relatvie Y=%relYpos%`nScreen X=%absXpos% Screen Y=%absYpos%
Return
; --------------------------------------------------------------------
; -------------------------Script Controls----------------------------
; --------------------------------------------------------------------
^!Numpad0:: ;reloads script, displays tooltip
;TrayTip ,-Reloading-, %A_ScriptName%, 2, 16
;sleep 2000
;HideTrayTip ()
Reload
Return
!NumpadSub:: ;kills script, displays tooltip
;TrayTip , Attempting to -KILL-, %A_ScriptName%, 3 , 16
;sleep (2500)
;HideTrayTip ()
ExitApp
Return
^Numpad0::num=0 ;reset Extension to beginning of script
; --------------------------------------------------------------------
; --------------------------------------------------------------------