Avel Mink wrote:
И еще не могу понять почему скрипт не зацикливается, то есть берет всего один раз руду, хотя в ящике ее много
Во первых ни в одном скрипте ты не указал ID сундуков, var Box_for_trash_ore и т.д. ?!?!? Инжа не телепат, она не знает что ты имеешь ввиду.
И что ты хочешь? Надо прописать ID сундука в котором ищещь. По поводу третьего, вставь цикл repeat until, без него он не будет зацикливаться. Я же тебе кучу подобных скриптов писал, посмотри там. Просто тут столько грамматических ошибок, что если править, то проще написать занова.
Смотри сравнивай, ищи ошипки:
Code:
sub Count_trash_ing()
var i, p, name, cen, sum = 0
DIM item[7]
item[0] = '0x0750' ## - Rusty Ingot
item[1] = '0x0590' ## - Old Copper Ingot
item[2] = '0x060A' ## - Dull Copper Ingot
item[3] = '0x0488' ## - Bronze Ingot
item[4] = '0x096B' ## - Shadow Ingot
item[5] = '0x0014' ## - Rose Ingot
item[6] = '0x0193' ## - Agapite
DIM price[7]
price[0] = 1 ## - Rusty Ingot
price[1] = 2 ## - Old Copper Ingot
price[2] = 3 ## - Dull Copper Ingot
price[3] = 4 ## - Bronze Ingot
price[4] = 5 ## - Shadow Ingot
price[5] = 6 ## - Rose Ingot
price[6] = 7 ## - Agapite
UO.AddObject('Box_for_trash_ing')
repeat
wait(100)
until not UO.Targeting()
UO.UseObject(Box_for_trash_ing)
wait(1000)
CheckLag()
uo.TextPrint('Trash Ore')
uo.TextPrint(' --------- ')
for i = 0 to 6
for p = 0 to 6
uo.FindType('0x1BEF', item[i], Box_for_trash_ing)
if uo.FindCount('finditem') > 0 then
uo.Click('finditem')
wait(300)
name = uo.GetName('finditem')
cen = uo.GetQuantity('finditem') * price[p]
sum = sum + cen
uo.TextPrint(name + ' ------ ' + str(cen) + 'k (' + str(price[p]) + 'k per piece)')
uo.Ignore('finditem')
uo.FindType('0x1BEF', item[i], Box_for_trash_ing)
End if
wait(100)
next
next
uo.TextPrint(' --------- ')
uo.TextPrint('Total Amount: ' + str(sum) + 'k')
uo.TextPrint(' =========================================== ')
uo.IgnoreReset()
Endsub
###################################
sub Count_other_ing()
var i, p, name, cen, sum = 0
DIM item[4]
item[0] = '0x1BEF' ## - Iron Ingot
item[1] = '0x1BE3' ## - Copper Ingot
item[2] = '0x1BF5' ## - Silver Ingot
item[3] = '0x1BE9' ## - Gold Ingot
DIM price[4]
price[0] = 1 ## - Iron Ingot
price[1] = 2 ## - Copper Ingot
price[2] = 3 ## - Silver Ingot
price[3] = 4 ## - Gold Ingot
UO.AddObject('Box_for_trash_ing')
repeat
wait(100)
until not UO.Targeting()
UO.UseObject(Box_for_trash_ing)
wait(1000)
for i = 0 to 3
for p = 0 to 3
uo.FindType(item[i], '-1', Box_for_trash_ing)
if uo.FindCount('finditem') > 0 then
uo.Click('finditem')
wait(300)
name = uo.GetName('finditem')
cen = uo.GetQuantity('finditem') * price[p]
sum = sum + cen
uo.TextPrint(name + ' ------ ' + str(cen) + 'k (' + str(price[p]) + 'k per piece)')
uo.Ignore('finditem')
uo.FindType(item[i], '-1', Box_for_trash_ing)
End if
next
next
uo.TextPrint(' --------- ')
uo.TextPrint('Total Amount: ' + str(sum) + 'k')
uo.TextPrint(' =========================================== ')
uo.IgnoreReset()
Endsub
#############################
sub Smelt_trash_ore()
var i, Exit
DIM item[4]
item[0] = '0x19B9' ## - 4 ore
item[1] = '0x19B8' ## - 3 ore
item[2] = '0x19BA' ## - 2 ore
item[3] = '0x19B7' ## - 1 ore
UO.AddObject('Box_for_trash_ing')
repeat
wait(100)
until not UO.Targeting()
UO.UseObject(Box_for_trash_ing)
wait(1000)
for i = 0 to 3
uo.FindType(item[i], '-1', Box_for_trash_ore)
if uo.FindCount('finditem') > 0 then
repeat
uo.Grab('500', 'finditem')
wait(300)
Checklag()
while not uo.InJournal('You put') or not uo.InJournal('see the target')
uo.UseObject('finditem')
wait(100)
wend
uo.FindType(item[i], '-1', Box_for_trash_ore)
until not UO.FindCount()
End if
Unload_trash_ore()
next
Endsub