CоС Бутылочки
Posted: 2011-12-23 19:16:17
Собственно есть скрипт на сортировку сос бутылок. При запуске делает вид что ищет сумки, на последней 10 активирует таргет и сам скрипт полностью закрывается
Помогите плиз, что со скриптом?

Помогите плиз, что со скриптом?

Code: Select all
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 2")
UO.Exec("set norbcalc 2")
UO.Exec('findtype 0x0E76 0x0043 ground')
UO.Exec('addobject SoSBag finditem')
UO.Exec('findtype 0x0E75 0x0044 ground')
UO.Exec('addobject tempbag finditem')
For i = 2 to 11
UO.Exec('findtype 0x0E76' + STR(i) + 'ground')
UO.Exec('addobject Bag' + STR(i - 1) + 'finditem')
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.findtype("0x14ed","-1","tempbag")
UO.Exec("recall self 0")
UO.Exec('useobject finditem')
Wait(500)
UO.Exec("recall self 0")
UO.Exec('useobject finditem')
Wait(500)
# UO.LClick(144,160)
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.Exec('moveitem finditem 10 Bag' + STR(bagloc))
While tmpvar == UO.FindCount()
uo.findtype("0x14ed","-1","tempbag")
Wait(10)
Wend
uo.findtype("0x14ed","-1","SoSBag")
Wend
end sub