forked from raine/easyuo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
multipoisoner.txt
270 lines (215 loc) · 4.78 KB
/
multipoisoner.txt
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
; Multipoisoner
;
; Applies poisons on multiple weapons
; Wipes weapon clean if selected weapon is already poisoned
set %kegType QMJ
set %emptyPotType WUF
set %poisonType AVF
set %oilClothType RTI
gosub askForWeapons
gosub poisonWeapons
stop
sub poisonWeapons
if %wepCount < 1
{
event SysMessage Quitting..
stop
}
set %cur 0
repeat
set %weaponID % . wep . %cur
gosub getName %weaponID
str Lower #result
set %tmp %cur + 1
event SysMessage Poisoning a #strres [ , %tmp , / , %wepCount , ]
gosub poisonWeapon %weaponID
if #result = #true
set %cur %cur + 1
until %cur = %wepCount
event SysMessage Done!
return
sub poisonWeapon
gosub got %poisonType
set %poison #result
; No poison pots, check for empty pot and keg
if %poison = #false
{
gosub got %emptyPotType
if #result = #false
{
display No empty potions! Get one
gosub waitUntilExists %emptyPotType
}
; Pour poison from a keg
gosub getPoisonFromKeg #result
if #result = #true
{
gosub got %poisonType
set %poison #result
}
else
return #false
}
; Poisoning skill has a cooldown of 10 seconds
; regardless of if you actually use it, so if poisoning fails because a weapon
; has poison on it, we can't attempt to again right away.
if %lastPoisoning <> N/A
{
repeat
set %timeSincePoisoning #systime - %lastPoisoning
sleep 1
until %timeSincePoisoning > 10500
}
set %lastPoisoning #systime
event Macro 13 30 ; poisoning
target
gosub target %poison
target
set %jrnl #jindex ; where were we in the journal before poisoning anything
gosub target %weaponID
while #true
{
if #jindex > %jrnl
{
set %jrnl %jrnl + 1
scanjournal %jrnl
if you_apply_the_poison in #journal
return #true
if cannot_poison in #journal
return #true
if must_be_wiped_clean in #journal
{
gosub wipeWeapon %weaponID
; weapon ignored
if #result = #false
return #true
else
return #false
}
}
}
return
sub wipeWeapon
gosub got %oilClothType
set %oilCloth #result
if #result = #false
{
display yesno No oil cloth to clean the weapon with!$Pause the script until you get oil cloth or ignore the poisoned weapon and go on?
if #dispRes = yes
{
pause
gosub waitUntilExists %oilClothType
gosub wipeWeapon %weaponID
}
else
return #false
}
else
{
; The weapon has to be in the backpack to be able to wipe it
finditem %weaponID
set %origPack #findbagid
; Move item to backpack
if #findbagid <> #backpackid
gosub moveItem %weaponID #backpackid
gosub use %oilCloth
target
gosub target %weaponID
; Move item to the original bag
if %origPack <> #backpackid
gosub moveItem %weaponID %origPack
}
return
sub getPoisonFromKeg
gosub got %kegType
; No keg to pour the poison from!
if #result = #false
{
display No keg! Place a poison keg in your backpack
gosub waitUntilExists %kegType
}
set %jrnl #jindex
gosub use #result
while #true
{
if #jindex > %jrnl
{
set %jrnl %jrnl + 1
scanjournal %jrnl
if keg_is_empty in #journal
{
display Keg is empty!$Pausing script, press play after you have poison in some form in your pack
pause
return #false
}
if pour_some in #journal
return #true
}
}
return
sub target
set #ltargetid %1
event macro 22
return
sub waitUntilExists
set #findid X
repeat
finditem %1 C_ , #backpackid
sleep 1
until #findid <> X
return #findid
sub use
set #lobjectid %1
event macro 17
return
sub got
finditem %1 C_ , #backpackid
if #findcnt > 0
return #findid
else
return #false
return
sub askForWeapons
event SysMessage Target all weapons you wish poison and hit ESC when you're done
set %wepCount 0
repeat
gosub getTarget
if #result <> X
gosub addWeapon #result
until #ltargetid = X
event SysMessage OK! %wepCount weapon(s) chosen.
return
sub addWeapon
; check if weapon has already been chosen
set %j %wepCount - 1
for %i 0 %j
{
if % . wep . %i = %1
return
}
set % . wep . %wepCount %1
gosub output %1
set %wepCount %wepCount + 1
return
sub getTarget
set #ltargetid X
set #targcurs 1
targloop:
if #targcurs = 1
goto targloop
return #ltargetid
sub output
gosub getName %1
event sysmessage #result
return
sub getName
event Property %1
str Pos #property $
set %subt #strres - 1
str Left #property %subt
return #strres
sub moveItem
exevent Drag %1
exevent Dropc %2
sleep 600
return