Yoko

All sides of Injection
It is currently 2025-11-04 17:22:11

All times are UTC+02:00




Post new topic  Reply to topic  [ 10 posts ] 
Author Message
PostPosted: 2008-10-07 15:52:31 
Offline

Joined: 2008-06-04 03:27:01
Posts: 30
Location: Bradford(UK)/Riga(LV)
играю на ДРВ

Code:
#blacksmith. Крафтит ножи и плавит
sub Bs()


Var box=0x403803F8
var forge=0x401C4019
Var ingt,colort,i=0,flag=0,flag1=0
Var PRD='0x0F51'
VAR ms0 = "You put the"
VAR ms1 = "You have failed"
VAR ms2 = "World data saved"
Dim Ing[18]
Dim IngColor[18]

Ing[0]='0x1BEF'  #Iron
Ing[1]='0x1BEF'  #Rusty
Ing[2]='0x1BEF'  #Old Copper
Ing[3]='0x1BEF'  #Dull Copper
Ing[4]='0x1BE3'  #Copper
Ing[5]='0x1BEF'  #Bronze
Ing[6]='0x1BF5'  #Silver
Ing[7]='0x1BE9'  #Gold
Ing[8]='0x1BEF'  #Shadow
Ing[9]='0x1BEF'  #Rose
Ing[10]='0x1BEF' #Agapite
Ing[11]='0x1BEF' #BloodRock
Ing[12]='0x1BEF' #Verite
Ing[13]='0x1BEF' #Valorite
Ing[14]='0x1BEF' #Mytheril
Ing[15]='0x1BEF' #BlackRock
Ing[16]='0x1BEF' #Obsidian
Ing[17]='0x1BEF' #Plutonium

IngColor[0]='0x0000'  #Iron
IngColor[1]='0x0750'  #Rusty
IngColor[2]='0x0590'  #Old Copper
IngColor[3]='0x060A'  #Dull Copper
IngColor[4]='0x0000'  #Copper
IngColor[5]='0x0488'  #Bronze
IngColor[6]='0x0000'  #Silver
IngColor[7]='0x0000'  #Gold
IngColor[8]='0x096B'  #Shadow
IngColor[9]='0x0014'  #Rose
IngColor[10]='0x0193' #Agapite
IngColor[11]='0x04C2' #BloodRock
IngColor[12]='0x07D5' #Verite
IngColor[13]='0x00CE' #Valorite
IngColor[14]='0x052D' #Mytheril
IngColor[15]='0x0455' #BlackRock
IngColor[16]='0x0028' #Obsidian
IngColor[17]='0x08AF' #Plutonium

uo.cancelmenu()
uo.automenu('Blacksmithing','Weapons')
uo.automenu('Weapons','Swords & Blades')
uo.automenu('Swords & Blades','dagger (3 iron ingot)')
uo.automenu('dagger')
wait(300)
repeat
for i=0 to 17
UO.FindType(Ing[i],IngColor[i],2)
if UO.GetQuantity('finditem') > 8 then
flag1=1
ingt=Ing[i]
endif
next

if flag1==0 then
i=0
repeat
UO.FindType(Ing[i],IngColor[i],box)
if UO.GetQuantity('finditem') > 8 then
flag=1
UO.Grab('300','finditem')
wait(500)
ingt=Ing[i]
endif
i=i+1
until flag==1
else

          UO.DeleteJournal()
          While NOT UO.Hidden()
          UO.UseSkill('Hiding')
          Wait(3000)
          Wend
          Checklag()
          UO.UseType(ingt)
          repeat
          wait(100)
          until (UO.InJournal(ms0) or UO.InJournal(ms1) or UO.InJournal(ms2) or UO.inJournal("You smelt") or UO.inJournal("You can't"))
          if (UO.InJournal(ms0)) then
          repeat
          UO.FindType(PRD,-1,2)
          UO.WaitTargetObject('finditem')
          UO.UseObject(forge)
          wait(1000)
          until UO.FindCount('finditem') < 8
          endIf
endif
flag=0
flag1=0
until ((uo.skillval("Blacksmithy",1) > 999) or (UO.Dead()))

end sub

Sub Checklag()
uo.deletejournal()
uo.click('backpack')
Repeat
wait(100)
Until UO.InJournal("backpack")
end sub

sub Reconnector()
var ReconnectTime, RFlag
ReconnectTime = '0'
RFlag = 1
Repeat
While (UO.ObjAtLayer('Bpack') == '')
if RFlag Then
ReconnectTime = MakeTime()
RFlag = 0
endif
Wait(20000) # WorldSave Protection
UO.Say('')
Wait(3000)
UO.Say('')
Wait(3000)
UO.Say('')
Wait(3000)
UO.LDblClick(357,164)
UO.LClick(616,459)
Wait(3000)
WEnd
Wait(3000)
if (RFlag == 0) and (ReconnectTime <> '0') Then
;UO.Exec('terminate Bs')
;UO.Exec('exec Bs')
UO.TextOpen()
UO.TextPrint('Disconnected & Reconnected @ '+ReconnectTime)
RFlag = 1
ReconnectTime = '0'
endif
Until false
end sub

sub MakeTime()
VAR D, T, Ret, i
Ret = STR(UO.Time())
T = ""
For i = 0 To Len(Ret)
T = Ret[Len(Ret)-i] + T
If (I == 2) OR (I == 4) Then
T = ":" + T
EndIf
Next
Ret = STR(UO.Date())
D = ""
For i = 0 To Len(Ret)
D = Ret[Len(Ret)-i] + D
If (I == 2) OR (I == 4) Then
D = "." + D
EndIf
Next
Ret = T + " @ " + D
RETURN Ret
end sub


