Yoko

All sides of Injection
It is currently 2025-10-16 17:57:34

All times are UTC+02:00




Post new topic  Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Чёт непойму...
PostPosted: 2007-11-27 16:07:28 
Offline
User avatar

Joined: 2006-12-07 14:48:38
Posts: 5
У меня проблемка, погогите, не могу разобраться...
У меня есть скрипт на атаку Лича, и я не могу тут кое чего понять.
Мой чар увидя Лича подходит к нему и атакует, но Лич от моего чара убегает, а чар заново к нему не подбегает, а Лич, в свою очередь, на меня всякую фигню кастить.
Можете помочь, вписать туда чтоб чар к нему подходил когда тот отходит? Пожалуйста, сильно надо...
Заранее благодарю, спасибо!
Code:
sub licheKill() 

    Var hrsT, hrsC
    hrsT = "0x0018" # тип зверька
    hrsC = "0x0000" # его цвет
    UO.Set('finddistance', '10')

repeat
Uo.DeleteJournal()
   UO.FindType(hrsT, hrsC, "ground")
       If UO.FindCount() > 0 Then
         UO.WarMode(1)
         walk(0,0,'finditem')
         wait(100)
         UO.Attack('finditem')
         repeat
         wait(100)
         until UO.InJournal('Body of Liche')
         uo.UseObject('lastcorpse')
   uo.WaitTargetObject('lastcorpse')
       Else
   looting()
   wait(50)
       End If
         UO.WarMode(0)
         UO.WaitTargetObject('lastcorpse')
         UO.UseSkill('Forensic Evaluation')
         wait(3500)
         UO.FindType(hrsT, hrsC, "ground")
until UO.dead()
end sub

Sub Walk(X,Y,Target)
var Targeting=''
var Result
var DX,DY,GLX,GLY
var DirW=0
var exit=0
while exit<>1
if Target<>'' then
Targeting=Target
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()
GLX=DX
GLY=DY
if DX==0 and DY==0 then
exit=1
end if
end if
if exit==0 then
if DX>0 and DY>0 then
DirW=9
end if
if DX>0 and DY<0 then
DirW=7
end if
if DX<0 and DY>0 then
DirW=3
end if
if DX<0 and DY<0 then
DirW=5
end if
if DX<>0 and DY==0 then
if DX>0 then
DirW=8
else
DirW=4
end if
end if
if DX==0 and DY<>0 then
if DY>0 then
DirW=2
else
DirW=6
end if
end if
Result=Go(DirW)
if Result==0 then
Result=Go(DirW-2)
if Result==0 then
Result=Go(DirW+2)
end if
end if
end if
wend
end sub

sub Go(dir)
var WalkWait=100
var Targeting=''
var X,Y,GLX,GLY
var check=1
var StartingDir=uo.GetDir()
X=uo.GetX()
Y=uo.GetY()
dim MoveKey[12]
MoveKey[0]=34
MoveKey[1]=40
MoveKey[2]=35
MoveKey[3]=37
MoveKey[4]=36
MoveKey[5]=38
MoveKey[6]=33
MoveKey[7]=39
MoveKey[8]=34
MoveKey[9]=40
MoveKey[10]=35
MoveKey[11]=37
dim StartDir[12]
StartDir[0]=2
StartDir[1]=3
StartDir[2]=4
StartDir[3]=5
StartDir[4]=6
StartDir[5]=7
StartDir[6]=0
StartDir[7]=1
StartDir[8]=2
StartDir[9]=3
StartDir[10]=4
StartDir[11]=5
while uo.GetDir()<>StartDir[dir]
uo.Press(MoveKey[dir])
wait(WalkWait)
if uo.GetDir()==StartingDir then
end if
if (Targeting<>'' and uo.GetDistance(Targeting)<2) or (GLX==0 and GLY==0) then
return 1
end if
wend
uo.Press(MoveKey[dir])
wait(WalkWait)
if X==uo.GetX() and Y==uo.GetY() then
uo.Press(MoveKey[dir])
wait(WalkWait)
wait(100)
end if
if X==uo.GetX() and Y==uo.GetY() then
return 0
else
return 1
end if
end sub

