Добавте плиз в этот скрипт, чтобы чар брал в руки новое оружие из пака если старое сломается. Буду очень благодарен
Code: sub sparing() var MaxHP=110 UO.unSetArm('CWeapon') UO.SetArm('CWeapon') ;uo.addobject('gost','0x001BA190') uo.exec('addobject gost') while uo.targeting() wait(100) wend
while 1 if uo.GetHP('self')< MaxHP then uo.WarMode(0) WalkN(3200,157,'') helings() endif if uo.life == uo.str and not uo.gety() == 1378 then UO.Arm('CWeapon') uo.WarMode(1) uo.attack('gost') WalkN(3200,155,'') wait(1000) uo.attack('gost') endif wait(300) wend end sub
sub helings() while uo.GetHP('self') < uo.GetMaxHP('self') UO.WaitTargetSelf() UO.UseType('0x0e21') wait(300) if UO.Count('0x0e20')>0 then wait(500) uo.waittargettype('0x1008') uo.usetype('0x0E20') UO.DeleteJournal() endif wait(4500) wend end sub
sub heling() while uo.GetHP('self') < uo.GetMaxHP('self') UO.WaitTargetSelf() UO.UseType('0x0e21') wait(300) if UO.Count('0x0e20')>0 then wait(500) uo.waittargettype('0x1008') uo.usetype('0x0E20') UO.DeleteJournal() endif wait(4500) wend UO.Arm('CWeapon') end sub
#============================================================== # WalkN(X,Y,Serial) - char is walking by dX and dY step # sub using Home, End, PgUp, PgDown keys # d'not rebind this key from default action! # serial - Serial of target or "" - string # walkwait - delay after keypress # Example: # WalkN(2080,2113,'') - go to coordinates # WalkN(0,0,'0x12345678') - go to target position #-------------------------------------------------------------- sub WalkN(x,y,Target) VAR i,StepSucess VAR dx,dy,Exit=0
While Exit<>1 If Target<>"" Then dx=UO.GetX(Target)-UO.GetX() dy=UO.GetY(Target)-UO.GetY() ; UO.Print("Target locked!") If UO.GetDistance(Target)<2 Then Exit=1 Endif Else dx=x-UO.GetX() dy=y-UO.GetY() If dx==0 AND dy==0 Then Exit=1 Endif
Endif
If dx<>0 AND dy<>0 Then If dx>0 AND dy>0 Then StepSucess=Go(3,40,300) ;SE - DownArrow If StepSucess==-1 Then StepSucess=Go(7,38,300) ;WN - UpArrow StepSucess=Go(1,39,300) ;NE - RightArrow If StepSucess==-1 Then StepSucess=Go(5,37,300) ;SW - LeftArrow Endif Endif Endif
If dx>0 AND dy<0 Then StepSucess=Go(1,39,300) ;NE - RightArrow If StepSucess==-1 Then StepSucess=Go(5,37,300) ;SW - LeftArrow StepSucess=Go(3,40,300) ;SE - DownArrow If StepSucess==-1 Then StepSucess=Go(7,38,300) ;WN - UpArrow Endif Endif Endif
If dx<0 AND dy>0 Then StepSucess=Go(5,37,300) ;SW - LeftArrow If StepSucess==-1 Then StepSucess=Go(1,39,300) ;NE - RightArrow StepSucess=Go(7,38,300) ;WN - UpArrow If StepSucess==-1 Then StepSucess=Go(3,40,300) ;SE - DownArrow Endif Endif Endif
If dx<0 AND dy<0 Then StepSucess=Go(7,38,300) ;WN - UpArrow If StepSucess==-1 Then StepSucess=Go(3,40,300) ;SE - DownArrow StepSucess=Go(5,37,300) ;SW - LeftArrow If StepSucess==-1 Then StepSucess=Go(1,39,300) ;NE - RightArrow Endif Endif Endif
Endif
If dx<>0 AND dy==0 Then If dx>0 Then StepSucess=Go(2,34,300) ;E - PgDown If StepSucess==-1 Then StepSucess=Go(3,40,300) ;SE - DownArrow If StepSucess==-1 Then StepSucess=Go(1,39,300) ;NE - RightArrow Endif StepSucess=Go(2,34,300) ;E - PgDown Endif Endif
If dx<0 Then StepSucess=Go(6,36,300) ;W - Home If StepSucess==-1 Then StepSucess=Go(7,38,300) ;WN - UpArrow If StepSucess==-1 Then StepSucess=Go(5,37,300) ;SW - LeftArrow Endif StepSucess=Go(6,36,300) ;W - Home Endif Endif Endif
If dx==0 AND dy<>0 Then If dy>0 Then StepSucess=Go(4,35,300) ;S - End If StepSucess==-1 Then StepSucess=Go(3,40,300) ;SE - DownArrow If StepSucess==-1 Then StepSucess=Go(5,37,300) ;SW - LeftArrow Endif StepSucess=Go(4,35,300) ;S - End Endif Endif
If dy<0 Then StepSucess=Go(0,33,300) ;N - PgUp If StepSucess==-1 Then StepSucess=Go(1,39,300) ;NE - RightArrow If StepSucess==-1 Then StepSucess=Go(7,38,300) ;WN - UpArrow Endif StepSucess=Go(0,33,300) ;N - PgUp Endif Endif Endif Wend end sub
sub Go(dir,key,walkwait) VAR x,y, OldDir
x=UO.GetX() y=UO.GetY() OldDir=UO.GetDir()
If UO.GetDir()<>dir Then UO.Press(key) wait(walkwait) If UO.GetDir()<>dir Then CheckLag() Endif Endif
UO.Press(key) wait(walkwait)
If x==UO.GetX() AND y==UO.GetY() Then CheckLag() Endif
If x==UO.GetX() AND y==UO.GetY() AND OldDir<>UO.GetDir() Then UO.Press(key) wait(walkwait) Endif
If x==UO.GetX() AND y==UO.GetY() Then CheckLag() Endif
If x==UO.GetX() AND y==UO.GetY() Then UO.Print("Zasada!") return -1 Else return 1 Endif end sub
#============================================================== # CheckLag() - click on backpack and awaiting "backpack" # message in journal. # # Journal has been deleted!!! #-------------------------------------------------------------- sub CheckLag() UO.DeleteJournal() UO.Click('backpack')
Repeat wait(500) Until UO.InJournal('backpack') end sub
|