Имеется вот этот прекрасный скрипт на бс.
В хайде кует и плавит даггеры из различных металлов, добирает из сундука.

но проблема в том, что когда остаётся ровно 8 ингов - выдаёт ошибку,
Line 71: Runetime error


помогите плз
:roll:


Top
   
 Post subject:
PostPosted: 2008-10-07 16:32:36 
Offline

Joined: 2008-06-04 03:27:01
Posts: 30
Location: Bradford(UK)/Riga(LV)
HELP


Top
   
 Post subject:
PostPosted: 2008-10-07 17:50:07 
Offline
User avatar

Joined: 2006-11-06 21:45:23
Posts: 137
Code:
if i > 17 then
   UO.Print("Странно, но ингов в нужном количестве наверно больше нет.")
   UO.Print("Вышли за границы массива.")
   UO.Print("Поэтому дальше будет парс эррор,")
   UO.Print("так как не выполнится условие: until flag==1")
   #return
endif


Top
   
 Post subject:
PostPosted: 2008-10-07 18:00:52 
Offline
User avatar

Joined: 2008-09-12 05:07:34
Posts: 247
Code:
         repeat 
            UO.FindType(Ing[i],IngColor[i],box)
               if UO.GetQuantity('finditem') > 8 then
                  flag=1
                  UO.Grab('300','finditem')
                  wait(500)
                  ingt=Ing[i]
               endif
            i=i+1
         until flag==1
проблема в этом цикле. Здесь скрипт ищет руду в сундуке, если он находит стопку руды с количеством ингов > 8, то устанавливает флаг в 1 и цикл завершается....А если он не найдёт такой стопки? Флаг не устанавливается в 1 и пустой цикл крутится вечно, ну или вылетает ошибка.


Top
   
 Post subject:
PostPosted: 2008-10-07 22:58:48 
Offline

Joined: 2008-06-04 03:27:01
Posts: 30
Location: Bradford(UK)/Riga(LV)
и как мне это всё исправить?

и ещё после вордсейфа он пару минут всё слишком быстро делает, и тем самым слишком много fail.

мож checklag куда ещё засунуть?
п.с. world save protection (который в reconnector) врубаю.


Top
   
 Post subject:
PostPosted: 2008-10-08 00:08:30 
Offline
User avatar

Joined: 2008-09-12 05:07:34
Posts: 247
Во первых, как тебе подсказал товарищ выше, воткни в этот цикл проверку и чеклаг
Code:
repeat 
  UO.FindType(Ing[i],IngColor[i],box)
    if UO.GetQuantity('finditem') > 8 then
      flag=1
      UO.Grab('300','finditem')
      checklag()
      wait(1000)
      ingt=Ing[i]
    endif
  i=i+1
  if i>17 then
    uo.print('КУКАРЕКУ!!!! ИНГОТЫ ЗАКОНЧИЛИСЬ!!!')
    return
  endif
until flag==1
В этом куске
Code:
          UO.DeleteJournal() 
          While NOT UO.Hidden()
          UO.UseSkill('Hiding')
          Wait(3000)
          Wend
          Checklag()
          UO.UseType(ingt)
чеклаг оттуда убери и засунь его под UO.UseSkill('Hiding'). Плавилку ваще переделай, она отстойная, вместо
Code:
          if (UO.InJournal(ms0)) then 
          repeat
          UO.FindType(PRD,-1,2)
          UO.WaitTargetObject('finditem')
          UO.UseObject(forge)
          wait(1000)
          until UO.FindCount('finditem') < 8
          endIf
воткни лучше
Code:
   while uo.count(PRD)
      uo.deletejournal()
      uo.waittargettype(PRD)
      uo.useobject(forge)
   repeat   
     wait(300)
     until uo.injournal('You put|It is consumed')
   wend
Вот, вроде всё.


Top
   
 Post subject:
PostPosted: 2008-10-08 01:14:09 
Offline

Joined: 2008-06-04 03:27:01
Posts: 30
Location: Bradford(UK)/Riga(LV)
Code:
   
while uo.count(PRD)
      uo.deletejournal()
      uo.waittargettype(PRD)
      uo.useobject(forge)
   repeat   
     wait(300)
     until uo.injournal('You put|It is consumed')
   wend


теперь когда заменил в плавилке на это - даёт Line 105: parse error



п.с.

плавилку оставил прежнюю, а все остальное поменял...
теперь такие траблы:

1) плавит даггер обратно не всегда, т.е. по тихоньку часть накапливается в бэкпэке
2) недобирает инги, когда кончаются вообще
3) unhandled exception in parser иногда выскакивает
(эт походу, когда в паке накапливается 8 даггеров не расплавленных.... так как target cancelled пишется часто, когда он пытается переплавить даггер)


Top
   
 Post subject:
PostPosted: 2008-10-08 06:35:41 
Offline
User avatar

Joined: 2008-09-12 05:07:34
Posts: 247
Криво поменял, наверное. Надо было не в плавилке поменять, а полностью плавилку заменить на ту что я тебе дал. Т.е. тот кусок в твоём скрипте полностью убираешь, а мою плавилку втыкаешь.


Top
   
 Post subject:
PostPosted: 2008-10-08 12:45:17 
Offline
User avatar

Joined: 2006-11-06 21:45:23
Posts: 137
Загляни сюда:
viewtopic.php?t=2902
можно найти много интереснго.


Top
   
 Post subject:
PostPosted: 2008-10-09 01:21:10 
Offline

Joined: 2008-06-04 03:27:01
Posts: 30
Location: Bradford(UK)/Riga(LV)
спасибо!!!! нужный скрипт дали! :roll:


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

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 6 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