sub start creeps map warpack droppack callback var mxweight uo str cou

  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
sub start(creeps, map, warpack, droppack, callback)
var i, mxweight = uo.str * 4, count = creeps[0] -1, flag = true
if (not (between(uo.getx(), 6015, 6041, false) && between(uo.gety(), 2934, 2970, false))) then
uo.useObject(set_bank)
controlItems(warpack, droppack)
map.forward(map)
endif
while (uo.getHP() > 20 && uo.weight < mxweight && flag )
for i = 1 to count
flag = seekAndDestroy(creeps[i], callback )
if flag then
map.center(map)
checklag()
eatFood()
else
i = count
endif
wait(100)
next
wait(1000)
#blessWeapon()
wend
map.backward(map)
uo.useObject(set_bank)
checklag()
controlItems(warpack, droppack)
checklag()
healSelfFull()
checklag()
start(creeps, map, warpack, droppack, callback)
endsub
sub blessWeapon()
var name = getName(set_weapon)
if strpos(name, 'blessed') then
uo.waitTargetObject(set_weapon)
uo.cast('Bless')
endif
endsub
sub strpos( highstack, needle )
var i
if strlen( highstack ) < strlen( needle ) then
return 0
endif
for i = 0 to strlen( highstack ) - strlen( needle )
if MID( highstack, i, strlen( needle ) ) == needle then
return i + 1
endif
next
return 0
endsub
sub getName( object )
if uo.getName( object ) == "" then
uo.click( object )
checklag()
endif
return uo.getName( object )
endsub
sub eatFood()
return
var len = 2, i
dim food[val(str(len))]
food[0] = len
food[1] = '0x097B' ; fish stake
for i = 1 to food[0] - 1
next
endsub
Sub between( num, min, max, strict )
If num > min && num < max Then
return true
EndIf
If num >= min && num <= max && Not strict Then
return true
EndIf
return false
End Sub
sub controlItems(war,drop)
var wlen = war[0] - 2, dlen = drop[0] - 1, i, j
for i = 1 to wlen step 2
#setItemQuantity(leather, '-1', 'backpack', 'lastcontainer', 999999, 1)
setItemQuantity( war[i], '-1', 'lastcontainer', 'backpack', war[i+1], 1)
wait(400)
next
for j = 1 to dlen
setItemQuantity( drop[j], '-1', 'backpack', 'lastcontainer', 999999, 1)
wait(400)
next
endsub
sub seekAndDestroy( type, callback )
for var i = 1 to 18
UO.Set('finddistance', str(i) )
uo.FindType( type, '-1', 'ground')
if uo.FindCount() then
if killTarget('finditem') then
checklag()
lootCorpse()
if callback then
checklag()
uo.exec('exec ' + callback)
endif
return true
else
return false
endif
endif
#wait(100)
next
return false
endsub
sub lootCorpse()
var len = 24, i, LC = 'lastcorpse', L = 'lastcontainer'
dim loot[val(str(len))]
loot[0] = '0x0F8C' ; sa
loot[1] = '0x1078' ; zhir
loot[2] = '0x0EED' ; gold
loot[3] = '0x0F8D' ; ss
loot[4] = '0x0F7B' ; bm
loot[5] = '0x0F7A' ; bp
loot[6] = '0x0F84' ; ga
loot[7] = '0x0F85' ; gl
loot[8] = '0x0F86' ; mr
loot[9] = '0x0F88' ; ns
loot[10] = '0x0E76' ;bagpack
loot[11] = '0x1F5D' ; scroll
loot[12] = '0x1F57'; scroll
loot[13] = '0x1F67'; scroll
loot[14] = '0x1F54' ; scroll
loot[15] = '0x1F4F'; scroll
loot[16] = '0x1F61'; scroll
loot[17] = '0x1F5C'; scroll
loot[18] = '0x1F50'; scroll
loot[19] = '0x1F56'; scroll
loot[20] = '0x1F52'; scroll
loot[21] = '0x1F68'; scroll
loot[22] = '0x1F63'; scroll
loot[23] = '0x0F81'; firtle dirth
uo.WaitTargetObject(LC)
uo.useObject(set_knife)
wait(500)
uo.useObject(LC)
checklag()
for i = 0 to len - 1
uo.FindType( loot[i] ,'-1', L)
while uo.FindCount()
uo.moveitem('finditem', 'all')
uo.FindType( loot[i] ,'-1', L)
wait(50)
wend
wait(50)
next
wait(100)
uo.FindType( loot[1] ,'-1', 'backpack')
if uo.FindCount() then
uo.WaitTargetObject('finditem')
uo.useObject(set_scissors)
endif
endsub
sub attack()
uo.attack('laststatus')
uo.attack('laststatus')
endsub
sub heal(target)
uo.waitTargetObject(target)
uo.useType('bandage')
endsub
sub hself()
heal('self')
checklag()
equipWeapon()
endsub
sub healSelfFull()
while uo.gethp('self') < uo.str
uo.findType('bandage','-1','backpack')
if uo.FindCount() then
heal('self')
wait(5000)
else
wait(1000)
endif
checklag()
wend
endsub
sub equipWeapon()
uo.equip('Rhand', set_weapon)
if set_shield then
uo.equip('Lhand', set_shield)
endif
endsub
sub killTarget(target)
if between(uo.getx(target), 6015, 6019, false) then
return true
endif
var shp, str = uo.str, T
equipWeapon()
uo.warmode(1)
uo.Attack(target)
Walker(uo.getx(target), uo.gety(target), 1)
while (uo.getHP(target) > 0)
if GetDistance(uo.getx(target), uo.gety(target)) > 1 then
Walker(uo.getx(target), uo.gety(target),1)
endif
uo.Attack(target)
wait(1000)
shp = uo.gethp('self')
uo.Attack(target)
if shp < str - 9 then
if shp < 45 then
heal('self')
checklag()
equipWeapon()
return false
endif
#uo.warmode(0)
checklag()
T = 0
heal('self')
wait(100)
equipWeapon()
while (uo.gethp('self') == shp && T < 50)
T = T + 1
wait(100)
wend
#wait(5000)
checklag()
#uo.warmode(1)
endif
wend
uo.warmode(0)
return true
endsub
sub map.forward(map)
for var i = 1 to map[0] - 2 step 2
Walker(map[i],map[i+1],1)
checklag()
next
endsub
sub map.center(map)
var l = map[0], x = l - 2, y = l - 1
Walker(map[x],map[y],4)
endsub
sub map.backward(map)
var len = map[0], mx = map[0] - 2, x, y
for var i = 1 to mx step 2
Walker(map[len-i-1], map[len-i], 1)
checklag()
next
endsub