1 и 2 Пример рекурсии
Code:
sub LootGround()
UO.Set('finddistance', '2')
LootContainer('ground')
UO.Set('finddistance', '12')
Endsub
sub LootWithoutCut()
var i, id_Corpse, t_Corpse = '0x2006', t_Dagger = '0x0F51'
UO.Set('finddistance', '2')
UO.FindType(t_Corpse, -1, 'ground')
If UO.FindCount() then
id_Corpse = UO.GetSerial('finditem')
LootContainer(id_Corpse)
Wait(100)
else
UO.Print('Нет трупа')
Endif
UO.Set('finddistance', '12')
Endsub
sub LootWithCut()
var i, id_Corpse, t_Corpse = '0x2006', t_Dagger = '0x0F51'
UO.SetArm('Weapon')
UO.Set('finddistance', '1')
UO.FindType(t_Corpse, -1, 'ground')
If UO.FindCount() then
id_Corpse = UO.GetSerial('finditem')
UO.WaitTargetObject(id_Corpse)
UO.UseType(t_Dagger)
Wait(100)
UO.Arm('Weapon')
LootContainer(id_Corpse)
else
UO.Print('Нет трупа')
Endif
UO.Set('finddistance', '12')
Endsub
Sub LootContainer(id)
var id_ReagentsBag = '0x40004762', id_SpecialRegsBag = '0x4000BF80', id_OtherBag = '0x40004767', id_RecContainer, Pause = 1100, t_Scissors = '0x0F9E', i, j
Dim t_Items[4]
t_Items[0] = '0x1078 0x0EED 0x0F3F 0x1BFB ' ; Это кладём в пак, включая шкуры
t_Items[1] = '0x0F88 0x0F7A 0x0F86 0x0F8C 0x0F8D 0x0F85 0x0F84 0x0F7B ' ; Это в мешок с регами
t_Items[2] = '0x0FAB 0x0F0F 0x0F10 0x0F11 0x0F13 0x0F15 0x0F16 0x0F18 0x0F25 0x0F26 0x14EB 0x0E34 0x1BD1 ' ; Это в мешок для всякой всячины
t_Items[3] = '0x0F87 0x0F90 0x0F82 0x0F81 0x0F8E 0x0F78 0x0F80 0x0F7E 0x0F91 ' ; Это в мешок для некрорегов и костей
t_Items[4] = '0x09AB 0x0E7C 0x0E40 0x0E41 0x0E42 0x0E43 0x0E75 0x0E76 ' ; Это типы сундуков мешков паков и проч.
UO.UseObject(id)
Wait(500)
For i = 0 to 3
For j = 1 to GetWordAmount(t_Items[i], ' ')
Repeat
UO.FindType(GetWord(t_Items[i], j, ' '), -1, id)
If UO.FindCount() then
If i == 0 then
id_RecContainer = UO.GetSerial('backpack')
Endif
If i == 1 then
id_RecContainer = id_ReagentsBag
Endif
If i == 2 then
id_RecContainer = id_OtherBag
Endif
If i == 3 then
id_RecContainer = id_SpecialRegsBag
Endif
UO.MoveItem('finditem', -1, id_RecContainer)
Wait(Pause)
If i == 0 and j == 1 then
UO.FindType(GetWord(t_Items[i], j, ' '), -1, 'backpack')
If UO.FindCOunt() then
UO.WaitTargetObject('finditem')
UO.UseType(t_Scissors)
Wait(100)
else
UO.Print('Странно... Надо увеличить задержку =)')
Endif
Endif
Endif
Until not UO.FindCount()
Next
Next
For j = 1 to GetWordAmount(t_Items[4], ' ')
Repeat
UO.FindType(GetWord(t_Items[4], j, ' '), -1, id)
If UO.FindCount() then
LootContainer(UO.GetSerial('finditem'))
else
Wait(100)
Endif
Until not UO.FindCount()
Next
UO.Ignore(id)
Endsub
3)
Code:
Sub ContainerCheck(id)
UO.UseObject(id)
Wait(100)
If UO.GetSerial('lastcontainer') == id then
Return 1
Endif
Return 0
Endsub