Yoko

All sides of Injection
It is currently 2026-01-16 11:53:52

All times are UTC+02:00




Post new topic  Reply to topic  [ 3 posts ] 
Author Message
 Post subject: All Kill DRW
PostPosted: 2010-03-24 01:21:49 
Offline

Joined: 2010-03-24 01:14:39
Posts: 2
Есть не большая проблемка со скриптом
Я запускаю персонажа в ньюби данж, там есть замечательная комната где обитает призрак у которого много хп и он не наносит урон. Запускаю скрипт , а именно функцию AllThemKill , чар подходит к призраку бьет его, после убийства, пишет что надо выбрать сумку, я выбираю сумку. Все вроде нормально, но как призрак опять ресается чар к нему не подходит и не бьет его, приходиться скрипт заново пере запускать.
У меня вопрос: Как сделать чтобы один раз запустил скрипт и персонаж постоянно бил призрака с каждым его ресом? Буду очень признателен.
Code:
sub KillThemAll() 
Var Victim=0x03CA
var CuttingTool=0x143E #Чем рЭзать (в данном случае - алебардой)
var n=6
var x=uo.GetX()
var y=uo.GetY()
;uo.print('001')
uo.ignorereset()
;uo.print('002')
;uo.forget('far')
;uo.print('003')
;uo.forget('counters')
;uo.print('004')
uo.SetGlobal('KillCount', 0)
;uo.print('005')

uo.Set('finddistance',str(n))

Repeat
wait(500)
uo.FindType(victim, -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')
wait(100)
uo.usetype(CuttingTool)
wait(100)
uo.useobject('lastcorpse')
wait(550)
uo.waittargetobject('lastcorpse')
uo.say(',emptycontainer 550')
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

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 ExtendedInfo()

var ObjectSerial
var ObjectGraphics
var ObjectIsNPC
var ObjectNotoriety

UO.Print('Select object to explore')
UO.AddObject('ObjectToExplore')
While UO.Targeting()==2
Wait(50)
WEnd

UO.Click('ObjectToExplore')
Wait(500)

UO.Print('Object name is: '+UO.GetName('ObjectToExplore'))

ObjectSerial = UO.GetSerial('ObjectToExplore')
UO.Print('Object serial is : '+ObjectSerial)
ObjectGraphics = UO.GetGraphic('ObjectToExplore')
UO.Print('Object type is : '+ObjectGraphics)
ObjectIsNPC = UO.IsNPC('ObjectToExplore')
UO.Print('Object IsNPC number is : '+str(ObjectIsNPC))
ObjectNotoriety = UO.GetNotoriety('ObjectToExplore')
UO.Print('Object notoriety is : '+str(ObjectNotoriety))

end sub


Top
   
 Post subject: Re: All Kill DRW
PostPosted: 2010-03-24 06:57:55 
Offline
User avatar

Joined: 2009-05-28 09:58:28
Posts: 2802
Location: Иваново
uo.waittargetobject('lastcorpse')
uo.say(',emptycontainer 550')
while uo.waiting()
wait(100)
wend


взаимозаменяемо. Оставь чтото одно. Лучше 1.

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


Top
   
 Post subject: Re: All Kill DRW
PostPosted: 2010-03-24 10:09:47 
Offline

Joined: 2010-03-24 01:14:39
Posts: 2
пре огромное спасибо! все заработало!


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 4 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