Нужна ходилка без обхода препядствий ! Но быстрая....
Поиск юзал облазел х...ву гору всего Ничего так и не нашел ....
Прошу Напишите кому не лень .... Или просто киньте сюда ссылку
Заранее Примного БлагодареН!!!
Moderators: Murderator+, Murderator
Ты тупой или где ?!Rivory wrote:Я не понимаю, зачем писать что пользовался поиском, если ты его даже не открывал ? Ходилки на форуме выкладывались уже миллионы раз, и ходилки, и догонялки, и по координатам, и до обьекта, и с обходами, и напрямую, и как только можно, а он пишет : нифига не нашёл. Ну блин купи себе hands.dll и попробуй ещё раз.
Code: Select all
sub movechar(xx,yy)
repeat
if yy<uo.gety() then
gon()
else
if yy>uo.gety() then
gos()
end if
end if
if xx<uo.getx() then
gow()
else
if xx>uo.getx() then
goe()
end if
end if
until (xx==uo.getx()) and (yy==uo.gety())
end sub
sub GoW()
VAR walkwait=300
VAR x,y,dir=6
VAR key=36 ; Home key
x=UO.GetX()
y=UO.GetY()
while UO.GetDir()<>dir
UO.Press(key)
wait(walkwait)
If UO.GetDir()<>dir Then
CheckLag()
Endif
wend
UO.Press(key)
wait(walkwait)
If x==UO.GetX() AND y==UO.GetY() Then
CheckLag()
Endif
If UO.GetX()+1==x Then
return -1
Else
return 1
Endif
end sub
sub GoN()
VAR walkwait=300
VAR x,y,dir=0
VAR key=33 ; PgUp
x=UO.GetX()
y=UO.GetY()
while UO.GetDir()<>dir
UO.Press(key)
wait(walkwait)
If UO.GetDir()<>dir Then
CheckLag()
Endif
wend
UO.Press(key)
wait(walkwait)
If x==UO.GetX() AND y==UO.GetY() Then
CheckLag()
Endif
If UO.GetY()+1==y Then
return -1
Else
return 1
Endif
end sub
sub GoE()
VAR walkwait=300
VAR x,y,dir=2
VAR key=34 ; PgDown
x=UO.GetX()
y=UO.GetY()
while UO.GetDir()<>dir
UO.Press(key)
wait(walkwait)
If UO.GetDir()<>dir Then
CheckLag()
Endif
wend
UO.Press(key)
wait(walkwait)
If x==UO.GetX() AND y==UO.GetY() Then
CheckLag()
Endif
If UO.GetX()-1==x Then
return -1
Else
return 1
Endif
end sub
sub GoS()
VAR walkwait=300
VAR x,y,dir=4
VAR key=35 ; End
x=UO.GetX()
y=UO.GetY()
while UO.GetDir()<>dir
UO.Press(key)
wait(walkwait)
If UO.GetDir()<>dir Then
CheckLag()
Endif
wend
UO.Press(key)
wait(walkwait)
If x==UO.GetX() AND y==UO.GetY() Then
CheckLag()
Endif
If UO.GetY()-1==y Then
return -1
Else
return 1
Endif
end sub Не хочешь не верь .....I'm wrote:ILIAS17 wrote:Ты тупой или где ?!![]()
Полегче. Не стоит переходить на личности."Не Верю" (С) Сами знаете ктоя написал что пользовуался поиском значит пользовался .......
Раздел Scripting Ore - ПРИЛЕПЛЕННАЯ тема.
Code: Select all
sub Walk(x,y,Target)
VAR i,StepSucess
VAR dx,dy,Exit=0
While Exit<>1
If Target<>"" Then
dx=UO.GetX(Target)-UO.GetX()
dy=UO.GetY(Target)-UO.GetY()
; UO.Print("Target locked!")
If UO.GetDistance(Target)<2 Then
Exit=1
Endif
Else
dx=x-UO.GetX()
dy=y-UO.GetY()
If dx==0 AND dy==0 Then
Exit=1
Endif
Endif
If dx<>0 AND dy<>0 Then
If dx>0 AND dy>0 Then
StepSucess=Go(3,40,100) ;SE - DownArrow
If StepSucess==-1 Then
StepSucess=Go(7,38,100) ;WN - UpArrow
StepSucess=Go(1,39,100) ;NE - RightArrow
If StepSucess==-1 Then
StepSucess=Go(5,37,100) ;SW - LeftArrow
Endif
Endif
Endif
If dx>0 AND dy<0 Then
StepSucess=Go(1,39,100) ;NE - RightArrow
If StepSucess==-1 Then
StepSucess=Go(5,37,100) ;SW - LeftArrow
StepSucess=Go(3,40,100) ;SE - DownArrow
If StepSucess==-1 Then
StepSucess=Go(7,38,100) ;WN - UpArrow
Endif
Endif
Endif
If dx<0 AND dy>0 Then
StepSucess=Go(5,37,100) ;SW - LeftArrow
If StepSucess==-1 Then
StepSucess=Go(1,39,100) ;NE - RightArrow
StepSucess=Go(7,38,300) ;WN - UpArrow
If StepSucess==-1 Then
StepSucess=Go(3,40,100) ;SE - DownArrow
Endif
Endif
Endif
If dx<0 AND dy<0 Then
StepSucess=Go(7,38,100) ;WN - UpArrow
If StepSucess==-1 Then
StepSucess=Go(3,40,100) ;SE - DownArrow
StepSucess=Go(5,37,100) ;SW - LeftArrow
If StepSucess==-1 Then
StepSucess=Go(1,39,100) ;NE - RightArrow
Endif
Endif
Endif
Endif
If dx<>0 AND dy==0 Then
If dx>0 Then
StepSucess=Go(2,34,100) ;E - PgDown
If StepSucess==-1 Then
StepSucess=Go(3,40,100) ;SE - DownArrow
If StepSucess==-1 Then
StepSucess=Go(1,39,100) ;NE - RightArrow
Endif
StepSucess=Go(2,34,100) ;E - PgDown
Endif
Endif
If dx<0 Then
StepSucess=Go(6,36,100) ;W - Home
If StepSucess==-1 Then
StepSucess=Go(7,38,100) ;WN - UpArrow
If StepSucess==-1 Then
StepSucess=Go(5,37,100) ;SW - LeftArrow
Endif
StepSucess=Go(6,36,100) ;W - Home
Endif
Endif
Endif
If dx==0 AND dy<>0 Then
If dy>0 Then
StepSucess=Go(4,35,100) ;S - End
If StepSucess==-1 Then
StepSucess=Go(3,40,100) ;SE - DownArrow
If StepSucess==-1 Then
StepSucess=Go(5,37,100) ;SW - LeftArrow
Endif
StepSucess=Go(4,35,100) ;S - End
Endif
Endif
If dy<0 Then
StepSucess=Go(0,33,100) ;N - PgUp
If StepSucess==-1 Then
StepSucess=Go(1,39,100) ;NE - RightArrow
If StepSucess==-1 Then
StepSucess=Go(7,38,100) ;WN - UpArrow
Endif
StepSucess=Go(0,33,100) ;N - PgUp
Endif
Endif
Endif
Wend
end sub
;
sub Go(dir,key,Walkwait)
VAR x,y, OldDir
x=UO.GetX()
y=UO.GetY()
OldDir=UO.GetDir()
If UO.GetDir()<>dir Then
UO.Press(key)
wait(Walkwait)
If UO.GetDir()<>dir Then
CheckLag()
Endif
Endif
UO.Press(key)
wait(Walkwait)
If x==UO.GetX() AND y==UO.GetY() Then
CheckLag()
Endif
If x==UO.GetX() AND y==UO.GetY() AND OldDir<>UO.GetDir() Then
UO.Press(key)
wait(Walkwait)
Endif
If x==UO.GetX() AND y==UO.GetY() Then
CheckLag()
Endif
If x==UO.GetX() AND y==UO.GetY() Then
UO.Print("Zasada!")
return -1
Else
return 1
Endif
end sub
Dest wrote: ...
ходилка прет напролом кратчайшим путем к указанной точке, правда препятствия не обходит (обход оных в процессе написания).
Координаты я ваще забил внутри скрипта (пока отлаживал), но можно повесить как аргументы функции.Code: Select all
sub hodilka() var x,y,cx,cy,tmp,i=0, temp x = 1642 ;//Координата x-назначения. y = 2669 ;//Координата y-назначения. x = -(uo.getx() - x) y = -(uo.gety() - y) cx = x cy = y if cx <= 0 then cx = -cx endif if cy <= 0 then cy = -cy endif tmp = str(cx+cy) if val(tmp) then DIM step[val(tmp)] repeat i=i+1 if x>0 && y>0 && x==y then x=x-1 y=y-1 cx=x cy=y step[i]=2 endif if x>0 && cx>cy then x=x-1 cx=x step[i]=3 endif if x>0 && y<0 && cx==cy then x=x-1 y=y+1 cx=x cy=-y step[i]=6 endif if y<0 && cy>cx then y=y+1 cy=-y step[i]=9 endif if x<0 && y<0 && x==y then x=x+1 y=y+1 cx=-x cy=-y step[i]=8 endif if x<0 && cx>cy then x=x+1 cx=-x step[i]=7 endif if x<0 && y>0 && cx==cy then x=x+1 y=y-1 cx=-x cy=y step[i]=4 endif if y>0 && cy>cx then y=y-1 cy=y step[i]=1 endif if x==-0 then x=0 endif if y==-0 then y=0 endif until cx==0 && cy==0 temp=i tmp='' for i=1 to temp tmp=tmp+str(step[i]) next uo.addstep(tmp) endif uo.resend() endsub
Code: Select all
Sub GotoXY(x,y,prec)
var mx,my
repeat
mx=UO.GetX('self')
my=UO.GetY('self')
if Diap(mx,x,prec) and my>y+prec then
UO.Press(33)
endif
if Diap(mx,x,prec) and my<y-prec then
UO.Press(35)
endif
if mx<x-prec and Diap(my,y,prec) then
UO.Press(34)
endif
if mx<x-prec and my>y+prec then
UO.Press(39)
endif
if mx<x-prec and my<y-prec then
UO.Press(40)
endif
if mx>x+prec and Diap(my,y,prec) then
UO.Press(36)
endif
if mx>x+prec and my>y+prec then
UO.Press(38)
endif
if mx>x+prec and my<y-prec then
UO.Press(37)
endif
until Diap(mx,x,prec) and Diap(my,y,prec)
endsub
Sub Diap(mx,x,prec)
if mx-x>=-prec and mx-x<=prec then
return 1
else
return 0
endif
endsub
гыыы. Вчитайся строчку, отмеченную шарпамиto4a wrote:жирные они все какието, нашел свою хз сколько летней давности написания...
идёт тупо, в лоб, до нужного расстояния подхода(prec)
Code: Select all
Sub GotoXY(x,y,prec) var mx,my repeat mx=UO.GetX('self') my=UO.GetY('self') if Diap(mx,x,prec) and my>y+prec then UO.Press(33) endif if Diap(mx,x,prec) and my<y-prec then UO.Press(35) endif if mx<x-prec and Diap(my,y,prec) then UO.Press(34) endif if mx<x-prec and my>y+prec then UO.Press(39) endif if mx<x-prec and my<y-prec then UO.Press(40) endif if mx>x+prec and Diap(my,y,prec) then UO.Press(36) endif if mx>x+prec and my>y+prec then UO.Press(38) endif if mx>x+prec and my<y-prec then UO.Press(37) endif until Diap(mx,x,prec) and Diap(mx,x,prec) ############ endsub Sub Diap(mx,x,prec) if mx-x>=-prec and mx-x<=prec then return 1 else return 0 endif endsub