Yoko

All sides of Injection
It is currently 2024-04-20 02:58:36

All times are UTC+02:00




Post new topic  Reply to topic  [ 26 posts ]  Go to page 1 2 Next
Author Message
 Post subject: CоС Бутылочки
PostPosted: 2011-12-23 19:16:17 
Offline

Joined: 2011-12-23 19:08:41
Posts: 11
Собственно есть скрипт на сортировку сос бутылок. При запуске делает вид что ищет сумки, на последней 10 активирует таргет и сам скрипт полностью закрывается :cry:
Помогите плиз, что со скриптом? :roll:
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 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


Top
   
PostPosted: 2011-12-23 19:38:59 
Offline
User avatar

Joined: 2006-12-08 10:51:50
Posts: 718
Location: Москва
ёмоё вот это скрипт! Чё он должен делать?


Top
   
PostPosted: 2011-12-23 23:33:32 
Offline

Joined: 2011-12-23 19:08:41
Posts: 11
blackshad wrote:
скрипт на сортировку сос бутылок.

как бы(


Top
   
PostPosted: 2011-12-23 23:35:10 
Offline
User avatar

Joined: 2006-12-08 10:51:50
Posts: 718
Location: Москва
А что за сос бутылки? И куда их сортировать? Типы, цвета в студию


Top
   
PostPosted: 2011-12-23 23:41:04 
Offline

Joined: 2011-12-23 19:08:41
Posts: 11
Хм, сос бутылки которые вылавливаешь при помощи фишинга, делятся по координатам на гампе, всего по сути распределение сос бутылок идет по 10 пакам
тип самой бутылки - 0x099F цвет - 0x0000
тип бумажки с сообщением - 0x14ED цвет - 0x0000
по каким пакам сортировать - в принципе все равно


Top
   
PostPosted: 2011-12-24 00:18:59 
Offline
User avatar

Joined: 2006-12-08 10:51:50
Posts: 718
Location: Москва
Сейчас гляну


Top
   
PostPosted: 2011-12-24 00:35:56 
Offline
User avatar

Joined: 2006-12-08 10:51:50
Posts: 718
Location: Москва
Стоп! А бутылки надо использовать? А скрипт правильно используется? В скрипте ни разу не упоминается тип бутылок.

С самого начала работы скрипта, на земле ищется нечто с типом 0x0E76 и цветом 0x0043. В последствии от-туда будут браться записки. Далее на земле ищется другое нечно с типом 0x0E75 и цветом 0x0044. Туда будут класться записки из первого нечто. Затем, после рунбук-рекола, где вместо рунбуки - чар, а номер кнопки 0 :shock: , записка используется, ещё раз рекол и использование записки :shock: :shock: . После этого закомментированная строка с UO.LClick(144,160) (вероятно надо было нажать где-то в гампе, но позже это отменили или забили просто), затем уже идёт анализ гампа.

Все сумки должны быть на земле, и всех цвет разный =) Но это только если я правельно помню про ,findtype


Top
   
PostPosted: 2011-12-24 00:49:06 
Offline

Joined: 2011-12-23 19:08:41
Posts: 11
Хм, ну тут не особо важно что конкретно использовать, бутылки или готовые сообщения))
0x0E76 и цветом 0x0043 это пак для сос сообщений, 0x0E75 и цветом 0x0044 собственно тоже пак)
не совсем понял вот это: "Затем, после рунбук-рекола, где вместо рунбуки - чар, а номер кнопки 0 :shock: , записка используется, ещё раз рекол и использование записки :shock: :shock:" зачем тут вообще по сути рекол, если сумки все на полу и делается сортировка не сходя с места :shock: Закоментированная строка - это я так понимаю кнопка гампа, хотя не понятно тогда как должен гамп закрыватся оО
Вообще, как я делаю - на полу лежит 12 паков, вокруг чара. 2 из них я прописываю в скрипт, собственно те что выше.. После запуска скрипта, он быстренько записывает ЧАСТЬ сумок, часть я так понимаю игнорит, просит указать 10й пак, НО! к тому времени скрипт уже закрыт! Сейчас попробую сделать все бекпаки разноцветными..


Top
   
PostPosted: 2011-12-24 01:03:20 
Offline
User avatar

Joined: 2006-12-08 10:51:50
Posts: 718
Location: Москва
Code:
For i = 2 to 11
UO.Exec('findtype 0x0E76' + STR(i) + 'ground')
UO.Exec('addobject Bag' + STR(i - 1) + 'finditem')
Next


Этот кусок ищет сумки на полу по типу и по цвету. Вместо цвета - переменная i. Тоесть, если цвет не совпадает - 'finditem' не обновляется, и объектом назначается последний найденный предмет. (Это если 'finditem' не обнуляется)

Я бы поменял этот кусок на этот:
Code:
For i = 2 to 11
  UO.FindType('0x0E76', -1, 'ground')
  If UO.FindCount() then
    UO.AddObject('Bag' + str(i), 'finditem')
  else
    UO.Print('Сумка ' + str(i) + ' не найдена')
  Endif
