Yoko

All sides of Injection
It is currently 2026-03-16 20:36:19

All times are UTC+02:00




Post new topic  Reply to topic  [ 3 posts ] 
Author Message
PostPosted: 2004-11-24 18:03:07 
Offline
User avatar

Joined: 2004-07-18 13:01:15
Posts: 141
Code:
sub mine(PX,PY) 
var x, y,z
VAR LastTimer
UO.Set('finddistance','2')
z=UO.GetZ("self")
for x=-2 to 2
for y=-2 to 2
Hid()
UO.Print(str(x)+" "+str(y))
Repeat
if UO.InJournal('TORMOZ') then
pause()
endif
UO.DeleteJournal()
UO.Exec("warmode 0")
UO.WaitTargetTile("1341",STR(UO.GetX()+x),STR(UO.GetY()+Y),z)
UO.UseType('0x0F39')
LastTimer=UO.Timer()
Repeat
wait(500)
Until UO.InJournal("You put") or UO.InJournal("can't see") or UO.InJournal("heavy") or UO.InJournal("location") or UO.InJournal("no ore") or UO.InJournal("but fail") or UO.InJournal("far away") or UO.InJournal("in rock") or UO.InJournal("must wait") or UO.InJournal("nothing") or UO.InJournal("elsewhere") or UO.InJournal("where it") OR UO.Timer()>LastTimer+200
lookout()
Until UO.InJournal("nothing") or UO.InJournal("elsewhere") or UO.InJournal("no ore here") or UO.InJournal("location") or UO.InJournal("far away") or UO.InJournal("in rock") or UO.InJournal("where it")
wait(500)
next
next
if UO.InJournal("You put the boulder") then
UO.findtype('0x134F',-1,'ground')
if UO.FindCount()>0 then
UO.waittargetground('0x134F')
UO.UseType('0x0E85') ;
wait(500)
else
UO.findtype('0x134F',-1,-1)
if UO.FindCount()>0 then
UO.WaitTargetType('0x134F')
UO.UseType('0x0E85') ;?????
wait(500)    
endif
endif
endif
if UO.Weight>720 then
unload(PX,PY)
endif 
end sub

У меня на шарде если копать Билдер лопатой выскакивают булыжники которые можно переработать в стоун блоки удар кирки по ним, вот я написал такой скриптик, подскажите плиз в чём ошибка ? Он не хочет ловить сообщение о появлении булыжника в паке, и соответственно не выполняет удар по ниму киркой..
Помогите плиз, я уже всё перепробовал ни как сам разобраться не могу %(


Top
   
PostPosted: 2004-11-25 09:06:49 
Offline
Expert!
User avatar

Joined: 2004-07-04 00:14:58
Posts: 1284
Code:
sub mine(PX,PY) 
var x, y,z
VAR LastTimer
UO.Set('finddistance','2')
z=UO.GetZ("self")
   for x=-2 to 2
      for y=-2 to 2
         UO.Print(str(x)+" "+str(y))
         Repeat
            Hid()
            if UO.InJournal('TORMOZ') then
               pause()
            endif
            UO.DeleteJournal()
            UO.Exec("warmode 0") ## зачем???
            UO.WaitTargetTile("1341",STR(UO.GetX()+x),STR(UO.GetY()+Y),z)
            UO.UseType('0x0F39')
            LastTimer=UO.Timer()
            Repeat
               wait(500)
            Until UO.InJournal("You put") or UO.InJournal("can't see") or UO.InJournal("heavy") or UO.InJournal("location") or UO.InJournal("no ore") or UO.InJournal("but fail") or UO.InJournal("far away") or UO.InJournal("in rock") or UO.InJournal("must wait") or UO.InJournal("nothing") or UO.InJournal("elsewhere") or UO.InJournal("where it") OR UO.Timer()>LastTimer+200
            if UO.InJournal("You put the boulder") then
               UO.findtype('0x134F',-1,'ground')
               if UO.FindCount()>0 then
                  UO.waittargetground('0x134F') ## на 'finditem' переделай
                  UO.UseType('0x0E85') ;
                  wait(500)
               else
                  UO.findtype('0x134F',-1,-1)
                  if UO.FindCount()>0 then
                     UO.WaitTargetType('0x134F') ## на 'finditem' переделай
                     UO.UseType('0x0E85') ;?????
                     wait(500)     
                  endif
               endif
            endif
            if UO.Weight>720 then
               unload(PX,PY)
            endif
            lookout()
         Until UO.InJournal("nothing") or UO.InJournal("elsewhere") or UO.InJournal("no ore here") or UO.InJournal("location") or UO.InJournal("far away") or UO.InJournal("in rock") or UO.InJournal("where it")
         wait(500)          
      next
   next
end sub
ты просматривай журнал сразу после выкапывания, а не после того как всё "гнездо" выкопаешь, т.к. с большой вероятностью данная строка уже покинет журнал ;)

ЗЫ я тебе контроль за весом сдвинул, на "после каждого юза лопаты", и Hid() - я понял, что там ты входишь в хайд - на "перед каждым юзом лопаты"


Top
   
 Post subject:
PostPosted: 2004-11-25 20:12:31 
Offline
User avatar

Joined: 2004-07-18 13:01:15
Posts: 141
Спасибо большое за помощь, теперь всё пашет как надо, топик можно закрывать :)


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

All times are UTC+02:00


Who is online

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