Переделаите скрипт плиз.

Anything and all.

Moderators: Murderator+, Murderator

Post Reply
Narick007
Posts: 11
Joined: 2007-04-30 13:05:27

Переделаите скрипт плиз.

Post by Narick007 »

sub WarTraining()
uo.setarm('current armor')
var x = uo.getX()
var y = uo.getY()
var time = uo.timer(), tx, ty
uo.addObject('opponent')
while uo.targeting()
wait(200)
wend
uo.addObject('bandages')
while uo.targeting()
wait(200)
wend
if uo.getX()-uo.getX('opponent') > 1 || uo.getX('opponent')-uo.getX() > 1 || uo.getY()-uo.getY('opponent') > 1 || uo.getY('opponent')-uo.getY() > 1 then
uo.print('Ïåðñîíàæè äîëæíû ñòîÿòü ðÿäîì!')
return
endif
if uo.getX() > uo.getX('opponent') then
tx = x+1
ty = y
else
if uo.getX('opponent') > uo.getX() then
tx = x-1
ty = y
else
if uo.getY() > uo.getY('opponent') then
tx = x
ty = y+1
else
if uo.getY('opponent') > uo.getY() then
tx = x
ty = y-1
else
uo.print('Âû äîëæíû áûòü íà ðàññòîÿíèè!!')
return
endif
endif
endif
endif
uo.warmode(true)
uo.attack('opponent')
repeat
if uo.getHP() < uo.getMaxHP()/2 then
Walk(tx,ty)
uo.warmode(false)
repeat
uo.waittargetobject('self')
uo.usetype(uo.getGraphic('bandages'))
wait(350)
until uo.getHP() == uo.getMaxHP()
uo.arm('current armor')
Walk(x,y)
uo.warmode(true)
uo.attack('opponent')
endif
if uo.getHP('opponent') < uo.getMaxHP('opponent')/2 then
Walk(tx,ty)
uo.warmode(false)
repeat
uo.waittargetobject('opponent')
uo.usetype(uo.getGraphic('bandages'))
wait(350)
until uo.getHP('opponent') == uo.getMaxHP('opponent')
uo.arm('current armor')
Walk(x,y)
uo.warmode(true)
uo.attack('opponent')
endif
if uo.timer() > time + 9000 then
time = uo.timer()
UO.UseType('0x097B','0x0000')
endif
wait(700)
until uo.dead()
end sub

sub Walk(x,y)
go:
while not uo.getX() == x || not uo.getY() == y
if not uo.getX() == x then
if uo.getX() > x then
uo.press(36)
else
uo.press(34)
endif
endif
if not uo.getY() == y && uo.getX() == x then
if uo.getY() > y then
uo.press(33)
else
uo.press(35)
endif
endif
checklag()
wend
checklag()
if not uo.getX() == x || not uo.getY() == y then
goto go
endif
end sub

sub CheckLag()
if uo.Waiting()>0 then
uo.Exec('canceltarget')
end if
uo.DeleteJournal()
uo.Click('backpack')
repeat
wait(50)
until uo.InJournal('backpack')
while uo.injournal('backpack')
uo.setJournalLine(uo.Injournal('backpack')-1,'is Empty!')
wend
end sub

Когда я запускаю скрипт,он пишит,что второи чар должен стоять ближе,тоесть в притык,но впритык на дрв стрелять нельзя,может ктонеть переделать скрипт?
mez
Posts: 91
Joined: 2006-04-02 11:33:38
Contact:

Re: Переделаите скрипт плиз.

Post by mez »