Next


Top
   
PostPosted: 2011-12-24 01:05:29 
Offline
User avatar

Joined: 2006-12-08 10:51:50
Posts: 718
Location: Москва
При юзе записки вылезает гамп, а в нём прописаны координаты? Или надо гамп прощёлкать пару раз?


Top
   
PostPosted: 2011-12-24 01:18:07 
Offline

Joined: 2011-12-23 19:08:41
Posts: 11
Image
Image
Это я поменял цвета бекпаков, собственно журнал!в конце просто закрывается скрипт))
При юзе выскакивает гамп, собственно сам гамп:
Image

Читаем координаты - жмем ок.


Top
   
PostPosted: 2011-12-24 01:29:48 
Offline
User avatar

Joined: 2006-12-08 10:51:50
Posts: 718
Location: Москва
Сумки только 2 находит. Которые нечто. Воткти кусок, что я дал, тогда найдёт( НО!!! В куске надо проставить For i = 1 to 10). И ещё кое-что: вместо нечто2, надо забивать бакпак персонажа.
замени это
Code:
UO.Exec('findtype 0x0E75 0x0044 ground')
UO.Exec('addobject tempbag finditem')

этим
Code:
UO.AddObject('tempbag', 'backpack')


Так же тебе необходимо переставить закомментированную строку в конец скрипта, конкретней перед последним Wend. Строку надо раскомментировать.


Top
   
PostPosted: 2011-12-24 01:32:58 
Offline
User avatar

Joined: 2006-12-08 10:51:50
Posts: 718
Location: Москва
И ещё кое что.

Этот кусок
Code:
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)

замени на
Code:
UO.UseType('0x14ED')
Wait(500)


Top
   
PostPosted: 2011-12-24 01:35:42 
Offline
User avatar

Joined: 2006-12-08 10:51:50
Posts: 718
Location: Москва
Но опять же... Нет типа бутылок в скрипте =) Когда юзаешь бутылку, записка появляется в паке?


Top
   
PostPosted: 2011-12-24 01:43:57 
Offline

Joined: 2011-12-23 19:08:41
Posts: 11
Поменял все значения, которые ты дал, скрипт начал сортировать!!!!!!!!!! Но, на 4 сумке споткнулся:
Image

мне открытие бутылок и не нужно =) главное сортировка готовых сос месаг)))


Top
   
PostPosted: 2011-12-24 01:49:16 
Offline
User avatar

Joined: 2006-12-08 10:51:50
Posts: 718
Location: Москва
Не назначену сумка 11 =) For i = 1 to 11


Top
   
PostPosted: 2011-12-24 01:59:41 
Offline

