-
Notifications
You must be signed in to change notification settings - Fork 6
/
Teleport.ahk
117 lines (116 loc) · 2.66 KB
/
Teleport.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
#Include Gui.ahk
SendMode Input
checkWindowTP(byref active_id){
width := 816
height := 639
outputDebug, windowName %windowName%
WinGet id, ID, %windowName%
active_id := id
IfWinExist %windowName%
{
WinActivate ; use the window found above
WinGetPos,winX,winY,curWidth,curHeight
if(curWidth != width || curHeight != height)
WinMove, %windowName%, , , , width, height
return true
}
else{
TrayTip TTR Tools, "Toontown Application not open", 1, 1
guiText("txt", "Toontown not open")
return false
}
}
safeClickTP(x,y){
checkWindowTP(active_id)
MouseGetPos, mouseX, mouseY
MouseMove, x, y
sleep,25
ControlClick,X%x% Y%y%,ahk_id %active_id%,,,1, NA
ControlSend,, {Ctrl},ahk_id %active_id%
}
tpClick(x, y){
OutputDebug checking window
checkWindowTP(active_id)
OutputDebug window checked %windowName%
PixelGetColor,bookOpenCheck,40,315, RGB
bookDist := RGB_Euclidian_Distance(bookOpenCheck,0x0D2666)
if(bookDist > 5)
safeClickTP(780,595)
Sleep, 170
safeClickTP(685,180)
safeClickTP(x,y)
}
F5::
InputBox, uReqq, Teleport to:, Please enter the location you wish to teleport to.,,315,130
if ErrorLevel
return
else {
StringLower uReq, uReqq
if(uReq == "aa" || RegExMatch(uReq,"(acorn)") || RegExMatch(uReq,"(acres)") || RegExMatch(uReq,"(chip)")) || RegExMatch(uReq,"(dale)"){
;Chip & Dale's Acorn Acres
tpClick(465,420)
return
}
if(uReq == "bbhq" || RegExMatch(uReq,"(boss)")){
;Bossbot HQ
tpClick(610,415)
return
}
if(uReq == "cbhq" || RegExMatch(uReq,"(cash)")){
;Cashbot HQ
tpClick(212,131)
return
}
if(uReq == "dd" || RegExMatch(uReq,"(dock)")){
;donald's dock
tpClick(585,300)
return
}
if(uReq == "ddl" || RegExMatch(uReq,"(dream)")){
;Donald's Dreamland
tpClick(383,152)
return
}
if(uReq == "dg" || RegExMatch(uReq,"(gardens)") || RegExMatch(uReq,"(daisy)")) {
;daisy gardens
tpClick(325,395)
return
}
if(uReq == "e" || uReq == "estate" || uReq == "home"){
;estate
tpClick(450,495)
return
}
if(uReq == "gs" || RegExMatch(uReq,"(speedway)") || RegExMatch(uReq,"(goofy)")){
;Goofy Speedway
tpClick(256,280)
return
}
if(uReq == "lbhq" || RegExMatch(uReq,"(law)")){
;Lawbot HQ
tpClick(620,128)
return
}
if(uReq == "mml" || RegExMatch(uReq,"(minnie)") || RegExMatch(uReq,"(melodyland)")){
;Minnie's Melodyland
tpClick(445,240)
return
}
if(uReq == "p" || RegExMatch(uReq,"(play)")){
;Playground
tpClick(575,485)
return
}
if(uReq == "sbhq" || RegExMatch(uReq,"(sell)")){
;Sellbot HQ
tpClick(210,420)
return
}
if(uReq == "ttc" || RegExMatch(uReq,"(central)") || || RegExMatch(uReq,"(toontown)")){
;Toontown Central
tpClick(415,305)
return
}
MsgBox, ,TTR-Tools,No locations found.
}
return