Sub looting()
dim Loot[28]
var i
Loot[0]=0x0F16 ; Ametist
Loot[1]=0x0F20 ; Tourmaline
Loot[2]=0x0F26 ; Diamond
Loot[3]=0x0F30 ; Diamond
Loot[4]=0x0EED ; GP
Loot[5]=0x0F0F ; Star saphire
Loot[6]=0x0F2C
Loot[7]=0x0F28
Loot[8]=0x0F11
Loot[9]=0x0F2A
Loot[10]=0x0F1E
Loot[11]=0x0F22
Loot[12]=0x0F2D
Loot[13]=0x0F30
Loot[14]=0x0F2E
Loot[15]=0x0F2F
Loot[16]=0x0F15
Loot[17]=0x0F17
Loot[18]=0x0EED
Loot[19]=0x0F29
Loot[20]=0x0F1A
Loot[21]=0x0F24
Loot[22]=0x0E76
Loot[23]=0x0F1F
Loot[24]=0x0F2B
Loot[25]=0x0F25
Loot[26]=0x0F23
Loot[27]=0x0F13
for i = 0 to 27
      UO.FindType(Loot[i],'-1', 'lastcorpse')
     if UO.FindCount() > 0 then
      UO.MoveItem('finditem', '-1')
      wait(1000)
   else
   wait(100)
     endif
next
Uo.DeleteJournal()
end sub


Top
   
 Post subject:
PostPosted: 2007-11-27 16:15:43 
Offline

Joined: 2005-04-19 18:00:29
Posts: 2259
Location: Московская область
Code:
sub licheKill() 

    Var hrsT, hrsC
    hrsT = "0x0018" # тип зверька
    hrsC = "0x0000" # его цвет
    UO.Set('finddistance', '10')

repeat
       Uo.DeleteJournal()
       UO.FindType(hrsT, hrsC, "ground")
       If UO.FindCount() > 0 Then
         UO.WarMode(1)
         walk(0,0,'finditem')
         wait(100)
         UO.Attack('finditem')
         repeat
           wait(100)
           if uo.GetDistance('finditem') > 1 then
             walk(0,0,'finditem')     
             wait(150)
           end if   
         until UO.InJournal('Body of Liche')
         uo.UseObject('lastcorpse')
         uo.WaitTargetObject('lastcorpse')
       Else
         looting()
         wait(50)
       End If
       UO.WarMode(0)
       UO.WaitTargetObject('lastcorpse')
       UO.UseSkill('Forensic Evaluation')
       wait(3500)
       UO.FindType(hrsT, hrsC, "ground")
until UO.dead()
end sub

Sub Walk(X,Y,Target)
var Targeting=''
var Result
var DX,DY,GLX,GLY
var DirW=0
var exit=0
while exit<>1
if Target<>'' then
Targeting=Target
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()
GLX=DX
GLY=DY
if DX==0 and DY==0 then
exit=1
end if
end if
if exit==0 then
if DX>0 and DY>0 then
DirW=9
end if
if DX>0 and DY<0 then
DirW=7
end if
if DX<0 and DY>0 then
DirW=3
end if
if DX<0 and DY<0 then
DirW=5
end if
if DX<>0 and DY==0 then
if DX>0 then
DirW=8
else
DirW=4
end if
end if
if DX==0 and DY<>0 then
if DY>0 then
DirW=2
else
DirW=6
end if
end if
Result=Go(DirW)
if Result==0 then
Result=Go(DirW-2)
if Result==0 then
Result=Go(DirW+2)
end if
end if
end if
wend
end sub

sub Go(dir)
var WalkWait=100
var Targeting=''
var X,Y,GLX,GLY
var check=1
var StartingDir=uo.GetDir()
X=uo.GetX()
Y=uo.GetY()
dim MoveKey[12]
MoveKey[0]=34
MoveKey[1]=40
MoveKey[2]=35
MoveKey[3]=37
MoveKey[4]=36
MoveKey[5]=38
MoveKey[6]=33
MoveKey[7]=39
MoveKey[8]=34
MoveKey[9]=40
MoveKey[10]=35
MoveKey[11]=37
dim StartDir[12]
StartDir[0]=2
StartDir[1]=3
StartDir[2]=4
StartDir[3]=5
StartDir[4]=6
StartDir[5]=7
StartDir[6]=0
StartDir[7]=1
StartDir[8]=2
StartDir[9]=3
StartDir[10]=4
StartDir[11]=5
while uo.GetDir()<>StartDir[dir]
uo.Press(MoveKey[dir])
wait(WalkWait)
if uo.GetDir()==StartingDir then
end if
if (Targeting<>'' and uo.GetDistance(Targeting)<2) or (GLX==0 and GLY==0) then
return 1
end if
wend
uo.Press(MoveKey[dir])
wait(WalkWait)
if X==uo.GetX() and Y==uo.GetY() then
uo.Press(MoveKey[dir])
wait(WalkWait)
wait(100)
end if
if X==uo.GetX() and Y==uo.GetY() then
return 0
else
return 1
end if
end sub

