-
Notifications
You must be signed in to change notification settings - Fork 0
/
inauriIdle.cmd
298 lines (263 loc) · 9.41 KB
/
inauriIdle.cmd
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
include libmaster.cmd
###############################
### IDLE ACTION TRIGGERS
###############################
action put #var inauri.heal 1 ; put #var inauri.healTarget $1 ; goto inauriIdle-healWound when ^($friends) whispers, "heal
#action put #var inauri.heal 0 when ^(\S+) is not wounded in that location\.$
action var inauriIdle.openDoor 1 when ^($friends)'s face appears in the
action goto moveToHouse when ^($friends) whispers, "inside|^($friends) whispers, "outside
action var inauriIdle.wounds 0 when \.\.\. no injuries to speak of\.
action var inauriIdle.openDoor 0 when ^(\S+) opens the door\.
action var inauriIdle.disease 1 when (Her|His) wounds are infected\.|(Her|His) wounds are badly infected\.|(He|She) has a dormant infection that could make wounds worse\.
action var inauriIdle.poison 1 when ^(He|She) has a (dangerously|mildly|critically|seriously) poisoned(.*)\.
action var inauriIdle.poisonSelf 1 when ^You fall to your knees as the world spins around and around\!|You feel a slight twinge in your|^You feel a (sharp|terrible) pain in your|The presence of a faint greenish tinge about yourself\.
action var inauriIdle.poisonSelf 0 when ^A sudden wave of heat washes over you as your spell flushes all poison from your body\.
action var inauriIdle.teachTrigger 1; var inauriIdle.topic $2 ; var inauriIdle.target $1 when ^($friends) whispers, \"teach (\S+)\"$
action var inauriIdle.vitality 1 when ^(\S+) is suffering from a .+ loss of vitality.*$
action var inauriIdle.vitality 0 when ^(\S+) has normal vitality\.$
action var inauriIdle.wounds 1 when Wounds to the.*$
action goto inauriIdle-vitalityHeal when eval $health < 80
###############################
### VARIABLES
###############################
if (!($lastLookGametime >0)) then put #var lastLookGametime 0
if (!($lastTrainerGametime >0)) then put #var lastTrainerGametime 0
var inauriIdle.disease 0
var inauriIdle.diseaseSelf 0
var inauriIdle.openDoor 0
var inauriIdle.poison 0
var inauriIdle.poisonSelf 0
var inauriIdle.target 0
var inauriIdle.teach 0
var inauriIdle.teachTrigger 0
var inauriIdle.topic 0
if !(matchre("$scriptlist", "reconnect")) then {
put .reconnect
}
if !(matchre("$scriptlist", "afk")) then {
put .afk
}
###############################
### MAIN
###############################
inauriIdle-loop:
gosub inauriIdle-locationCheck
if (%inauriIdle.teachTrigger = 1) then {
gosub inauriIdle-teach
}
if ($standing = 0) then gosub stand
if ($health < 80) then gosub inauriIdle-vitalityHeal
if (%inauriIdle.poison = 1 || %inauriIdle.poisonSelf = 1) then gosub inauriIdle-healPoison
if (%inauriIdle.disease = 1 || %inauriIdle.diseaseSelf = 1) then gosub inauriIdle-healDisease
if ($mana > 30 && $SpellTimer.Regenerate.duration < 1) then gosub refreshRegen
if ($Empathy.LearningRate < 33 && $lib.magicInert <> 1) then gosub percHealth.onTimer
if ($Attunement.LearningRate < 33 && $lib.magicInert <> 1) then gosub perc.onTimer
if (%inauriIdle.openDoor = 1) then gosub inauriIdle-door
gosub almanac.onTimer
pause 2
gosub inauriIdle-look
goto inauriIdle-loop
###############################
### METHODS
###############################
inauriIdle-caracal:
evalmath nextTrainerAt $lastTrainerGametime + 3600
if (%nextTrainerAt > $gametime) then {
return
}
gosub inauriIdle.clearHands
if ($First_Aid.LearningRate < 15 && $Skinning.LearningRate < 15) then {
put #echo >Log #009933 [inauriIdle] Beginning trainer.
gosub runScript caracal
put #echo >Log #009933 [inauriIdle] Trainer complete. FA:($First_Aid.LearningRate/34) SK:($Skinning.LearningRate/34)
put #var lastTrainerGametime $gametime
}
return
inauriIdle-clearHands:
if ("$righthand" <> "Empty") then {
gosub stow
}
if ("$lefthand" <> "Empty") then {
gosub stow left
}
return
inauriIdle-door:
if (%inauriIdle.openDoor = 0) then goto inauriIdle-loop
gosub unlock door
gosub open door
var inauriIdle.openDoor 0
goto inauriIdle-loop
inauriIdle-forage:
if ($Outdoorsmanship.LearningRate < 10) then {
put #echo >Log #009933 [inauriIdle] Going to forage.
gosub moveToForage
gosub automove 49
gosub runScript forage
put #echo >Log #009933 [inauriIdle] Forage complete. Outdoor:($Outdoorsmanship.LearningRate/34) Perc:($Perception.LearningRate/34)
gosub runScript house
gosub inauriIdle.restart
}
return
inauriIdle-healDisease:
if (%inauriIdle.disease) then {
gosub touch $inauri.healTarget
gosub take $inauri.healTarget disease quick
var inauriIdle.disease 0
var inauriIdle.diseaseSelf 1
}
if (%inauriIdle.diseaseSelf = 1) then {
gosub runScript cast cd
var inauriIdle.diseaseSelf 0
}
return
inauriIdle-healWound:
if ($inauri.healTarget = 0) then {
put #var inauri.heal 0
goto inauriIdle-loop
}
gosub redirect all to left leg
gosub touch $inauri.healTarget
var inauriIdle.injuryCheck (%inauriIdle.wounds + %inauriIdle.vitality + %inauriIdle.disease + %inauriIdle.poison)
if (%inauriIdle.injuryCheck > 0) then {
if (%inauriIdle.vitality = 1) then {
gosub take $inauri.healTarget vitality quick
}
if (%inauriIdle.poison) then {
gosub touch $inauri.healTarget
gosub take $inauri.healTarget poison quick
var inauriIdle.poison 0
}
if (%inauriIdle.disease) then {
gosub touch $inauri.healTarget
gosub take $inauri.healTarget disease quick
var inauriIdle.disease 0
var inauriIdle.diseaseSelf 1
}
if (%inauriIdle.wounds = 1) then {
gosub take $inauri.healTarget ever quick
}
} else {
gosub whisper $inauri.healTarget You have no wounds.
}
put #var inauri.heal 0
goto inauriIdle-loop
inauriIdle-healPoison:
if (%inauriIdle.poison) then {
gosub touch $inauri.healTarget
gosub take $inauri.healTarget poison quick
var inauriIdle.poison 0
}
if (%inauriIdle.poisonSelf = 1) then {
gosub runScript cast fp
var inauriIdle.poisonSelf 0
}
return
inauriIdle-locationCheck:
if ("$roomname" = "Private Home Interior") then {
return
} else {
gosub runScript house
}
return
inauriIdle-look:
evalmath nextLookAt $lastLookGametime + 240
if (%nextLookAt < $gametime) then {
gosub tdp
put #var lastLookGametime $gametime
}
return
inauriIdle.restart:
put #echo >log Gray [inauriIdle] Restarting script..
goto inauriIdle-loop
inauriIdle-teach:
if ("$lib.topic" <> "0") then {
gosub assess teach
if ("%inauriIdle.target" = "Selesthiel") then {
if ("$lib.topic" = "Enchanting") then {
put kiss Selesthiel forehead
var inauriIdle.teachTrigger 0
return
} else {
if ($lib.student = 1) then {
gosub stop listen
}
gosub stop teach
gosub teach %inauriIdle.topic to %inauriIdle.target
put #echo >Log2 [inauriidle] Swapping to %inauriIdle.topic class.
var inauriIdle.teachTrigger 0
return
}
} else {
if contains("$lib.topic", "%inauriIdle.topic") then {
put whisper %inauriIdle.target I am already teaching you $lib.topic.
var inauriIdle.teachTrigger 0
return
}
if (contains("$roomplayers", "Selesthiel") && "$lib.topic" = "Enchanting") then {
var inauriIdle.teachTrigger 0
return
} else {
gosub stop teach
gosub teach %inauriIdle.topic to %inauriIdle.target
put #echo >Log2 [inauriidle] Swapping to %inauriIdle.topic class.
var inauriIdle.teachTrigger 0
return
}
}
} else {
if ($lib.student = 1) then {
gosub stop listen
}
gosub stop teach
gosub teach %inauriIdle.topic to %inauriIdle.target
var inauriIdle.teachTrigger 0
}
return
inauriIdle-vitalityHeal:
gosub link all cancel
if ($lib.magicInert = 1 && $bleeding = 1) then {
put #echo >Log [inauriIdle] Bleeding, low vitality, and magically inert.
put exit
exit
}
inauriIdle-vitalityHealLoop:
pause .2
gosub prep vh
pause 2
gosub cast
if ($health < 98) then {
goto inauriIdle-vitalityHealLoop
}
goto inauriIdle-loop
###############################
### MOVE TO
###############################
moveToForage:
if ("$roomname" = "Private Home Interior") then {
gosub runScript house
goto moveToForage
}
# Crossing - City
if ($zoneid = 1) then {
if ($roomid = 258) then return
gosub automove 259
goto moveToForage
}
# Crossing - North Gate
if ($zoneid = 6) then {
gosub automove crossing
goto moveToForage
}
# Shard - East Gate
if ($zoneid = 66) then {
if ($roomid = 555) then return
gosub automove 555
}
# Fang Cove
if ($zoneid = 150) then return
if ($roomid = 49) then return
gosub automove 49
goto moveToForage
moveToHouse:
gosub runScript house
return