Yoko

All sides of Injection
It is currently 2025-12-24 15:56:49

All times are UTC+02:00




Post new topic  Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Fishing_
PostPosted: 2005-06-16 05:32:58 
Offline

Joined: 2005-06-16 04:48:18
Posts: 3
есть скрипт
Code:
sub fishing() 
var mx, my, mz, i, j
start:
mx = UO.GetX("self")
my = UO.GetY("self")
mz = UO.GetZ("self")
UO.DeleteJournal()
for i = mx-4 to mx+4
for j = my -4 to my+4
if UO.dead() then
return
endif
UO.Print("Now Fishing In: "+str(mx-i)+" "+str(my-j))
while not UO.InJournal("no fish here") and not UO.InJournal("location") and not UO.InJournal("far away") and not UO.InJournal("in water") and not UO.InJournal("You pull")
UO.DeleteJournal()
UO.Waittargettile("1341", str(i), str(j), str(mz))
UO.Usetype("0x0DC0")
if UO.dead() then
return
endif
if UO.Weight>720 then
return
endif
while not UO.InJournal("You pull") and not UO.InJournal("location") and not UO.InJournal("no fish") and not UO.InJournal("but fail") and not UO.InJournal("far away") and not UO.InJournal("in water")
wait (100)
if UO.InJournal("You pull") then
UO.findtype('0x14EB','0x0000','ground') ;tattered map
UO.grab ('1','finditem')
wait (200)
UO.findtype('0x0DD6','0x05F6','ground') ;Truly rare fish
UO.grab ('1','finditem')
wait (200)
UO.findtype('0x0DD6','0x01BB','ground') ;Prize fish
UO.grab ('1','finditem')
wait (200)
end if
wend
wend
UO.DeleteJournal()
next
next
goto start
end sub

работал прекрасно, но вот перешел на другой шард и там если из воды ничего не вылавливаешь сообщений никаких не появляется, в резыльтате скрипт останавливается.
как поставить условие на время . чтоб если 7 секунд нет ни каких сообщений то скрипт продолжал свою работу.


Top
   
 Post subject:
PostPosted: 2005-06-16 07:46:45 
Offline

Joined: 2005-06-12 09:14:09
Posts: 52
Location: Moscow, Russia
А если вот это
Code:
while not UO.InJournal("You pull") and not UO.InJournal("location") and not UO.InJournal("no fish") and not UO.InJournal("but fail") and not UO.InJournal("far away") and not UO.InJournal("in water") 
wait (100)
if UO.InJournal("You pull") then
UO.findtype('0x14EB','0x0000','ground') ;tattered map
UO.grab ('1','finditem')
wait (200)
UO.findtype('0x0DD6','0x05F6','ground') ;Truly rare fish
UO.grab ('1','finditem')
wait (200)
UO.findtype('0x0DD6','0x01BB','ground') ;Prize fish
UO.grab ('1','finditem')
wait (200)
end if
wend


поменять на
Code:
var k
...
k=0
repeat
wait (100)
if UO.InJournal("You pull") then
UO.findtype('0x14EB','0x0000','ground') ;tattered map
UO.grab ('1','finditem')
wait (200)
UO.findtype('0x0DD6','0x05F6','ground') ;Truly rare fish
UO.grab ('1','finditem')
wait (200)
UO.findtype('0x0DD6','0x01BB','ground') ;Prize fish
UO.grab ('1','finditem')
wait (200)
end if
k=k+1
until UO.InJournal("You pull") or UO.InJournal("location") or UO.InJournal("no fish") or UO.InJournal("but fail") or UO.InJournal("far away") or UO.InJournal("in water") or k>69


Вроде так он 70 раз прокрутит if без его исполнения каждый раз выжидая по 0,1 секунды. и получится как раз 7 секунд.
Но я не уверен - проверить работоспособность сейчас не могу. Пусть более опытные товарищи подскажут - прав я или нет.


Top
   
 Post subject:
PostPosted: 2005-06-16 11:07:55 
Offline
User avatar

Joined: 2005-02-25 13:31:26
Posts: 62
Location: DRW, [Hussars]
Code:
sub main() 
var mx, my, mz, i, j, LT, y
Dim t_item[3], c_item[3]
t_item[0]='0x14EB'
t_item[1]='0x0DD6'
t_item[2]='0x0DD6'
c_item[0]='0x0000'
c_item[1]='0x05F6'
c_item[2]='0x01BB'
while not uo.dead() or UO.Weight<=720
mx = UO.GetX("self")
my = UO.GetY("self")
mz = UO.GetZ("self")
UO.DeleteJournal()
for i = mx-4 to mx+4
   for j = my -4 to my+4
      if UO.dead() then
         return
      endif
      LT=uo.timer()
      UO.Print("Now Fishing In: "+str(mx-i)+" "+str(my-j))
      while not UO.InJournal("no fish here") and not UO.InJournal("location") and not UO.InJournal("far away") and not UO.InJournal("in water") and not UO.InJournal("You pull") and uo.timer()<=LT+70
         UO.DeleteJournal()
         UO.Waittargettile("1341", str(i), str(j), str(mz))
         UO.Usetype("0x0DC0")
         #UO.Usetype("0x0DBF")
         repeat
            wait(200)
         until UO.InJournal("no fish here") or UO.InJournal("location") or UO.InJournal("far away") or UO.InJournal("in water") or UO.InJournal("You pull") or uo.timer()>LT+70
         if UO.dead() then
            return
         endif
         if UO.Weight>720 then
            return
         endif
      wend       
      for y=0 to 2
          uo.findtype(t_item[y], c_item[y], 'ground')
          wait(300)
          uo.moveitem('finditem', '0', 'backpack')
     wait(300)
      next     
      UO.DeleteJournal()
   next
next
wend
end sub


Откорректировал...Должно пахать.


Last edited by Arsuri on 2005-06-30 00:54:36, edited 2 times in total.

Top
   
 Post subject:
PostPosted: 2005-06-17 04:13:45 
Offline

Joined: 2005-06-16 04:48:18
Posts: 3
Arsuri твой скрипт глючит не по детски, я также пробовал и у меня не получилось, может с обработкой таймера какая т о проблема.
Tergos попробовал нормально работает, только удочку через раз закидывает но это не проблема.
Всем огромное спасибо что откликнулись и помогли.


Top
   
 Post subject:
PostPosted: 2005-06-17 07:12:22 
Offline
User avatar

Joined: 2005-02-25 13:31:26
Posts: 62
Location: DRW, [Hussars]
begemut wrote:
Arsuri твой скрипт глючит не по детски, я также пробовал и у меня не получилось, может с обработкой таймера какая т о проблема.
Tergos попробовал нормально работает, только удочку через раз закидывает но это не проблема.
Всем огромное спасибо что откликнулись и помогли.


Откорректировал и убрал лишнее... У меня работал. Проверяй.


Top
   
 Post subject:
PostPosted: 2005-06-25 15:45:50 
Offline

Joined: 2005-06-16 04:48:18
Posts: 3
Arsuri после корректировки все тоже зависает видно что то с таймером не хочет работать


Top
   
 Post subject:
PostPosted: 2005-06-30 00:57:42 
Offline
User avatar

Joined: 2005-02-25 13:31:26
Posts: 62
Location: DRW, [Hussars]
begemut wrote:
Arsuri после корректировки все тоже зависает видно что то с таймером не хочет работать


Проблема не в таймере, а в моей невнимательности... Странно, что он у меня вообще в тот раз работал. :roll: :(


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: Bing [Bot] and 1 guest


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