Sub looting()
dim Loot[28]
var i
Loot[0]=0x0F16 ; Ametist
Loot[1]=0x0F20 ; Tourmaline
Loot[2]=0x0F26 ; Diamond
Loot[3]=0x0F30 ; Diamond
Loot[4]=0x0EED ; GP
Loot[5]=0x0F0F ; Star saphire
Loot[6]=0x0F2C
Loot[7]=0x0F28
Loot[8]=0x0F11
Loot[9]=0x0F2A
Loot[10]=0x0F1E
Loot[11]=0x0F22
Loot[12]=0x0F2D
Loot[13]=0x0F30
Loot[14]=0x0F2E
Loot[15]=0x0F2F
Loot[16]=0x0F15
Loot[17]=0x0F17
Loot[18]=0x0EED
Loot[19]=0x0F29
Loot[20]=0x0F1A
Loot[21]=0x0F24
Loot[22]=0x0E76
Loot[23]=0x0F1F
Loot[24]=0x0F2B
Loot[25]=0x0F25
Loot[26]=0x0F23
Loot[27]=0x0F13
for i = 0 to 27
      UO.FindType(Loot[i],'-1', 'lastcorpse')
     if UO.FindCount() > 0 then
      UO.MoveItem('finditem', '-1')
      wait(1000)
   else
   wait(100)
     endif
next
Uo.DeleteJournal()
end sub


Top
   
 Post subject:
PostPosted: 2007-11-27 16:26:50 
Offline
User avatar

Joined: 2006-12-07 14:48:38
Posts: 5
Cпасибо огромное!


Top
   
 Post subject:
PostPosted: 2009-08-10 09:02:38 
Offline

Joined: 2009-03-22 00:58:28
Posts: 14
попробовал
этот скрипт и чёто чар даже не атачит лича (((( :(


Top
   
 Post subject:
PostPosted: 2009-08-10 11:10:58 
Offline

Joined: 2009-08-09 13:58:00
Posts: 8
PaDonak DRW wrote:
попробовал
этот скрипт и чёто чар даже не атачит лича (((( :(

Ты наверное ничего не указал


Top
   
 Post subject:
PostPosted: 2009-08-10 11:29:10 
Offline
User avatar

Joined: 2009-05-28 09:58:28
Posts: 2802
Location: Иваново
сори но я бы не советовал использовать
Code:
         UO.Attack('finditem')
         repeat
           wait(100)
         until UO.InJournal('Body of Liche')


Пример:
стоят 2 лича. Один рядом второй на границе зоны видимости за забором скажем. Ты начинаешь бить первого и цикл ждет сообщения в журнале. В этот момент какойнибудь левый чар убивает второго лича и ты видишь сообщение - цикл проскакивает и чар пытается открыть не существующий труп. Тебя роняет твой лич.
Лучше добавить проверку по координате цели.

_________________
Image
YokoInjection CodeSweeper
Ошибка "Unhandled exception in parser"
Стрелялка для олдов.


Top
   
 Post subject:
PostPosted: 2009-08-10 11:32:30 
Offline

Joined: 2009-08-10 10:28:42
Posts: 34
я тоже попробовал этот скрипт и также чар не подходит к личу и не атакует его ! (а чё там водить то тип лича и его цвет и так правильные стоят ) может подскажете что я не так сделал . ?


Top
   
 Post subject:
PostPosted: 2009-08-10 12:13:13 
Offline
Expert!
User avatar

Joined: 2006-02-07 08:51:40
Posts: 1348
Location: г. Старый Оскол
HeBbIHocuM wrote:
я тоже попробовал этот скрипт и также чар не подходит к личу и не атакует его ! (а чё там водить то тип лича и его цвет и так правильные стоят ) может подскажете что я не так сделал . ?

Track World Items в закладке Main, стоит галочка?


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

All times are UTC+02:00


Who is online

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