Joined: 2011-12-23 19:08:41
Posts: 11
Все равно не может найти сумки 4 и 5(((( хотя сделал изменение For i = 1 to 11
пробывал даже до 12 указать, не видит 4 и 5 сумку хоть ты тресни)
хмммм.. тут еще такой вопрос, а не может ли скрипт находить сумки которые на 2 этаже?


Top
   
PostPosted: 2011-12-24 02:27:00 
Offline
User avatar

Joined: 2006-12-08 10:51:50
Posts: 718
Location: Москва
Всетаки сумки надо сделать разноцветные и поиск организовывать по цветам, или же назначать их руками, или переносить в бэкпак персонажа на время
Поиск по цветам, как он был изначально. У каждой сумки свой цвет, начиная с 0x0001, и заканчивая на 0x0010
Code:
For i = 1 to 10
  UO.FindType('0x0E76', Str(i), 'ground')
  If UO.FindCount() then
    UO.AddObject('Bag' + str(i), 'finditem')
  else
    UO.Print('Сумка ' + str(i) + ' не найдена')
  Endif
Next

Поиск руками
Code:
If UO.Targeting() then
  UO.CancelTarget()
Endif
For i = 1 to 10
  UO.AddObject('Bag' + str(i))
  While UO.Targeting()
    Wait(100)
  Wend
Next

Поиск с убиранием в пак не хочу делать, а с игнором рискованно... :roll:
Заменить поиск надо обязательно.

Теперь о проблемме...
Code:
75 19 81 37NOBag4
Это следствие
Code:
UO.Print(coord1 + ' ' + coord2 + ' ' + coord3 + ' ' + coord4 + 'N' + STR(bottvar) + 'Bag' + STR(bagloc))
Почему я принял это за отсутствие сумки - хз...

Object not found скорее всего отправил moveitem, так что надо после
Code:
UO.Print(coord1 + ' ' + coord2 + ' ' + coord3 + ' ' + coord4 + 'N' + STR(bottvar) + 'Bag' + STR(bagloc))
tmpvar = UO.FindCount()
добавить строку
Code:
UO.FindType('0x14ed', -1, 'tempbag')


Top
   
PostPosted: 2011-12-24 02:46:01 
Offline

Joined: 2011-12-23 19:08:41
Posts: 11
Хм, вроде бы дописал все части кода, поставил нахождение руками, но все равно в какой то момент скрипт начинает терять часть сумок :shock:
получается что часть сосок рассортировывается, в 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


Top
   
PostPosted: 2011-12-24 03:03:25 
Offline
User avatar

Joined: 2006-12-08 10:51:50
Posts: 718
Location: Москва
Попробуй
Code:
sub SoSSort()
  Var i, String, bagloc, StringCache, C1, C3, SN, WE
  UO.Set('norbcheck', '1')
  UO.Set('norbcalc', '1')
  if UO.Targeting() then
    UO.CancelTarget()
  endif
  UO.AddObject('SoSBag')
  while UO.Targeting()
    Wait(100)
  wend
  for i = 1 to 11
    UO.AddObject('Bag' + str(i))
    While UO.Targeting()
      Wait(100)
    Wend
  Next
  while true
    UO.FindType('0x14ED', -1, 'SoSBag')
    if not UO.FindCount() then
      return
    else
      UO.MoveItem('finditem', -1, 'tempbag')
      Wait(1100)
      UO.UseObject('finditem')
      while UO.LastGump() == 'replyed'
        Wait(100)
      wend
      StringCache = ''
      If UO.lastgump('text',0) == 'We are under attack by a gigantic' then
        String = UO.lastgump('text',2)
      else
        String = UO.lastgump('text',1)
      Endif
      for i = 0 to len(String)
        if String[i] <> 'o' and String[i] <> "'" then
          StringCache = StringCache + String[i]
        Endif
      Next
      while StringCahe[0] <> '0' and StringCahe[0] <> '1' and StringCahe[0] <> '2' and StringCahe[0] <> '3' and StringCahe[0] <> '4' and StringCahe[0] <> '5' and StringCahe[0] <> '6' and StringCahe[0] <> '7' and StringCahe[0] <> '8' and StringCahe[0] <> '9'
        String = StringCache
        StringCache = ''
        for i = 1 to len(String)
          StringCache = StringCache + String[i]
        next
      wend
      UO.Print('StringCache = ' + StringCache)
      StringCache = StringCache + ' '
      C1 = val(GetWord(StringCache, 1, ' '))
      C3 = val(GetWord(StringCache, 4, ' '))
      SN = GetWord(StringCache, 3, ' ')
      WE = GetWord(StringCache, 6, ' ')
      bagloc = 11
      If C1 > 61 and C1 < 67 and C3 > 113 and C3 < 118 and SN == 'S' and WE == 'E' then
        bagloc = 1
      EndIf
      If C1 > 70 and C1 < 76 and C3 > 80 and C3 < 86 and SN == 'S' and WE == 'E' then
        bagloc = 2
      EndIf
      If C1 > 35 and C1 < 41 and C3 > 66 and C3 < 72 and SN == 'S' and WE == 'E' then
        bagloc = 3
      EndIf
      If C1 > 15 and C1 < 21 and C3 > 81 and C3 < 86 and SN == 'S' and WE == 'E' then
        bagloc = 4
      EndIf
      If C1 > 15 and C1 < 21 and C3 > 81 and C3 < 86 and SN == 'N' and WE == 'E' then
        bagloc = 5
      EndIf
      If C1 > 58 and C1 < 64 and C3 > 176 and C3 < 182 and and SN == 'N' and WE == 'E' then
        bagloc = 6
      EndIf
      If C1 > 59 and C1 < 66 and C3 > 174 and C3 < 179 and and SN == 'S' and WE == 'E' then
        bagloc = 7
      EndIf
      If C1 > 109 and C1 < 116 and C3 > 165 and C3 < 170 and SN == 'N' and WE == 'E' then
        bagloc = 8
      EndIf
      If C1 > 27 and C1 < 33 and C3 > 113 and C3 < 119 and SN == 'N' and WE == 'E' then
        bagloc = 9
      EndIf
      If C1 > 130 and C1 < 141 and C3 > 85 and C3 < 97 and SN == 'S' and WE == 'E' then
        bagloc = 10
      EndIf
      UO.LClick(144,160)
      UO.Moveitem('finditem', -1, 'Bag' + STR(bagloc))
      Wait(1100)
    Endif
  wend
Endsub

Sub GetWord(str, num, div)
  var tmpst, i, dlin, kol = 0, start = 0
  dlin = len(str)
  For i = 0 to dlin - 1
    If mid(str, i, 1) == div or i == dlin - 1 then
      kol = kol + 1
      If kol == num then
        tmpst = mid(str, start, i - start)
        Return tmpst
       else
        While mid(str, i, 1) == div
          i = i + 1
        Wend
        If kol == num - 1 then
          start = i
        Endif
      Endif
    Endif
  Next
  tmpst = ''
  Return tmpst
Endsub
Слегка подчистил, добавил пару принтов в ключевых местах.

Чистить тут не перечистить, поэтому немного "отсебятины"
Заменил на свой аналог. В скрипте присутствует GetWord Edred'а

А вообще уже есть более новые версии, но мне как-то лениво


Last edited by ZeroDX on 2011-12-24 09:06:33, edited 11 times in total.

Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 26 posts ]  Go to page 1 2 Next

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 35 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Limited