Проблема с фишингом

Ask for scripts here

Moderators: Murderator+, Murderator

Post Reply
exet
Posts: 9
Joined: 2007-11-21 00:15:38
Contact:

Проблема с фишингом

Post by exet »

Code: Select all

sub fishing()
var plav = 16
var l
var m
var k
dim xx[10] 
xx[0] = -5
xx[1] = -4
xx[2] = -3
xx[3] = -2
xx[4] = -1
xx[5] = 0
xx[6] = 1
xx[7] = 2
xx[8] = 3
xx[9] = 4
xx[10] = 5

dim yy[7] 
yy[0] = -6
yy[1] = -5
yy[2] = -4
yy[3] = -3
yy[4] = 3
yy[5] = 4
yy[6] = 5
yy[7] = 6

while True
for l = 0 to 10
for m = 0 to 7
if uo.GetGlobal("fish")=='yes' then
if uo.weight > 400 then
dobor()
End If
k=0
uo.deletejournal()
UO.WaitTargetTile(0,str(uo.GetX()+xx[l]),str(uo.GetY()+yy[m]),str(uo.GetZ()))
uo.usetype("0x0DBF")
while not (uo.injournal("You pull out a fish!") or uo.injournal("You stop fishing.") or uo.injournal("You fail to catch anything.") or uo.injournal("There are no fish here.") or uo.injournal("You put") or uo.injournal("You pull") or uo.injournal("Fishing has") or uo.injournal("That is too") or uo.injournal("Try fishing") or uo.injournal("Unexpected target info")) or k > 40000
wait(500)
k=k+500
wend
next
wait(50)
next
wait(50)
if plav < 5 then
plav = plav + 1
uo.msg("forward")
uo.print(str(plav))
wait(10000)
uo.msg("stop")
end if
if plav >= 5 and plav < 10 then
plav = plav + 1
uo.msg("Right")
uo.print(str(plav))
wait(10000)
uo.msg("stop")
end if
if plav >= 10 and plav < 15 then
plav = plav + 1
uo.msg("Back")
uo.print(str(plav))
wait(10000)
uo.msg("stop")
end if
if plav >= 15 and plav < 20 then
plav = plav + 1
uo.msg("left")
uo.print(str(plav))
wait(10000)
uo.msg("stop")
end if
if plav == 20 then
plav = 0
uo.print(plav)
end if
wait(50)
end if
wait(50)
wend
wait(50)
end sub

Вот Кусок моего скрипта на фишинг.Работает отлично, плавает по квадрату, Но иногда возникает проблема: Чар просто перестает ловить и стоит, в чем проблема я не знаю, Даже если вручную ему помочь и один раз выловить рыбу, то цикл дальше не идет, значит проблема не с журналом. Помогите, пожалуйста =(
Mirage
Posts: 2802
Joined: 2009-05-28 09:58:28
Location: Иваново
Contact:

Post by Mirage »

if uo.GetGlobal("fish")=='yes' then вот эта хрень тут зачем? О_о
Пропусти через табулятор Дестракшена - у тебя структура не верна в циклах. Увидишь ошибки сразу.

Code: Select all

for
If 
next
endif...
exet
Posts: 9
Joined: 2007-11-21 00:15:38
Contact:

Post by exet »

Mirage wrote:if uo.GetGlobal("fish")=='yes' then вот эта хрень тут зачем? О_о
Пропусти через табулятор Дестракшена - у тебя структура не верна в циклах. Увидишь ошибки сразу.

Code: Select all

for
If 
next
endif...
Глобал, для того, чтобы если выловил моба, процесс отвечающий за убийство моба ставит значение NO, и скрипт на паузе, соотв как убил моба ставит переменную YES
exet
Posts: 9
Joined: 2007-11-21 00:15:38
Contact:

Post by exet »

Code: Select all

sub fishing()
	var plav = 16
	var l
	var m
	var k
	dim xx[10]
	xx[0] = -5
	xx[1] = -4
	xx[2] = -3
	xx[3] = -2
	xx[4] = -1
	xx[5] = 0
	xx[6] = 1
	xx[7] = 2
	xx[8] = 3
	xx[9] = 4
	xx[10] = 5
	dim yy[7]
	yy[0] = -6
	yy[1] = -5
	yy[2] = -4
	yy[3] = -3
	yy[4] = 3
	yy[5] = 4
	yy[6] = 5
	yy[7] = 6
	while True
		for l = 0 to 10
			for m = 0 to 7
				if uo.GetGlobal("fish")=='yes' then
					if uo.weight > 400 then
						dobor()
					End If
					k=0
					uo.deletejournal()
					UO.WaitTargetTile(0,str(uo.GetX()+xx[l]),str(uo.GetY()+yy[m]),str(uo.GetZ()))
					uo.usetype("0x0DBF")
					while not (uo.injournal("You pull out a fish!") or uo.injournal("You stop fishing.") or uo.injournal("You fail to catch anything.") or uo.injournal("There are no fish here.") or uo.injournal("You put") or uo.injournal("You pull") or uo.injournal("Fishing has") or uo.injournal("That is too") or uo.injournal("Try fishing") or uo.injournal("Unexpected target info")) or k > 40000
						wait(500)
						k=k+500
					wend
				end if
			next
			wait(50)
		next
		wait(50)
		if plav < 5 then
			plav = plav + 1
			uo.msg("forward")
			uo.print(str(plav))
			wait(10000)
			uo.msg("stop")
		end if
		if plav >= 5 and plav < 10 then
			plav = plav + 1
			uo.msg("Right")
			uo.print(str(plav))
			wait(10000)
			uo.msg("stop")
		end if
		if plav >= 10 and plav < 15 then
			plav = plav + 1
			uo.msg("Back")
			uo.print(str(plav))
			wait(10000)
			uo.msg("stop")
		end if
		if plav >= 15 and plav < 20 then
			plav = plav + 1
			uo.msg("left")
			uo.print(str(plav))
			wait(10000)
			uo.msg("stop")
		end if
		if plav == 20 then
			plav = 0
			uo.msg("left")
			uo.print(str(plav))
			wait(10000)
			uo.msg("stop")
		end if
		wait(50)
	wend
	wait(50)
end sub 
Так нада?
Post Reply