Yoko

All sides of Injection
It is currently 2025-10-15 00:05:08

All times are UTC+02:00




Post new topic  Reply to topic  [ 10 posts ] 
Author Message
PostPosted: 2011-06-18 17:27:09 
Offline
User avatar

Joined: 2007-05-23 19:51:18
Posts: 197
всем привет, помогите зациклить скрипт ( чтобы постоянно висел запущенным )
сейчас он облавливает все и останавливается.
что сделал я : добавил repeat в начало скрипта, но это не помогло.


Code:
sub fishing()
var mx, my, mz, i, j
repeat
uo.print('Ведро для рыбы где ?')
uo.exec('addobject Bag')
while uo.targeting()
wait(100)
wend

UO.Say (',set finddistance 4')

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")
UO.DeleteJournal()
UO.Waittargettile("1341", str(i), str(j), str(mz))
UO.Usetype("0x0DBF") ;FishingPole
if UO.dead() then
return
endif
if UO.Weight>660 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.SetReceivingContainer('Bag')
UO.findtype('0x09CF','0x0000','ground') ;fish
UO.grab ('3','finditem')
wait (200)
UO.findtype('0x09CD','0x0000','ground') ;fish
UO.grab ('3','finditem')
wait (200)
UO.findtype('0x09CE','0x0000','ground') ;fish
UO.grab ('3','finditem')
wait (200)
UO.findtype('0x09CC','0x0000','ground') ;fish
UO.grab ('3','finditem')
wait (200)
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)
UO.UnSetReceivingContainer()
end if
wend
wend
UO.DeleteJournal()
next
next
end sub


Top
   
PostPosted: 2011-06-18 17:34:08 
Offline

Joined: 2011-05-23 00:33:30
Posts: 949
Quote:
добавил repeat в начало скрипта, но это не помогло.

ну у команды репит должно быть окончание until и условие а вообще сделай в начале скрипта, где нужно while not uo.dead и в конце закрой

_________________
CodeSweeper


Top
   
PostPosted: 2011-06-18 17:39:32 
Offline
User avatar

Joined: 2007-05-23 19:51:18
Posts: 197
Code:
sub fishing()
var mx, my, mz, i, j
while not uo.dead
uo.print('Ведро для рыбы где ?')
uo.exec('addobject Bag')
while uo.targeting()
wait(100)
wend

UO.Say (',set finddistance 4')

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")
UO.DeleteJournal()
UO.Waittargettile("1341", str(i), str(j), str(mz))
UO.Usetype("0x0DBF") ;FishingPole
if UO.dead() then
return
endif
if UO.Weight>660 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.SetReceivingContainer('Bag')
UO.findtype('0x09CF','0x0000','ground') ;fish
UO.grab ('3','finditem')
wait (200)
UO.findtype('0x09CD','0x0000','ground') ;fish
UO.grab ('3','finditem')
wait (200)
UO.findtype('0x09CE','0x0000','ground') ;fish
UO.grab ('3','finditem')
wait (200)
UO.findtype('0x09CC','0x0000','ground') ;fish
UO.grab ('3','finditem')
wait (200)
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)
UO.UnSetReceivingContainer()
end if
wend
wend
UO.DeleteJournal()
next
next
end while
end sub

так ?


Top
   
PostPosted: 2011-06-18 17:41:23 
Offline

Joined: 2011-05-23 00:33:30
Posts: 949
end while это в уо пилоте а в инжекте wend

_________________
CodeSweeper


Top
   
PostPosted: 2011-06-18 17:59:53 
Offline

Joined: 2011-05-23 00:33:30
Posts: 949
Только не понятно зачем зацикливать, раз чар выловил все значит уже на этом месте ловить нечего а ходилки в скрипте нету, по этому и не случайно он выключаеться.

_________________
CodeSweeper


Top
   
PostPosted: 2011-06-19 07:42:46 
Offline
User avatar

Joined: 2006-12-08 10:51:50
Posts: 718
Location: Москва
while нужно ставить перед первым for


Top
   
PostPosted: 2011-06-19 11:18:13 
Offline
User avatar

Joined: 2007-05-23 19:51:18
Posts: 197
ZeroDX wrote:
while нужно ставить перед первым for


Code:
UO.DeleteJournal()
while not uo.dead - сюда ?
for i = mx-4 to mx+4
for j = my -4 to my+4
if UO.dead() then


Top
   
PostPosted: 2011-06-19 11:21:16 
Offline
User avatar

Joined: 2006-12-08 10:51:50
Posts: 718
Location: Москва
ага, но только если ты не будешь двигать чара, если будешь, то надо переписывать waittargettile


Top
   
PostPosted: 2011-06-19 11:21:44 
Offline

Joined: 2011-05-23 00:33:30
Posts: 949
Code:
sub fishing()
while not uo.dead
var mx, my, mz, i, j

_________________
CodeSweeper


Top
   
PostPosted: 2011-06-19 12:48:42 
Offline
User avatar

Joined: 2006-12-08 10:51:50
Posts: 718
Location: Москва
не уверен, что постоянно объявлять переменные - хорошая идея.


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 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