Как сделать лут из трупа определённых вещей??

Ask for help

Moderators: Murderator+, Murderator

Post Reply
C_9!_B_@
Posts: 5
Joined: 2004-07-27 20:54:24

Как сделать лут из трупа определённых вещей??

Post by C_9!_B_@ »

Люди подскажите - как можно сделать так - чтобы при нажатии кнопки с трупа
лутились определённые вещи - что-то вроде emptycontainer но не весть хлам
а только то что нужно!! Подскажите как это сделать , если вообще возможно.
Yoko
Site Admin
Posts: 1964
Joined: 2004-04-03 16:49:38
Contact:

Post by Yoko »

как минимум раз 5 эта тема поднималась на форуме, и в этом и в архиве; попробуй найти

может конечно ктото просто сюда тебе пример скрипта скопирует
C_9!_B_@
Posts: 5
Joined: 2004-07-27 20:54:24

Post by C_9!_B_@ »

Yoko wrote:как минимум раз 5 эта тема поднималась на форуме, и в этом и в архиве; попробуй найти

может конечно ктото просто сюда тебе пример скрипта скопирует


Спасибо я нашёл этот скрипт всё класно он работает -- только вот выдает какую-то ошибку "Line 55: Runtime error" и скрипт выбрасывает -- если не трудно подскажите из-за чего это и как исправить !!!


#==============================================================
# Loot() - looting corpse and from ground
#--------------------------------------------------------------
sub Loot()
VAR WaitTime=500
VAR Exit=0, i
DIM Loot[30]


Loot[0]=0x19B9 ; ore
Loot[1]=0x0EED ; gp
Loot[2]=0x0F7B ; BM
Loot[3]=0x0F7A ; BP
Loot[4]=0x0F84 ; GA
Loot[5]=0x0F85 ; GI
Loot[6]=0x0F86 ; MR
Loot[7]=0x0F88 ; NS
Loot[8]=0x0F8C ; SA
Loot[9]=0x0F8D ; SS
Loot[10]=0x0F90 ; Dead Woods
Loot[11]=0x0F7E ; Sceleton Bones
Loot[12]=0x0F87 ; Eyes of newt
Loot[13]=0x0E76 ; Bag
Loot[14]=0x09B0 ; Pounch
Loot[15]=0x1BDD ; Logs
Loot[16]=0x1078 ; Hides
Loot[17]=0x1BFB ; Bolts
Loot[18]=0x0E34 ; Blanc Scroll
Loot[19]=0x0F25 ; Pieces of Amber
Loot[20]=0x0F16 ; Ametist
Loot[21]=0x0F20 ; Tourmaline
Loot[22]=0x0F26 ; Diamond
Loot[23]=0x0F30 ; Diamond
Loot[24]=0x0F8E ; Serpent Scales
Loot[25]=0x14EB ; Treassure Map
Loot[26]=0x0F79 ; Blackmoor
Loot[27]=0x0F3F ; Arrow
Loot[28]=0x0F79 ; Blackmoor
Loot[29]=0x0F79 ; Blackmoor

UO.UseObject('lastcorpse')

if UO.GetQuantity('lastcorpse') then
UO.SetArm('temp')
UO.WaitTargetObject('lastcorpse')
UO.UseType('0x0F51') ;dagger
wait(1000)
UO.Arm('temp')
wait(1500)
endif

; UO.SetReceivingContainer('0x400935D4') ; loot store bag

For i=0 to 29
UO.FindType(Loot[i],-1,'ground')
if UO.GetQuantity('finditem') then
UO.Grab(STR(0),'finditem')
wait(WaitTime)
endif

if UO.GetQuantity('lastcorpse') then
UO.FindType(Loot[i],-1,'lastcorpse')
if UO.GetQuantity('finditem') then
if Loot[i]==0x1078 then
UO.WaitTargetObject('finditem')
UO.UseType('0x0F9E')
else
UO.Grab(STR(0),'finditem')
endif
wait(WaitTime)
endif
endif
next

; UO.UnSetReceivingContainer()
end sub
Yoko
Site Admin
Posts: 1964
Joined: 2004-04-03 16:49:38
Contact:

Post by Yoko »

как правило я не рассматриваю скрипты длиннее 5 строк

но ты мог бы хотя бы обозначить какая из строк у тебя имеет номер 55, написать когда именно выкидывает сообщение
C_9!_B_@
Posts: 5
Joined: 2004-07-27 20:54:24

Post by C_9!_B_@ »

Yoko wrote:как правило я не рассматриваю скрипты длиннее 5 строк

но ты мог бы хотя бы обозначить какая из строк у тебя имеет номер 55, написать когда именно выкидывает сообщение



Точно не сообразил ВИНОВАТ


#==============================================================
# Loot() - looting corpse and from ground
#--------------------------------------------------------------
sub Loot()
VAR WaitTime=500
VAR Exit=0, i
DIM Loot[30]


