Не идет на заданные координаты в файле
Тип записи координат:
1. *****,*****
2. *****,*****
3. *****,*****
4. *****,*****
5. *****,*****
Code: Var Pickaxe=0x0E85 Var Ore=0x19B9 Var Ingot=0x1BF2 Var Iron=0x0000 Var MoveDelay=150 Var MoveNumber=1 Var Ep=0.172 # Var FileName='C:\mining\skala.dat' Sub Main() #UO.SetGlobal('process','no') repeat if UO.GetGlobal('process')=='no' then UO.DeleteJournal() UO.Exec('exec Lumb') endIf Wait(3000) #until (1==0) EndSub
Sub Lumb() Var Tl,T,X,Y,Z,srl var wei UO.SetGlobal('process','yes') Var F=File(FileName) F.Open() Beg: DeleteJournal('no mine') Tl=safecall F.Readln() Tl=Trim(Tl) If Tl=='File read error' Then GoTo Ext EndIf T=GetNumb(Tl,0) X=GetNumb(Tl,1) Y=GetNumb(Tl,2) Z=GetNumb(Tl,3) UO.Print('next mine') UO.Print('Tile '+Tl) GoToTile(X,Y,1,False) Repeat uo.DeleteJournal() UO.WaitTargetTile(Str(T),Str(X),Str(Y),Str(Z)) While uo.Waiting() Emil() If UO.Dead() Then Ress() UO.WarMode( 0 ) GoToTile(X,Y,1,false) UO.WaitTargetTile(Str(T),Str(X),Str(Y),Str(Z)) Emil() endif WEND repeat Wait(1000) If UO.Dead() Then Ress() UO.WarMode( 0 ) GoToTile(X,Y,1,False) UO.WaitTargetTile(Str(T),Str(X),Str(Y),Str(Z)) Emil() endif #if uo.count(Ore)>170 then wei = ( UO.Str * 4 ) - 25 if UO.Weight > wei then GoToTile(1714,1194,0,False) Exist() GoToTile(1714,1194,0,False) GoToTile(X,Y,1,False) UO.WaitTargetTile(Str(T),Str(X),Str(Y),Str(Z)) UO.UseObject(UO.ObjAtLayer('Rhand')) endif Until UO.InJournal("There is no ore here to mine.") or UO.InJournal("There is no ore here to mine") or UO.InJournal('You need a pickaxe') or UO.InJournal('That is too far away') Until UO.InJournal("There is no ore here to mine.") or UO.InJournal("There is no ore here to mine") or UO.InJournal('You need a pickaxe') or UO.InJournal('That is too far away') If UO.InJournal("There is no ore here to mine.") or UO.InJournal("There is no ore here to mine") or UO.InJournal('That is too far away') then Trash() Goto Beg EndIf If UO.InJournal('You need a pickaxe') or UO.InJournal('You need a pickaxe to mine') then GoToTile(1711,1194,0,False) Uo.usefromground(0x0E43) wait(2000) repeat UO.FindType(Pickaxe,"0x0000","lastcontainer") UO.MoveItem("finditem", "1") Until UO.Count(Pickaxe) > 0 Goto Beg EndIf Ext: F.Close() UO.SetGlobal('process','no') EndSub sub Exist() Trash() #############Iron If UO.Count(0x19B9, 0x0000) > 0 Then ProDrop(0x19B9, 0x0000) EndIF ############Rasty If UO.Count(0x19B9, 0x0750) > 0 Then ProDrop(0x19B9, 0x0750) EndIF ############Bronze If UO.Count(0x19B9, 0x06D6) > 0 Then ProDrop(0x19B9, 0x06D6) EndIF ############Old Copper If UO.Count(0x19B9, 0x0590) > 0 Then ProDrop(0x19B9, 0x0590) EndIF ############Dull Copper If UO.Count(0x19B9, 0x060A) > 0 Then ProDrop(0x19B9, 0x060A) EndIF ############Copper If UO.Count(0x19B9, 0x0641) > 0 Then ProDrop(0x19B9, 0x0641) EndIF ############Rose If UO.Count(0x19B9, 0x0665) > 0 Then ProDrop(0x19B9, 0x0665) EndIF ############Pirit If UO.Count(0x19B9, 0x09EE) > 0 Then ProDrop(0x19B9, 0x09EE) EndIF ############Silver If UO.Count(0x19B9, 0x0482) > 0 Then ProDrop(0x19B9, 0x0482) EndIF ############Gold If UO.Count(0x19B9, 0x04AA) > 0 Then ProDrop(0x19B9, 0x04AA) EndIF ############Shadow If UO.Count(0x19B9, 0x0770) > 0 Then ProDrop(0x19B9, 0x0770) EndIF ############Verit If UO.Count(0x19B9, 0x07D1) > 0 Then ProDrop(0x19B9, 0x07D1) EndIF ############Agapit If UO.Count(0x19B9, 0x0400) > 0 Then ProDrop(0x19B9, 0x0400) EndIF ############Blood If UO.Count(0x19B9, 0x04C2) > 0 Then ProDrop(0x19B9, 0x04C2) EndIF ############Azurit If UO.Count(0x19B9, 0x04DF) > 0 Then ProDrop(0x19B9, 0x04DF) EndIF ############Mithril ore If UO.Count(0x19B9, 0x052D) > 0 Then ProDrop(0x19B9, 0x052D) EndIF ############Valorite ore If UO.Count(0x19B9, 0x0515) > 0 Then ProDrop(0x19B9, 0x0515) EndIF ############Winter ore If UO.Count(0x19B9, 0x0481) > 0 Then ProDrop(0x19B9, 0x0481) EndIF ############Black Rock Ore If UO.Count(0x19B9,0x0455) > 0 Then ProDrop(0x19B9,0x0455) EndIF ############Ambers If UO.Count(0x0F25,0x0000) > 0 Then ProDrop(0x0F25,0x0000) EndIF end sub
sub ProDrop(T,C) UO.FindType(T,C,'backpack') Var b = UO.GetSerial("finditem") UO.FindType(T,C,'ground') Var g = UO.GetSerial("finditem") UO.MoveItem(b, "0", g,str(uo.getx(g)),str(uo.gety(g)),"0") Wait(500) If Uo.Count(T,C) > 0 Then Clear(T,C) endIF end sub
sub ProDrop2(T,C) UO.FindType(T,C,'backpack') If C < 0 Then C = UO.GetColor('finditem') endif Var b = UO.GetSerial('finditem') UO.FindType(T,C,'ground') Var g = UO.GetSerial('finditem') UO.MoveItem(b, '0', g,str(uo.getx(g)),str(uo.gety(g)),'0') Wait(500) If Uo.Count(T,C) > 0 Then Clear(T,C) endIF end sub
Sub GetNumb(C,I) var J,T,K J=0 K=1 While K>0 J=J+1 If (Mid(C,J,1)==' ') Or (J>=Len(C)-1) Then If I==0 Then T=Val(Left(C,J)) Else T=GetNumb(Right(C,Len(C)-J-1),I-1) EndIf K=0 EndIf wend UO.Print(T) return T endsub
Sub Perp(Dir) Var D D=Dir If Dir==1 Then D=3 EndIf If Dir==2 Then D=4 EndIf If Dir==3 Then D=-1 EndIf If Dir==4 Then D=-2 EndIf If Dir==-1 Then D=-3 EndIf If Dir==-2 Then D=-4 EndIf If Dir==-3 Then D=1 EndIf If Dir==-4 Then D=2 EndIf RETURN D EndSub
Sub MoveOnce(Dir,Del,Rev) Var Num If Rev Then Num=MoveNumber+1 Else Num=MoveNumber EndIf If (Num>0) and (Dir<>0) Then If Dir==1 Then UO.Press(38,Num,Del) EndIf If Dir==2 Then UO.Press(33,Num,Del) EndIf If Dir==3 Then UO.Press(39,Num,Del) EndIf If Dir==4 Then UO.Press(34,Num,Del) EndIf If Dir==-1 Then UO.Press(40,Num-1,Del) EndIf If Dir==-2 Then UO.Press(35,Num,Del) EndIf If Dir==-3 Then UO.Press(37,Num,Del) EndIf If Dir==-4 Then UO.Press(36,Num,Del) EndIf If Rev Then If Dir<>-1 Then UO.Press(40,1,Del) EndIf EndIf EndIf EndSub
Sub GetQDir(x,y) Var J=0 If X==0 Then J=1 Else If (Y/X)<ep Then J=3 Else If (X/Y)<ep Then J=1 Else J=2 EndIf EndIf EndIf RETURN J EndSub
sub GetDir(myx,myy,ox,oy) Var I,J J=0 Var X=ox-myx Var Y=oy-myy I=GetQDir(Abs(X),Abs(Y)) If X>=0 Then If Y>=0 Then If I==1 Then J=-2 Else If I==2 Then J=-1 Else If I==3 Then J=4 EndIf EndIf EndIf Else If I==1 Then J=2 Else If I==2 Then J=3 Else If I==3 Then J=4 EndIf EndIf EndIf EndIf Else If Y>=0 Then If I==1 Then J=-2 Else If I==2 Then J=-3 Else If I==3 Then J=-4 EndIf EndIf EndIf Else If I==1 Then J=2 Else If I==2 Then J=1 Else If I==3 Then J=-4 EndIf EndIf EndIf EndIf EndIf RETURN J endsub
sub abs(a) Var b If a<0 Then b=-a Else b=a endif return b endsub
Sub PermResend() Var Mn=4 Repeat # UO.Resend() Wait(MoveDelay*Mn) Until (1>2) EndSub
sub max(A,B) Var C If A>B Then C=A Else C=B EndIf Return C EndSub
sub GetDistance(X,Y) return max(abs(X-uo.getx()),abs(Y-uo.gety())) endsub
sub GoToTile(OX,OY,N,S) var myx, myy, MD, J var Lx1 ,Ly1 var Lx2 ,Ly2 var Sx ,Sy var T var Des=N J=1 MD=MoveDelay*1.5 myx=uo.getx() myy=uo.gety() MoveOnce(GetDir(uo.getx(),uo.gety(),ox,oy),MD,False) Sx=0 Sy=0 Lx1=uo.getx()/2 Ly1=uo.gety()/2 Lx2=Lx1/2 Ly2=Ly1/2 T=UO.Timer() If (GetDistance(ox,oy)<>N) or ((not S) and GetDistance(ox,oy)>N) Then UO.Exec('exec PermResend') EndIf While ((GetDistance(ox,oy)<>N) or ((not S) and GetDistance(ox,oy)>N)) and (OX>=0) and (OY>=0) If ((UO.Timer()-T)*15>MoveDelay) Then T=UO.Timer() # UO.Print(Str(uo.getx())+' '+Str(uo.gety())+' '+Str(ox)+' '+Str(oy)+' '+Str(GetDir(uo.getx(),uo.gety(),ox,oy))+' '+Str(T)) Lx2=Lx1 Ly2=Ly1 Lx1=myx Ly1=myy myx=uo.getx() myy=uo.gety() endIf MD=MoveDelay If ((OX-uo.getx())*(OX-uo.getx())+(OY-uo.gety())*(OY-uo.gety())>0) Then MD=MD*3/GetDistance(ox,oy) EndIf wait(MD) If GetDistance(OX,OY)>Des Then MoveOnce(GetDir(uo.GetX(),uo.GetY(),ox,oy),MD,False) Else If S Then If GetDistance(OX,OY)<Des Then If GetDistance(OX,OY)<>0 Then MoveOnce(GetDir(ox,oy,uo.GetX(),uo.GetY()),MD,False) Else MoveOnce(GetDir(uo.GetX(),uo.GetY(),Lx2,Ly2),MD,False) EndIf EndIf EndIf EndIf If GetDistance(OX,OY)<>Des Then If (Lx2==uo.getx()) and (Ly2==uo.gety()) Then If (Sx<>uo.getx()) or (Sy<>uo.gety()) Then J=1 EndIf J=J+1 UO.Resend() Sx = uo.getx() Sy = uo.gety() Stun(ox,oy,J) EndIf EndIf Wend UO.Exec('terminate PermResend') endsub
Sub Stun(X,Y,N) Var I Var myx Var myy myx = uo.getx() myy = uo.gety() For I=1 to N MoveOnce(perp(GetDir(myx,myy,x,y)),MoveDelay,False) Next Wait(MoveDelay) UO.Resend() If (myx==uo.getx()) and (myy==uo.gety()) Then For I=1 to N MoveOnce(-perp(GetDir(myx,myy,x,y)),MoveDelay,False) Next Wait(MoveDelay) UO.Resend() EndIf If (myx==uo.getx()) and (myy==uo.gety()) Then For I=1 to N MoveOnce(-GetDir(myx,myy,x,y),MoveDelay,False) Next Wait(MoveDelay) Stun(x,y,N) EndIf EndSub
Sub DeleteJournal(What) Var T,J J=False If UO.InJournal(What) Then J=True UO.DeleteJournal() EndIf RETURN J EndSub
sub Plav() UO.Set('finddistance','2') UO.FindType(0x0FB1,-1,'ground') If UO.FindCount() <> 0 Then repeat UO.FindType(0x19B9) IF UO.FindCount() > 0 Then If UO.GetColor('finditem') == '0x0455' Then Uo.ignore(0x19B9, 0x0455) return else if UO.GetColor('finditem') == '0x052D' Then Uo.ignore(0x19B9, 0x052D) return else if UO.GetColor('finditem') == '0x0515' Then Uo.ignore(0x19B9, 0x0515) return else if UO.GetColor('finditem') == '0x0481' Then Uo.ignore(0x19B9, 0x0481) return else UO.UseObject('finditem') wait(1200) end If end if end if end if EndIf until UO.FindCount() == 0 UO.Print("-=-= END =-=-") else UO.Print("Forge not found") endIf end sub
sub count() UO.Print(str(UO.Count(ore))) end sub
Sub BS() #0x1B7B - Metal shield #0x13BF - chainmail tunic #0x1415 - ____ while true UO.FindType(0x1415, -1,'ground') wait(2000) If UO.FindCount() > 0 Then uo.waittargetobject('finditem') Uo.UseType(0x0FBB) wait(5000) endif WEND end sub
sub Emil() IF (UO.GetGraphic(UO.ObjAtLayer("Rhand"))) <> '0x0E85' Then If UO.Count('0x0E85') > 0 Then UO.UseType('0x0E85') endif else UO.UseObject(UO.ObjAtLayer('Rhand')) EndIf wait(2000) end sub
sub Clear(T,C) Var Count = UO.Count(T,C) UO.FindType(T,C,'backpack') Var b = UO.GetSerial("finditem") UO.FindType(T,C,'ground') Var g = UO.GetSerial("finditem") Wait(500) UO.MoveItem(b, "0", g,str(uo.getx(g)),str(uo.gety(g)),"0") Wait(500) If UO.Count(T,C) == Count Then If (UO.Count('finditem')+Count) < 60000 Then uo.ignore('finditem') ProDrop(T,C) endIf endIf end sub
sub Ress() wait(1000) While UO.Dead() wait(3000) UO.WarMode( 1 ) WEND end sub sub Count() #UO.Print('Iron : '+Str(UO.Count(0x19B9, 0x0000))) #UO.Print('-=-=-=-=-=-=-=-') #UO.Print('Bronze : '+Str(UO.Count(0x19B9, 0x0488))) #UO.Print('Rasty : '+Str(UO.Count(0x19B9, 0x0750))) #UO.Print('-=-=-=-=-=-=-=-') #wait(4000) #UO.Print('-=-=-=-=-=-=-=-') #UO.Print('Old Copper : '+Str(UO.Count(0x19B9, 0x0949))) #UO.Print('Dull Copper : '+Str(UO.Count(0x19B9, 0x060A))) #UO.Print('Copper : '+Str(UO.Count(0x19B9, 0x0641))) #UO.Print('-=-=-=-=-=-=-=-') #wait(4000) #UO.Print('-=-=-=-=-=-=-=-') #UO.Print('Pirit : '+Str(UO.Count(0x19B9, 0x09EE))) #UO.Print('Silver : '+Str(UO.Count(0x19B9, 0x0482))) #UO.Print('Shadow : '+Str(UO.Count(0x19B9, 0x0770))) #UO.Print('Gold : '+Str(UO.Count(0x19B9, 0x04AA))) #UO.Print('-=-=-=-=-=-=-=-') #wait(4000) #UO.Print('-=-=-=-=-=-=-=-') #UO.Print('Verit : '+Str(UO.Count(0x19B9, 0x0947))) #UO.Print('Agapit : '+Str(UO.Count(0x19B9, 0x0400))) #UO.Print('Blood : '+Str(UO.Count(0x19B9, 0x04C2))) #UO.Print('Azurit : '+Str(UO.Count(0x19B9, 0x04DF))) #UO.Print('-=-=-=-=-=-=-=-') Wait(4000) #UO.Print('-=-=-=-=-=-=-=-') #UO.Print('Mithril : '+Str(UO.Count(0x19B9, 0x052D))) #UO.Print('Valorite : '+Str(UO.Count(0x19B9, 0x0515))) #UO.Print('Winter : '+Str(UO.Count(0x19B9, 0x0481))) #UO.Print('-=-=-=-=-=-=-=-') #UO.Print('BlackRock : '+Str(UO.Count(0x19B9, 0x0455))) #UO.Print('-=-=-=-=-=-=-=-') end sub sub play() Var Co = 0 While true If UO.Life < UO.Str then If Co < 10 then uo.playwav("D:\cap000.wav") wait(1500) Co = Co + 1 else wait(60000) Co = 0 endif end if wait(1000) wend
sub Trash() ############Rasty If UO.Count(0x19B9, 0x0750) > 0 Then UO.FindType(0x19B9, 0x0750,'backpack') UO.MoveItem("finditem", "0", 0x4672A745) wait(150) EndIF ############Bronze If UO.Count(0x19B9, 0x06D6) > 0 Then UO.FindType(0x19B9, 0x06D6,'backpack') UO.MoveItem("finditem", "0", 0x4672A745) wait(150) EndIF ############Old Copper If UO.Count(0x19B9, 0x0590) > 0 Then UO.FindType(0x19B9, 0x0590,'backpack') UO.MoveItem("finditem", "0", 0x4672A745) wait(150) EndIF ############Dull Copper If UO.Count(0x19B9, 0x060A) > 0 Then UO.FindType(0x19B9, 0x060A,'backpack') UO.MoveItem("finditem", "0", 0x4672A745) wait(150) EndIF ############Copper If UO.Count(0x19B9, 0x0641) > 0 Then UO.FindType(0x19B9, 0x0641,'backpack') UO.MoveItem("finditem", "0", 0x4672A745) wait(150) EndIF ############Pirit If UO.Count(0x19B9, 0x09EE) > 0 Then UO.FindType(0x19B9, 0x09EE,'backpack') UO.MoveItem("finditem", "0", 0x4672A745) wait(150) EndIF ############Silver If UO.Count(0x19B9, 0x0482) > 0 Then UO.FindType(0x19B9, 0x0482,'backpack') UO.MoveItem("finditem", "0", 0x4672A745) wait(150) EndIF ############Shadow If UO.Count(0x19B9, 0x0770) > 0 Then UO.FindType(0x19B9, 0x0770,'backpack') UO.MoveItem("finditem", "0", 0x4672A745) wait(150) EndIF ############Ambers If UO.Count(0x0F25, 0x0000) > 0 Then UO.FindType(0x0F25, 0x0000,'backpack') UO.MoveItem("finditem", "0", 0x4672A745) wait(150) EndIF ############Gold If UO.Count(0x19B9, 0x04AA) > 0 Then UO.FindType(0x19B9, 0x04AA,'backpack') UO.MoveItem("finditem", "0", 0x4672A745) wait(150) EndIF end sub
|