Narick007 wrote:sub WarTraining()
uo.setarm('current armor')
var x = uo.getX()
var y = uo.getY()
var time = uo.timer(), tx, ty
uo.addObject('opponent')
while uo.targeting()
wait(200)
wend
uo.addObject('bandages')
while uo.targeting()
wait(200)
wend
if uo.getX()-uo.getX('opponent') > 1 || uo.getX('opponent')-uo.getX() > 1 || uo.getY()-uo.getY('opponent') > 1 || uo.getY('opponent')-uo.getY() > 1 then
uo.print('Ïåðñîíàæè äîëæíû ñòîÿòü ðÿäîì!')
return
endif
if uo.getX() > uo.getX('opponent') then
tx = x+1
ty = y
else
if uo.getX('opponent') > uo.getX() then
tx = x-1
ty = y
else
if uo.getY() > uo.getY('opponent') then
tx = x
ty = y+1
else
if uo.getY('opponent') > uo.getY() then
tx = x
ty = y-1
else
uo.print('Âû äîëæíû áûòü íà ðàññòîÿíèè!!')
return
endif
endif
endif
endif
uo.warmode(true)
uo.attack('opponent')
repeat
if uo.getHP() < uo.getMaxHP()/2 then
Walk(tx,ty)
uo.warmode(false)
repeat
uo.waittargetobject('self')
uo.usetype(uo.getGraphic('bandages'))
wait(350)
until uo.getHP() == uo.getMaxHP()
uo.arm('current armor')
Walk(x,y)
uo.warmode(true)
uo.attack('opponent')
endif
if uo.getHP('opponent') < uo.getMaxHP('opponent')/2 then
Walk(tx,ty)
uo.warmode(false)
repeat
uo.waittargetobject('opponent')
uo.usetype(uo.getGraphic('bandages'))
wait(350)
until uo.getHP('opponent') == uo.getMaxHP('opponent')
uo.arm('current armor')
Walk(x,y)
uo.warmode(true)
uo.attack('opponent')
endif
if uo.timer() > time + 9000 then
time = uo.timer()
UO.UseType('0x097B','0x0000')
endif
wait(700)
until uo.dead()
end sub

sub Walk(x,y)
go:
while not uo.getX() == x || not uo.getY() == y
if not uo.getX() == x then
if uo.getX() > x then
uo.press(36)
else
uo.press(34)
endif
endif
if not uo.getY() == y && uo.getX() == x then
if uo.getY() > y then
uo.press(33)
else
uo.press(35)
endif
endif
checklag()
wend
checklag()
if not uo.getX() == x || not uo.getY() == y then
goto go
endif
end sub

sub CheckLag()
if uo.Waiting()>0 then
uo.Exec('canceltarget')
end if
uo.DeleteJournal()
uo.Click('backpack')
repeat
wait(50)
until uo.InJournal('backpack')
while uo.injournal('backpack')
uo.setJournalLine(uo.Injournal('backpack')-1,'is Empty!')
wend
end sub

Когда я запускаю скрипт,он пишит,что второи чар должен стоять ближе,тоесть в притык,но впритык на дрв стрелять нельзя,может ктонеть переделать скрипт?
могу предложить такой скрипт!

Code: Select all

sub main() 
VAR E, t, Enemy='0x002F8F28' , MinHP=70, G=true, L, Weap='0x402CC6AB' ; type of weapon 
UO.Attack(Enemy) 
UO.DeleteJournal() 
while G==true 
wait(500) 
if not UO.ObjAtLayer("Rhand") then 
UO.FindType(Weap,-1,'backpack') 
if UO.FindCount() then 
UO.Equip('Rhand','finditem') 
endif 
endif 
if UO.InJournal("stay") or UO.Life<MinHP then 
UO.Say("stay") 
t=UO.Timer() 
repeat 
E=true 
UO.Exec('warmode 0') 
wait(500) 
if UO.WarMode()==1 then 
E=false 
UO.Say("stay") 
t=UO.Timer() 
endif 
until E==true and UO.Timer()>=t+30 
CheckLag() 
UO.SetArm('myarm') 
while UO.Life<UO.Str 
L=UO.Life 
UO.Exec('warmode 0') 
DelJ("the") 
t=UO.Timer() 
UO.Exec('bandageself') 
repeat 
Wait(500) 
until UO.InJournal("You put") or UO.InJournal("barely help") or UO.InJournal("need healing") or UO.Life<L or UO.Timer()>t+100 
CheckLag() 
if UO.Life<L then 
UO.Say("stay") 
endif 
wend 
CheckBandage() 
UO.Arm('myarm') 
if not UO.InJournal("go") then 
UO.Say("go") 
repeat 
wait(50) 
until UO.InJournal("go") or UO.Life<UO.Str 
DelJ(UO.GetName()+": go") 
repeat 
wait(50) 
until UO.InJournal("go") or UO.Life<UO.Str 
else 
UO.Say("go") 
endif 
UO.DeleteJournal() 
UO.Attack(Enemy) 
endif 
if UO.Dead() then 
UO.Exec('warmode 1') 
endif 
wend 
end sub 

sub DelJ(s) 
VAR MN=UO.InJournal(s) 
while MN > 0 
UO.SetJournalLine(MN-1, '') 
MN=UO.InJournal(s) 
wend 
end sub 

sub CheckLag() 
DelJ("backpack") 
UO.Click('backpack') 
repeat 
wait(500) 
until UO.InJournal('backpack') 
end sub 

sub CheckBandage() 
VAR Banka='0x400268DB' ; ID of wash basin 
UO.waittargetobject(banka) 
UO.usetype(0x0e20)
Wait(1000)
Post Reply