-
Notifications
You must be signed in to change notification settings - Fork 0
/
paimonscript.ahk
149 lines (141 loc) · 3.49 KB
/
paimonscript.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
; PaimonScript by Cyrus Yip
SetWorkingDir % A_ScriptDir
if (FileExist("local.ini")) {
config := "local.ini"
}
Else {
config := "config.ini"
}
IniRead, Enabled, %config%, PaimonScript, enabled
if (not Enabled == "true") {
MsgBox, PaimonScript is not enabled`, check config.ini or local.ini
ExitApp
}
if (A_IsAdmin != true) {
Run *RunAs "%A_ScriptFullPath%"
ExitApp
}
IniRead, Exe, %config%, PaimonScript, genshinExe
IniRead, InteractEnabled, %config%, QuickInteract, enabled
IniRead, InteractTriggerKey, %config%, QuickInteract, triggerKey
IniRead, InteractTriggeredKey, %config%, QuickInteract, triggeredKey
IniRead, AARREnabled, %config%, AARR, enabled
IniRead, BunnyEnabled, %config%, BunnyHop, enabled
IniRead, BunnyKey, %config%, BunnyHop, key
IniRead, BunnyForward, %config%, BunnyHop, autoForward
IniRead, CookEnabled, %config%, AutoCook, enabled
IniRead, CookAutoConfirm, %config%, AutoCook, autoConfirm
IniRead, CookX, %config%, AutoCook, buttonX
IniRead, CookStart, %config%, AutoCook, startY
IniRead, CookStop, %config%, AutoCook, stopY
global CookAutoConfirm
global CookX := Format("{:d}", CookX)
global CookStart := Format("{:d}", CookStart)
global CookStop := Format("{:d}", CookStop)
IniRead, CookAdeptusTemptation, %config%, AutoCook, adeptusTemptation
IniRead, CookRicePudding, %config%, AutoCook, ricePudding
if (InteractEnabled == "true") {
#If WinActive("ahk_exe" Exe)
Hotkey, $%InteractTriggerKey%, QuickInteract
}
if (AARREnabled == "true") {
#If WinActive("ahk_exe" Exe)
Hotkey, $LButton, AARR
}
if (BunnyEnabled == "true") {
#If WinActive("ahk_exe" Exe)
Hotkey, $%BunnyKey%, BunnyHop
}
if (CookEnabled == "true") {
if (CookAdeptusTemptation) {
#If WinActive("ahk_exe" Exe)
Hotkey, $%CookAdeptusTemptation%, AdeptusTemptation
}
if (CookRicePudding) {
#If WinActive("ahk_exe" Exe)
Hotkey, $%CookRicePudding%, RicePudding
}
}
; Quick Pickup/Skip Conversation
direction = 1
times = 0
QuickInteract:
Send, %InteractTriggeredKey%
Sleep, 100f
While GetKeyState(InteractTriggerKey,"P") {
if (direction) {
Send, {WheelDown}
}
Else {
Send, {WheelUp}
}
times += 1
if (times = 2) {
direction := !direction
times = 0
}
Sleep, 30
Send, %InteractTriggeredKey%
Sleep, 30
}
Return
; AARR Attack Sequence
in_aarr = 0
AARR:
Send, {Click Left}
Sleep, 300
step = 1
if (in_aarr) Return
in_aarr = 1
While GetKeyState("LButton","P") {
if (step = 0) {
Send, {Click Left}
Sleep, 300
}
if (step = 1) {
Send, {Click Left}
Sleep, 200
}
if (step = 2) {
Send, r
Sleep, 100
Send, r
Sleep, 200
step = -1
}
step += 1
}
in_aarr = 0
Return
; Bunny Hop
BunnyHop:
Send, {Click Right}
Sleep, 50
if (BunnyForward == "true") {
Send, {w Down}
}
Sleep, 350
While GetKeyState(BunnyKey, "P") {
Send, {Space}
Sleep, 100
}
if (BunnyForward == "true") {
Send, {w Up}
}
Return
; Auto Food Cooker
Cook(delay) {
Click %CookX%, %CookStart%
Sleep, %delay%
Click %CookX%, %CookStop%
if (CookAutoConfirm == "true") {
Sleep, 2000
Click %CookX%, %CookStop%
}
}
AdeptusTemptation:
Cook(2200)
Return
RicePudding:
Cook(1700)
Return