Yoko
http://forum.yoko.com.ua/

Очень нужна Ваша помощь!
http://forum.yoko.com.ua/viewtopic.php?f=20&t=8414
Page 1 of 1

Author:  Skazi69 [ 2006-08-04 00:10:52 ]
Post subject:  Очень нужна Ваша помощь!

Имеется вот такой скрипт. Как сделать так, что бы он нападал на животных находящихся только на моей координате Z а то чар пытается напасть на моба который стоит на мосту и не достает его...
Заранее благодарен !

Code:
sub Abs(num) 
   if num < 0 then
      return -num
   end if
   return num
end sub

sub Sig(num)
if num < 0 then
   return -1
else
   if num == 0 then
      return 0
   endif
endif
return 1
end sub
       
sub MoveToXY(x, y, prec)
   var dx, dy
   dim Key[9]
      Key[0]=37
      Key[1]=35
      Key[2]=40
      Key[3]=36
      Key[4]=12
      Key[5]=34
      Key[6]=38
      Key[7]=33
      Key[8]=39
      dx=x-uo.GetX()
      dy=-y+uo.GetY()
   while (Abs(dx) > prec) or (Abs(dy) > prec)
      dx=x-uo.GetX()
      dy=-y+uo.GetY()
      uo.Press(Key[(sig(dy)+1)*3+1+sig(dx)])
      wait(10)
   wend
end sub   

sub MoveTo(object, prec)
   var dx, dy
   dim Key[9]
      Key[0]=37
      Key[1]=35
      Key[2]=40
      Key[3]=36
      Key[4]=12
      Key[5]=34
      Key[6]=38
      Key[7]=33
      Key[8]=39
   while uo.GetDistance(object) > prec
      dx=uo.GetX(object)-uo.GetX()
      dy=-uo.GetY(object)+uo.GetY()
      uo.Press(Key[(sig(dy)+1)*3+1+sig(dx)])
      wait(10)
   wend
end sub   

sub KillIt()
var animal=0x001a
var n=1
var x=uo.GetX()
var y=uo.GetY()
uo.ignorereset()
uo.forget('far')
uo.forget('counters')
uo.SetGlobal('KillCount', 0)

Repeat
   wait(10)
   uo.Set('finddistance', n)
   uo.FindType(animal, -1, 'ground')
   if uo.FindCount() then
      wait(100)
      if uo.IsNPC('finditem') then
         uo.info('finditem')
         while uo.IsNPC('finditem')
            if uo.GetDistance('finditem') > 1 then
               MoveTo('finditem', 1)
               uo.attack('finditem')
            end if
            wait(100)
         wend
         uo.SetGlobal('KillCount', val(uo.GetGlobal('KillCount'))+1)
         uo.forget('finditem')
         uo.warmode(0)
         uo.waittargetobject('lastcorpse')
         uo.usetype(0x0F51)
         while uo.waiting()
            wait(100)
         wend
         loot()
         uo.disarm()
         n=1
      else
         uo.Ignore('finditem')
      end if
   else
      n=n+1
      if n > 20 then
         if (uo.GetX() <> x) or (uo.GetY() <> y) then
            MoveToXY(x, y, 1)
         end if
         n=1
      end if
   end if
Until uo.Dead()
end sub

sub Stat()
   uo.charprint(257, 'Îò âàøèõ ðóê ïîãèáëî: '+uo.GetGlobal('KillCount')+' íåâèííûõ îâåö')
end sub

Author:  Skazi69 [ 2006-08-04 00:37:04 ]
Post subject: 

И еще. Как сюда встроить новую ходилку....?

Author:  Skazi69 [ 2006-08-05 14:46:17 ]
Post subject: 

помогите плиз!

Page 1 of 1 All times are UTC+02:00
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/