Хм, вроде бы дописал все части кода, поставил нахождение руками, но все равно в какой то момент скрипт начинает терять часть сумок
получается что часть сосок рассортировывается, в 2 или 3 бекпаках получается мешанка, и 1 карта остается в бекпаке чара
собственно получившийся в итоге код:
Code:
sub main()
Var i
Var bagloc
Var bottvar
Var numstart
Var coord1
Var coord2
Var coord3
Var coord4
Var found1
Var found2
Var found3
Var found4
Var theitem
Var tmpvar
UO.Exec("set norbcheck 1")
UO.Exec("set norbcalc 1")
UO.Exec('findtype 0x0E76 0x0386 ground')
UO.Exec('addobject SoSBag finditem')
UO.AddObject('tempbag', 'backpack')
If UO.Targeting() then
UO.CancelTarget()
Endif
For i = 1 to 10
UO.AddObject('Bag' + str(i))
While UO.Targeting()
Wait(100)
Wend
Next
uo.findtype("0x14ed","-1","SoSBag")
While UO.FindCount() <> 0
tmpvar = UO.FindCount()
UO.Exec('moveitem finditem 0 tempbag')
While tmpvar == UO.FindCount()
uo.findtype("0x14ed","-1","SoSBag")
Wait(10)
Wend
UO.UseType('0x14ED')
Wait(500)
bagloc = 11
bottvar = 0
numstart = 0
found1 = 0
found2 = 1
found3 = 1
found4 = 1
coord1 = ''
coord2 = ''
coord3 = ''
coord4 = ''
If UO.lastgump('text',1) == 'sea serpent! We are at coordinates' then
For i = 1 to LEN(UO.lastgump('text',2))
If (MID(UO.lastgump('text',2), i - 1, 1) == '0' OR VAL(MID(UO.lastgump('text',2), i - 1, 1)) <> 0) and found1 <> 1 Then
coord1 = coord1 + MID(UO.lastgump('text',2), i - 1, 1)
numstart = 1
EndIf
If MID(UO.lastgump('text',2), i - 1, 1) == 'o' and found1 <> 1 and numstart == 1 then
found1 = 1
found2 = 0
found3 = 1
found4 = 1
EndIf
If (MID(UO.lastgump('text',2), i - 1, 1) == '0' OR VAL(MID(UO.lastgump('text',2), i - 1, 1)) <> 0) and found2 <> 1 Then
coord2 = coord2 + MID(UO.lastgump('text',2), i - 1, 1)
EndIf
If MID(UO.lastgump('text',2), i - 1, 1) == "'" and found2 <> 1 and numstart == 1 then
found1 = 1
found2 = 1
found3 = 0
found4 = 1
EndIf
If (MID(UO.lastgump('text',2), i - 1, 1) == '0' OR VAL(MID(UO.lastgump('text',2), i - 1, 1)) <> 0) and found3 <> 1 Then
coord3 = coord3 + MID(UO.lastgump('text',2), i - 1, 1)
EndIf
If MID(UO.lastgump('text',2), i - 1, 1) == 'o' and found3 <> 1 and numstart == 1 then
found1 = 1
found2 = 1
found3 = 1
found4 = 0
EndIf
If (MID(UO.lastgump('text',2), i - 1, 1) == '0' OR VAL(MID(UO.lastgump('text',2), i - 1, 1)) <> 0) and found4 <> 1 Then
coord4 = coord4 + MID(UO.lastgump('text',2), i - 1, 1)
EndIf
If MID(UO.lastgump('text',2), i - 1, 1) == "'" and found4 <> 1 and numstart == 1 then
found1 = 1
found2 = 1
found3 = 1
found4 = 0
EndIf
If MID(UO.lastgump('text',2), i - 1, 1) == "N" then
bottvar = 1
EndIf
Next
Else
For i = 1 to LEN(UO.lastgump('text',1))
If (MID(UO.lastgump('text',1), i - 1, 1) == '0' OR VAL(MID(UO.lastgump('text',1), i - 1, 1)) <> 0) and found1 <> 1 Then
coord1 = coord1 + MID(UO.lastgump('text',1), i - 1, 1)
numstart = 1
EndIf
If MID(UO.lastgump('text',1), i - 1, 1) == 'o' and found1 <> 1 and numstart == 1 then
found1 = 1
found2 = 0
found3 = 1
found4 = 1
EndIf
If (MID(UO.lastgump('text',1), i - 1, 1) == '0' OR VAL(MID(UO.lastgump('text',1), i - 1, 1)) <> 0) and found2 <> 1 Then
coord2 = coord2 + MID(UO.lastgump('text',1), i - 1, 1)
EndIf
If MID(UO.lastgump('text',1), i - 1, 1) == "'" and found2 <> 1 and numstart == 1 then
found1 = 1
found2 = 1
found3 = 0
found4 = 1
EndIf
If (MID(UO.lastgump('text',1), i - 1, 1) == '0' OR VAL(MID(UO.lastgump('text',1), i - 1, 1)) <> 0) and found3 <> 1 Then
coord3 = coord3 + MID(UO.lastgump('text',1), i - 1, 1)
EndIf
If MID(UO.lastgump('text',1), i - 1, 1) == 'o' and found3 <> 1 and numstart == 1 then
found1 = 1
found2 = 1
found3 = 1
found4 = 0
EndIf
If (MID(UO.lastgump('text',1), i - 1, 1) == '0' OR VAL(MID(UO.lastgump('text',1), i - 1, 1)) <> 0) and found4 <> 1 Then
coord4 = coord4 + MID(UO.lastgump('text',1), i - 1, 1)
EndIf
If MID(UO.lastgump('text',1), i - 1, 1) == "'" and found4 <> 1 and numstart == 1 then
found1 = 1
found2 = 1
found3 = 1
found4 = 0
EndIf
If MID(UO.lastgump('text',1), i - 1, 1) == "N" then
bottvar = 1
EndIf
Next
EndIf
If VAL(coord1) > 135 and VAL(coord1) < 141 then
bagloc = 1
EndIf
If VAL(coord1) > 58 and VAL(coord1) < 64 and VAL(coord3) > 176 and VAL(coord3) < 183 and bottvar == 0 then
bagloc = 2
EndIf
If VAL(coord1) > 61 and VAL(coord1) < 67 and VAL(coord3) > 113 and VAL(coord3) < 118 then
bagloc = 3
EndIf
If VAL(coord1) > 70 and VAL(coord1) < 76 and VAL(coord3) > 80 and VAL(coord3) < 86 then
bagloc = 4
EndIf
If VAL(coord1) > 35 and VAL(coord1) < 41 and VAL(coord3) > 66 and VAL(coord3) < 72 then
bagloc = 5
EndIf
If VAL(coord1) > 15 and VAL(coord1) < 21 and VAL(coord3) > 81 and VAL(coord3) < 86 and bottvar == 0 then
bagloc = 6
EndIf
If VAL(coord1) > 15 and VAL(coord1) < 21 and VAL(coord3) > 81 and VAL(coord3) < 86 and bottvar == 1 then
bagloc = 7
EndIf
If VAL(coord1) > 27 and VAL(coord1) < 33 and VAL(coord3) > 113 and VAL(coord3) < 119 then
bagloc = 8
EndIf
If VAL(coord1) > 59 and VAL(coord1) < 66 and VAL(coord3) > 174 and VAL(coord3) < 179 then
bagloc = 9
EndIf
If VAL(coord1) > 109 and VAL(coord1) < 116 and VAL(coord3) > 165 and VAL(coord3) < 170 then
bagloc = 10
EndIf
UO.Print(coord1 + ' ' + coord2 + ' ' + coord3 + ' ' + coord4 + 'N' + STR(bottvar) + 'Bag' + STR(bagloc))
tmpvar = UO.FindCount()
UO.FindType('0x14ed', -1, 'tempbag')
UO.Exec('moveitem finditem 10 Bag' + STR(bagloc))
While tmpvar == UO.FindCount()
uo.findtype("0x14ed","-1","tempbag")
Wait(10)
Wend
uo.findtype("0x14ed","-1","SoSBag")
UO.LClick(144,160)
Wend
end sub