Чёт непойму...

Ask for scripts here

Moderators: Murderator+, Murderator

Post Reply
<'((><
Posts: 5
Joined: 2006-12-07 14:48:38
Contact:

Чёт непойму...

Post by <'((>< »

У меня проблемка, погогите, не могу разобраться...
У меня есть скрипт на атаку Лича, и я не могу тут кое чего понять.
Мой чар увидя Лича подходит к нему и атакует, но Лич от моего чара убегает, а чар заново к нему не подбегает, а Лич, в свою очередь, на меня всякую фигню кастить.
Можете помочь, вписать туда чтоб чар к нему подходил когда тот отходит? Пожалуйста, сильно надо...
Заранее благодарю, спасибо!

Code: Select all

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 
Scripts Writer
Posts: 2259
Joined: 2005-04-19 18:00:29
Location: Московская область
Contact:

Post by Scripts Writer »

Code: Select all

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
<'((><
Posts: 5
Joined: 2006-12-07 14:48:38
Contact:

Post by <'((>< »

Cпасибо огромное!
PaDonak DRW
Posts: 14
Joined: 2009-03-22 00:58:28

Post by PaDonak DRW »

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

Post by -=Join=- »

PaDonak DRW wrote:попробовал
этот скрипт и чёто чар даже не атачит лича (((( :(
Ты наверное ничего не указал
Mirage
Posts: 2802
Joined: 2009-05-28 09:58:28
Location: Иваново
Contact:

Post by Mirage »

сори но я бы не советовал использовать

Code: Select all

         UO.Attack('finditem')
         repeat
           wait(100)
         until UO.InJournal('Body of Liche') 
Пример:
стоят 2 лича. Один рядом второй на границе зоны видимости за забором скажем. Ты начинаешь бить первого и цикл ждет сообщения в журнале. В этот момент какойнибудь левый чар убивает второго лича и ты видишь сообщение - цикл проскакивает и чар пытается открыть не существующий труп. Тебя роняет твой лич.
Лучше добавить проверку по координате цели.
HeBbIHocuM
Posts: 34
Joined: 2009-08-10 10:28:42
Contact:

Post by HeBbIHocuM »

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

Post by Kynep »

HeBbIHocuM wrote:я тоже попробовал этот скрипт и также чар не подходит к личу и не атакует его ! (а чё там водить то тип лича и его цвет и так правильные стоят ) может подскажете что я не так сделал . ?
Track World Items в закладке Main, стоит галочка?
Post Reply