sub main() VAR KillElemental=0 ;Убивать элей, или нет VAR my, mx,i,j,p=1,time=UO.Time(),maxweight=600,n=1 DIM x[10],y[10] x[0]=5202 ;Координаты тайла рядом с ящиком y[0]=1117
;Парами х,у укажите координаты тайлов, стоя в которых чар будет копать вокруг себя x[1]=5211 y[1]=1119 uo.deletejournal() while (not uo.dead()) WalkN(x[p],y[p],'') if p==n then p=1 else p=p+1 endif mx = UO.GetX("self") my = UO.GetY("self") tohide() for i = mx-4 to mx+4 for j = my-4 to my+4 dig(i,j,KillElemental) if UO.Weight>=maxweight then WalkN(x[0],y[0],'') razgruzka() WalkN(x[p],y[p],'') endif UO.Print("Now Mining In: "+str(mx-i)+" "+str(my-j)) next next UO.FindType('0x0010',-1,'ground') if UO.FindCount()>0 then i = UO.GetX("self") j = UO.GetY("self") if KillElemental==1 Then KillElem() WalkN(i,j,'') else repeat wait(1000) until UO.IsNPC('finditem')==0 endif endif wend end sub
sub dig(i,j,KillElemental) var MMM,count,x,y
while (not uo.injournal("no ore")) and (not uo.injournal("in rock")) and (not uo.injournal ("That is too far")) tohide() UO.Waittargettile("1339", str(i), str(j),"0") UO.Usetype (0x0E85) uo.deletejournal() count=0 while (not uo.injournal("fail")) and (not uo.injournal("put")) and (not uo.injournal("elemental")) and (not uo.injournal("no ore")) and (not uo.injournal("in rock")) and (not uo.injournal ("That is too far")) and count<300 wait(100) count=count+1 wend if count<10 and uo.injournal("fail") then wait(9000) endif UO.FindType('0x0010',-1,'ground') if UO.InJournal('something with ore') OR UO.InJournal("attacking you") OR uo.findcount()>0 then x = UO.GetX("self") y = UO.GetY("self") if KillElemental==1 Then KillElem() WalkN(x,y,'') endif endif wend uo.deletejournal() end sub
sub razgruzka() VAR Container='0x4004AE8F'; Тут укажите ID своего ящика VAR Container2='0x4024B6BE';ID сумки внутри ящика UO.UseObject(Container) wait(1000) while uo.count('0x19B7')<>0 UO.FindType('0x19B7') UO.MoveItem('finditem','0',Container2) wait(600) wend while uo.count('0x19B8')<>0 UO.FindType('0x19B8') UO.MoveItem('finditem','0',Container2) wait(600) wend while uo.count('0x19B9')<>0 UO.FindType('0x19B9') UO.MoveItem('finditem','0',Container2) wait(600) wend while uo.count('0x19BA')<>0 UO.FindType('0x19BA') UO.MoveItem('finditem','0',Container2) wait(600) wend end sub
sub tohide() while not UO.Hidden() UO.Warmode("0") uo.print("Прячемся...") UO.UseSkill("Hiding") wait(4000) wend end sub
#=====================================thx to SavageV=========== # 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
#======================================thx to SavageV========== # 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() 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 Endif
If dx>0 AND dy<0 Then StepSucess=Go(1,39,300) ;NE - RightArrow Endif
If dx<0 AND dy>0 Then StepSucess=Go(5,37,300) ;SW - LeftArrow Endif
If dx<0 AND dy<0 Then StepSucess=Go(7,38,300) ;WN - UpArrow 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 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 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 Endif Endif
If dy<0 Then StepSucess=Go(0,33,300) ;N - PgUp If StepSucess==-1 Then StepSucess=Go(7,38,300) ;WN - UpArrow If StepSucess==-1 Then StepSucess=Go(1,39,300) ;NE - RightArrow Endif Endif Endif Endif Wend end sub
sub Go(dir,key,walkwait) VAR x,y
x=UO.GetX() y=UO.GetY()
while UO.GetDir()<>dir UO.Press(key) wait(walkwait) If UO.GetDir()<>dir Then CheckLag() Endif wend
UO.Press(key) wait(walkwait)
If x==UO.GetX() AND y==UO.GetY() Then CheckLag() Endif
If x==UO.GetX() AND y==UO.GetY() Then return -1 Else return 1 Endif end sub
sub killelem() VAR LastTimer, Elem UO.UseType('0x0F0E','0x0631') ; inviz potion While UO.STR<201 ; U'r not morfed char max Strength + 1 If UO.Mana>=50 then UO.WaitMenu('What','Daemon') UO.Cast('Polymorph') wait(8000) else UO.UseType('0x0F0E','0x09DF') ; total mana potion wait(3000) endif Wend LastTimer=UO.Timer() repeat UO.BandageSelf() wait(4000) until UO.Life==UO.STR UO.UseType(0x1B76) ; heater shield UO.UseType(0x1413) ; platemail gorget UO.DeleteJournal() UO.Exec('warmode 1') UO.FindType('0x0010',-1,'ground') Elem=UO.GetSerial('finditem') UO.Attack(Elem) repeat wait(1000) If UO.Life<50 Then UO.UseType('0x0F0E','0x09BB') ;GH Endif If UO.GetDistance(Elem)>1 Then WalkN(0,0,Elem) Endif until UO.IsNPC(Elem)==0 wait(3000) UO.findtype('0x19B9',-1,'ground') ; 3 ore UO.moveitem('finditem') wait(1000) UO.findtype('0x19B8',-1,'ground') ; 3 ore UO.moveitem('finditem') wait(1000) UO.findtype('0x19BA',-1,'ground') ; 3 ore UO.moveitem('finditem') wait(1000) UO.findtype('0x19B7',-1,'ground') ; 3 ore UO.moveitem('finditem') wait(1000) UO.findtype('0x0EED',-1,'ground') ; 3 ore UO.moveitem('finditem') wait(1000) UO.FindType('0x0010',-1,'ground') If UO.GetQuantity('finditem')>0 Then KillElem() Endif UO.Exec('warmode 0') wait(1000) UO.Print("Sdoh skotina!") LastTimer=UO.Timer() if UO.Life<180 then ; U'r max HP repeat UO.BandageSelf() wait(4000) until UO.Life>180 OR LastTimer+300<UO.Timer() endif UO.DeleteJournal() end sub