Yoko

All sides of Injection
It is currently 2025-10-25 18:52:04

All times are UTC+02:00




Post new topic  Reply to topic  [ 3 posts ] 
Author Message
PostPosted: 2006-07-26 19:44:51 
Offline

Joined: 2004-11-29 12:11:02
Posts: 28
Раскажу по порядку.

Чар ищет овцу в загоне, подходит снимает шерсть ( таргет от ножа на неё ) убивает, режет, лутит еше шерсть. И так по кругу. Если хп < 100 гвардс.

Все что нашел на форуме не подходит, даже после переделки.


Top
   
 Post subject:
PostPosted: 2006-07-26 21:42:40 
Offline
Expert!
User avatar

Joined: 2005-05-04 14:05:19
Posts: 2580
Location: Москва
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=0x00CF
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
         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

старый скрипт... под абис вроде и писал...
или нет под дрв вроде.
Запускать ясно вроде что;))


Top
   
 Post subject:
PostPosted: 2006-07-26 22:50:54 
Offline

Joined: 2004-11-29 12:11:02
Posts: 28
отлично ;) чуть переделали и всё работает


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

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 15 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