Yoko

All sides of Injection
It is currently 2025-10-27 00:28:47

All times are UTC+02:00




Post new topic  Reply to topic  [ 11 posts ] 
Author Message
PostPosted: 2007-10-19 10:42:08 
Offline
User avatar

Joined: 2006-12-18 11:33:01
Posts: 44
Проблема такая он идёт к мобу который находится за екраном !
А который бегает в 2 тайлох от чара он не трогает (
Cтавлю меньше uo.set("finddistance","7") например на 4 все равно он бежыт к мобу который где то там далеко
Code:
sub atack()
var c, a, noto, ser, f=0
while 1==1
uo.warmode(1)
uo.deletejournal()
uo.set("finddistance","7")  ################
uo.findtype('0x0004','-1','ground')
uo.arm('1')
if uo.findcount() then
f=1
uo.attack('finditem')
while f==1
 uo.findtype('0x0004','-1','ground')
 go(uo.getx('finditem'),uo.gety('finditem'))
 uo.findtype('0x0004','-1','ground')
 wait(500)
 if uo.gethp()<55 then
   GHDrink()
 endif
 if uo.injournal('Body of Gargoyle') then
  f=0
 endif
 uo.deletejournal()
wend
endif
 rez()
   wait(2000)
         uo.FindType(0x0F78,'-1','lastcorpse')
    if uo.FindCount() then
      uo.moveitem('finditem','all')
      wait(750)
    end if
    uo.warmode(0)
   if not uo.hidden() then
    uo.useskill('Hiding')
    c=0
     while not uo.injournal('have hidden') and c<18
      wait(300)
      c=c+1
     wend
   endif
    uo.waittargetobject('lastcontainer')
    uo.setarm(11)
    wait(100)
    uo.useobject('sword')
    wait(1500)
    uo.arm(11)
    wait(1000)
   while uo.gethp()<190
   healing()
   wait(1000)
  wend
 endif
 uo.deletejournal()
wend
endsub

sub healing()
  if not uo.hidden() then
  uo.UseSkill('Meditation')
  endif
  uo.setarm('11')
  uo.bandageself()
  wait(1500)
  uo.arm('11')
  uo.attack('lastattack')
end sub
:?


Top
   
 Post subject:
PostPosted: 2007-10-20 02:03:26 
Offline
User avatar

Joined: 2007-02-21 20:15:57
Posts: 479
Можно попробовать искать постепенно увеличивая расстояние, либо искать всех и определять кто ближе.

_________________
Шард Антарес
Ururu


Top
   
 Post subject:
PostPosted: 2007-10-20 08:48:14 
Offline
User avatar

Joined: 2006-12-18 11:33:01
Posts: 44
Он берёт на вар ближайшего моба а идёт к далнему (


Top
   
 Post subject:
PostPosted: 2007-10-20 08:58:21 
Offline

Joined: 2004-07-14 22:56:46
Posts: 82
Location: Украина, Одесса
Так зачем два раза искать одного и того же монстра, если его id уже вбит в память после первого поиска?
Убери вторую строчку uo.findtype(.........) которая перед go(uo.getx('finditem'),uo.gety('finditem'))

_________________
ХХДЕНТОНХХ: Холодостойкий Хронометрирующий Дроид с Единым Наступательным Трансмутатором для Ограниченного Нападения и Хронометрированного Хищения
http://uokings.ru/news.php


Top
   
 Post subject:
PostPosted: 2007-10-20 11:26:23 
Offline
User avatar

Joined: 2006-12-18 11:33:01
Posts: 44
3 раза ишет
uo.findtype('0x0004','-1','ground')


Top
   
 Post subject:
PostPosted: 2007-10-20 12:02:16 
Offline

Joined: 2004-07-14 22:56:46
Posts: 82
Location: Украина, Одесса
тем более, один раз ищешь за цикл убийства одного монстра

_________________
ХХДЕНТОНХХ: Холодостойкий Хронометрирующий Дроид с Единым Наступательным Трансмутатором для Ограниченного Нападения и Хронометрированного Хищения

http://uokings.ru/news.php


Top
   
 Post subject:
PostPosted: 2007-10-20 13:21:27 
Offline
User avatar

Joined: 2006-12-18 11:33:01
Posts: 44
:!: хм
Code:
uo.set("finddistance","5") 
uo.findtype('0x0004','-1','ground')
uo.arm('1')
if uo.findcount() then
f=1
uo.attack('finditem')
while f==1

Ето ишет и берёт на атаку
####################
Code:
uo.findtype('0x0004','-1','ground') 
 go(uo.getx('finditem'),uo.gety('finditem'))

Ето ишет и идёт к ней ! Если убераеш 2 uo.findtype('0x0004','-1','ground')
перед go(uo.getx('finditem'),uo.gety('finditem')) [/code]
то он не знает куда идти !


Top
   
 Post subject:
PostPosted: 2007-10-20 13:31:26 
Offline

Joined: 2005-04-19 18:00:29
Posts: 2259
Location: Московская область
Unfogiven wrote:
:!: хм
Code:
uo.set("finddistance","5") 
uo.findtype('0x0004','-1','ground')
uo.arm('1')
if uo.findcount() then
f=1
uo.attack('finditem')
while f==1

Ето ишет и берёт на атаку
####################
Code:
uo.findtype('0x0004','-1','ground') 
 go(uo.getx('finditem'),uo.gety('finditem'))

Ето ишет и идёт к ней ! Если убераеш 2 uo.findtype('0x0004','-1','ground')
перед go(uo.getx('finditem'),uo.gety('finditem')) [/code]
то он не знает куда идти !


Когда 1 раз нашел, то ID заносится в finditem на всё время запуска скрипта или до следующего поиска по типу


Top
   
 Post subject:
PostPosted: 2007-10-20 13:48:21 
Offline

Joined: 2004-07-14 22:56:46
Posts: 82
Location: Украина, Одесса
т.е. первый поиск оставляешь, а два следующих убирай

_________________
ХХДЕНТОНХХ: Холодостойкий Хронометрирующий Дроид с Единым Наступательным Трансмутатором для Ограниченного Нападения и Хронометрированного Хищения

http://uokings.ru/news.php


Top
   
 Post subject:
PostPosted: 2007-10-20 15:22:33 
Offline
User avatar

Joined: 2006-12-18 11:33:01
Posts: 44
Да пробовал получатся так находит берёт на вар
Потом просто идёт кудато в сторону тоесть он не знает к кому подходить !


Top
   
 Post subject:
PostPosted: 2007-10-20 16:33:04 
Offline
User avatar

Joined: 2007-10-12 20:48:07
Posts: 100
Ой вей.
Code:
sub find()
Var lastX,lastY,myX,myY,Victim,LastTimer,i,z
myX=UO.GetX()
myY=UO.GetY()
lastX=myX
lastY=myY
repeat
   UO.set('finddistance', 5)
   UO.findtype('0x000D','-1','ground')
        wait(100)
   if UO.FindCount()>0 then
           Victim=UO.GetSerial('finditem')
      repeat
                    if UO.GetDistance(Victim)>1 then
                        WalkN(0,0,Victim)
                    end if
                    UO.attack(Victim)
                    wait(1000)
                   
                    wait(100)
      until uo.dead() or uo.GetX(Victim)<1 or LastTimer+100<UO.Timer()
      
         end if
               wait(200)
                    loot()
                    wait(200)
          if Numb(myX-lastX)<=3 and Numb(myY-lastY)<=3 then
         GotoXY(lastX,lastY)
                   end if
         end if
   if UO.Weight>=UO.Str*4 then
           wait(500)
          UO.Ignore('finditem')
           unload()
    end if
until uo.dead()
end sub

sub Numb(num)
if num>=0 then
return num
else
return num*(-1)
end if
end sub



Ходилка под это дело на всякий случай:
Code:
Sub WalkN(x,y,Target)
VAR i, StepSucess, dx, dy, Exit=0

    while Exit<>1

        ###---РАСЧЕТ ДВИЖЕНИЯ
        if Target<>"" then
            dx=UO.GetX(Target)-UO.GetX()
            dy=UO.GetY(Target)-UO.GetY()

            if UO.GetDistance(Target)<2 then
                Exit=1
            end if
        else
            dx=x-UO.GetX()
            dy=y-UO.GetY()
            if dx==0 AND dy==0 Then
                Exit=1
            end if
        end if

        if dx<>0 AND dy<>0 then
            if dx>0 AND dy>0 then
                StepSucess=Go(3,40,300)         # SE - DownArrow
                if StepSucess==-1 then
                    StepSucess=Go(7,38,300)     # WN - UpArrow
                    StepSucess=Go(1,39,300)     # NE - RightArrow
                    if StepSucess==-1 then
                        StepSucess=Go(5,37,300) # SW - LeftArrow
                    end if
                end if
            end if

            if dx>0 AND dy<0 then
                StepSucess=Go(1,39,300)         # NE - RightArrow
                if StepSucess==-1 then
                    StepSucess=Go(5,37,300)     # SW - LeftArrow
                    StepSucess=Go(3,40,300)     # SE - DownArrow
                    if StepSucess==-1 then
                        StepSucess=Go(7,38,300) # WN - UpArrow
                    end if
                end if
            end if

            if dx<0 AND dy>0 then
                StepSucess=Go(5,37,300)         # SW - LeftArrow
                if StepSucess==-1 then
                    StepSucess=Go(1,39,300)     # NE - RightArrow
                    StepSucess=Go(7,38,300)     # WN - UpArrow
                    if StepSucess==-1 then
                        StepSucess=Go(3,40,300) # SE - DownArrow
                    end if
                end if
            end if

            if dx<0 AND dy<0 then
                StepSucess=Go(7,38,300)         # WN - UpArrow
                if StepSucess==-1 then
                    StepSucess=Go(3,40,300)     # SE - DownArrow
                    StepSucess=Go(5,37,300)     # SW - LeftArrow
                    if StepSucess==-1 then
                        StepSucess=Go(1,39,300) # NE - RightArrow
                    end if
                end if
            end if
        end if

        if dx<>0 AND dy==0 then
            if dx>0 then
                StepSucess=Go(2,34,300)         # E - PgDown
                if StepSucess==-1 then
                    StepSucess=Go(3,40,300)     # SE - DownArrow
                    if StepSucess==-1 then
                        StepSucess=Go(1,39,300) # NE - RightArrow
                    end if
                    StepSucess=Go(2,34,300)     # E - PgDown
                end if
            end if

            if dx<0 then
                StepSucess=Go(6,36,300)         # W - Home
                if StepSucess==-1 then
                    StepSucess=Go(7,38,300)     # WN - UpArrow
                    if StepSucess==-1 then
                        StepSucess=Go(5,37,300) # SW - LeftArrow
                    end if
                    StepSucess=Go(6,36,300)     # W - Home
                end if
            end if
        end if


        if dx==0 AND dy<>0 then
            if dy>0 then
                StepSucess=Go(4,35,300)         # S - End
                if StepSucess==-1 then
                    StepSucess=Go(3,40,300)     # SE - DownArrow
                    if StepSucess==-1 then
                        StepSucess=Go(5,37,300) # SW - LeftArrow
                    end if
                    StepSucess=Go(4,35,300)     # S - End
                end if
            end if

            if dy<0 then
                StepSucess=Go(0,33,300)         # N - PgUp
                if StepSucess==-1 then
                    StepSucess=Go(1,39,300)     # NE - RightArrow
                    if StepSucess==-1 then
                        StepSucess=Go(7,38,300) # WN - UpArrow
                    end if
                    StepSucess=Go(0,33,300)     # N - PgUp
                end if
            end if
        end if

    wend

end sub

#################### ПОДПРОГРАММА ДЛЯ ХОДИЛКИ #########################

Sub Go(dir,key,walkwait)
VAR x,y, OldDir, w=30

    x=UO.GetX()
    y=UO.GetY()
    OldDir=UO.GetDir()
    if UO.GetDir()<>dir then
        UO.Press(key)
        wait(walkwait)
    end if

    UO.Press(key)
    wait(w)

    if x==UO.GetX() AND y==UO.GetY() AND OldDir<>UO.GetDir() then
        UO.Press(key)
        wait(w)
    end if

end sub

_________________
Image
Image


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

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 10 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:  
cron
Powered by phpBB® Forum Software © phpBB Limited