Yoko

All sides of Injection
It is currently 2026-03-10 18:22:03

All times are UTC+02:00




Post new topic  Reply to topic  [ 7 posts ] 
Author Message
PostPosted: 2004-09-06 10:21:40 
Offline

Joined: 2004-07-27 20:54:24
Posts: 5
Люди подскажите - как можно сделать так - чтобы при нажатии кнопки с трупа
лутились определённые вещи - что-то вроде emptycontainer но не весть хлам
а только то что нужно!! Подскажите как это сделать , если вообще возможно.


Top
   
 Post subject:
PostPosted: 2004-09-06 16:28:51 
Offline
Site Admin
User avatar

Joined: 2004-04-03 16:49:38
Posts: 1964
как минимум раз 5 эта тема поднималась на форуме, и в этом и в архиве; попробуй найти

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


Top
   
 Post subject:
PostPosted: 2004-09-07 01:13:41 
Offline

Joined: 2004-07-27 20:54:24
Posts: 5
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


Top
   
 Post subject:
PostPosted: 2004-09-07 12:45:33 
Offline
Site Admin
User avatar

Joined: 2004-04-03 16:49:38
Posts: 1964
как правило я не рассматриваю скрипты длиннее 5 строк

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


Top
   
 Post subject:
PostPosted: 2004-09-09 21:10:18 
Offline

Joined: 2004-07-27 20:54:24
Posts: 5
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


Top
   
 Post subject:
PostPosted: 2004-09-10 16:42:41 
Offline
Site Admin
User avatar

Joined: 2004-04-03 16:49:38
Posts: 1964
попробуй 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


Top
   
 Post subject:
PostPosted: 2004-09-10 17:05:46 
Offline
Expert!

Joined: 2004-04-03 17:36:29
Posts: 2544
Location: Saint-Petersburg
Я бы еще предложил немного переделать цикл... не искать каждый элемент массива в трупе, а искать любой предмет и сравнивать его со всеми элементами массива. Тогда не надо дублировать в массиве одни и те же элементы.

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

Code:
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: Это не готовый скрипт для кого-то, это функция, вызываемая из скрипта на автоматическое зоннерство :) Как образец.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 7 posts ] 

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 0 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:  
Powered by phpBB® Forum Software © phpBB Limited