Loot[0]=0x19B9 ; ore
Loot[1]=0x0EED ; gp
Loot[2]=0x0F7B ; BM
Loot[3]=0x0F7A ; BP
Loot[4]=0x0F84 ; GA
Loot[5]=0x0F85 ; GI
Loot[6]=0x0F86 ; MR
Loot[7]=0x0F88 ; NS
Loot[8]=0x0F8C ; SA
Loot[9]=0x0F8D ; SS
Loot[10]=0x0F90 ; Dead Woods
Loot[11]=0x0F7E ; Sceleton Bones
Loot[12]=0x0F87 ; Eyes of newt
Loot[13]=0x0E76 ; Bag
Loot[14]=0x09B0 ; Pounch
Loot[15]=0x1BDD ; Logs
Loot[16]=0x1078 ; Hides
Loot[17]=0x1BFB ; Bolts
Loot[18]=0x0E34 ; Blanc Scroll
Loot[19]=0x0F25 ; Pieces of Amber
Loot[20]=0x0F16 ; Ametist
Loot[21]=0x0F20 ; Tourmaline
Loot[22]=0x0F26 ; Diamond
Loot[23]=0x0F30 ; Diamond
Loot[24]=0x0F8E ; Serpent Scales
Loot[25]=0x14EB ; Treassure Map
Loot[26]=0x0F79 ; Blackmoor
Loot[27]=0x0F3F ; Arrow
Loot[28]=0x0F79 ; Blackmoor
Loot[29]=0x0F79 ; Blackmoor

UO.UseObject('lastcorpse')

if UO.GetQuantity('lastcorpse') then
UO.SetArm('temp')
UO.WaitTargetObject('lastcorpse')
UO.UseType('0x0F51') ;dagger
wait(1000)
UO.Arm('temp')
wait(1500)
endif

; UO.SetReceivingContainer('0x400935D4') ; loot store bag

For i=0 to 29
UO.FindType(Loot[i],-1,'ground') ---->>>> 55 строка <<<<---- ---->>>> 55 строка <<<<-------->>>> 55 строка <<<<-------->>>> 55 строка <<<<----
if UO.GetQuantity('finditem') then
UO.Grab(STR(0),'finditem')
wait(WaitTime)
endif

if UO.GetQuantity('lastcorpse') then
UO.FindType(Loot[i],-1,'lastcorpse')
if UO.GetQuantity('finditem') then
if Loot[i]==0x1078 then
UO.WaitTargetObject('finditem')
UO.UseType('0x0F9E')
else
UO.Grab(STR(0),'finditem')
endif
wait(WaitTime)
endif
endif
next

; UO.UnSetReceivingContainer()
end sub



А сообщение выкидывает когда уже скрипт прошел и с трупа всё слутило что нужно .... затем выкидывается вот та мессага с ошибкой... и только ОК можно нажать - затем скрипт автоматически выгружаеться... и его каждый раз приходиться запускать....


For i=0 to 29
UO.FindType(Loot[i],-1,'ground') ---->>>> 55 строка
if UO.GetQuantity('finditem') then
UO.Grab(STR(0),'finditem')
wait
endif
Yoko
Site Admin
Posts: 1964
Joined: 2004-04-03 16:49:38
Contact:

Post by Yoko »

попробуй DIM[100] поставить, а так же строку 55 заменить на
UO.FindType(str(Loot[i]),"-1","ground")

и вообще правильный вариант цикла по типам выглядит примерно так ( массив строковый а не численный!)

...
Loot[10]="0x0F90"
Loot[11]="0x0F7E"
...
For i=0 to 29
UO.FindType(Loot[i],"-1","ground")
if UO.Findcount() then
UO.moveitem("finditem")
wait(WaitTime)
endif
Edred
Expert!
Posts: 2544
Joined: 2004-04-03 17:36:29
Location: Saint-Petersburg

Post by Edred »

Я бы еще предложил немного переделать цикл... не искать каждый элемент массива в трупе, а искать любой предмет и сравнивать его со всеми элементами массива. Тогда не надо дублировать в массиве одни и те же элементы.

То есть, у меня сделано это так:

Code: Select all

Sub CorpseLoot( Cont )
   ; лутим что надо из Cont
   DIM Nado[6]
   Nado[0] = '0x14ED'   ; Карты
   Nado[1] = '0x1BD1'   ; Перья
   Nado[2] = '0x0EED'   ; Деньги
   Nado[3] = '0x0F78'   ; Батвинги
   Nado[4] = '0x0F87'   ; Глазки
   Nado[5] = '0x0F8D'   ; Спидер силк
   VAR i
   UO.FindType( '-1', '-1', Cont )
   while UO.FindCount()
      For i = 0 To 5
         If UO.GetGraphic( 'finditem' ) == Nado[i] Then
            UO.MoveItem( 'finditem' )
            wait(500)
            CheckLag()
         Else
            wait(50)
         Endif
      Next
      UO.Ignore( 'finditem' )
      UO.FindType( '-1', '-1', Cont )
   wend
   UO.IgnoreReset()
endsub


PS: Это не готовый скрипт для кого-то, это функция, вызываемая из скрипта на автоматическое зоннерство :) Как образец.
Post Reply