Играл я как то на ЛоДе, вот скрипт для рубки леса и сброса логов в сейф :
Code: sub start() RecLes() UO.Exec('exec Lumber') end sub
sub Lumber() var i=0,j=0,k=0,r=0,q=0,ii,jj var TopX=324,TopY=65 dim TreeX[500], TreeY[500],TreeT[500] dim TreeTile[200] var flag=0,treeCount=0,clicks=0,flag2=0 var f=file("C:\trees.dat") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; var Area=1 ## ?????? ?????????????? ??????????, ????? ?????? ?? 1 ?? 4. var TryHiding=1 ## 1 - ????? ??? ??? ?????? ??????, ????? ???????? ???? ? ????, 0 - ?? ????? var TryRecall=1 ## 1 - ????? ???? ??? ??????? LogsQty ?????, ????? ???????? ?????????? ?????, # ?????????? ???? ?? ??? ? ?????????? ??????? (????? ??????? ??? ????), 0 - ?? ?????.
var LogsQty=1000 ## ?????????? ?????, ????? ??????? ???? ?????????? ?????.
var RecallFromScroll=0 ## 1 - ????? ?? ???????, 0 - ?? ?????????
var GetFromFile=1 ## 1 - ?????????? ???????? ????? ?????????? ?? ?????, 0 - ????????? ?? ??????? ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
#??????? ???????? TreeTile[0]=3283 TreeTile[1]=3277 TreeTile[2]=3293 TreeTile[3]=3296 TreeTile[4]=3302 TreeTile[5]=3299 TreeTile[6]=3290 TreeTile[7]=3288 TreeTile[8]=3286 TreeTile[9]=3280
uo.exec("filterspeech on") uo.exec("filterspeech add 'Where do you want to use the pickaxe?'") UO.Exec('exec Check') UO.Exec('exec Reconnector')
if TryRecall==1 then
if RecallFromScroll==1 then uo.print('?????? ?????? Recall:' ) uo.exec('addobject RecallScroll') wait(5000) end if end if
#????????? ?????????? ?? ????? if GetFromFile==1 then uo.print('Loading...') f.open() TreeCount=safe call f.readNumber() for i=1 to TreeCount TreeT[i]=safe call f.ReadNumber() TreeX[i]=safe call f.ReadNumber() TreeY[i]=safe call f.ReadNumber() next f.close() else #???????? ?????????? ?? ??????? uo.print('Pickaxe: ') uo.exec('addobject Pickaxe') while uo.targeting() wait(100) wend
uo.print('Searching trees...') for q=1 to Area if q==2 then ;gotoxy(uo.getx()+20,uo.gety()-10) end if if q==3 then ;gotoxy(uo.getx(),uo.gety()+20) end if if q==4 then ;gotoxy(uo.getx()-20,uo.gety()) end if for r=0 to 3 if r==1 then ;gotoxy(uo.getx()+10,uo.gety()) end if if r==2 then ;gotoxy(uo.getx(),uo.gety()+10) end if if r==3 then ;gotoxy(uo.getx()-10,uo.gety()) end if for j=0 to 8 for i=0 to 8 clicks=0 flag=0 uo.DeleteJournal() #??????? ?? ???? uo.useobject('Pickaxe') waitForTarget() uo.DeleteJournal() WaitForTryRock() #????????? ?????? ?? ??? flag=0 for k=0 to 9 if uo.LastTile(0)==TreeTile[k]+1 then flag=2 end if next if flag==0 then for k=0 to 9 if uo.LastTile(0)==TreeTile[k] then flag=1 end if next end if #???????? ?? ????? if flag==1 then flag2=0 if treeCount>0 then for ii=1 to treeCount if treeX[ii]==uo.lastTile(1) AND treeY[ii]==uo.lastTile(2) then flag2=1 end if next end if if flag2==0 then treeCount=treeCount+1 TreeX[treeCount]=uo.LastTile(1) treeY[treeCount]=uo.lastTile(2) TreeT[treeCount]=uo.LastTile(0) uo.print('??????? ??????: x='+str(uo.lasttile(1))+' y='+str(uo.lastTile(2))) wait(500) uo.print('Faund trees have nomber: '+str(treeCount)) end if end if #???????? ?? ?????? if flag==2 then flag2=0 if treeCount>0 then for ii=1 to treeCount if treeX[ii]==uo.lastTile(1) AND treeY[ii]==uo.lastTile(2) then flag2=1 end if next end if if flag2==0 then treeCount=treeCount+1 TreeX[treeCount]=uo.LastTile(1) treeY[treeCount]=uo.LastTile(2) TreeT[treeCount]=uo.LastTile(0)-1 uo.print('Find trees: x='+str(uo.lasttile(1))+' y='+str(uo.lastTile(2))) end if end if next next next next uo.exec("filterspeech off") uo.print('Analize is end, zapisanno v C:\trees.dat') SaveToFile(treeCount,TreeX,TreeY,TreeT) end if uo.print('Trees fainded: '+str(treeCount)) wait(2000) #????? ?? ????????? ??????????? while 1==1 if treeCount>0 then for i=1 to treeCount if TryRecall==1 AND uo.Count('ZLK')>=LogsQty then ToRecall(RecallFromScroll) end if uo.print('goto tree '+str(i)+': x='+str(treex[i])+' y='+str(treey[i])) flag=gotoxy(treex[i],treey[i]) if flag==1 then if TryHiding==1 then ToHide() end if GetTree(str(treeT[i]),str(treeX[i]),str(TreeY[i]),str(uo.getz())) end if next end if wend end sub
sub GetTree(type,x,y,z) var i uo.print('Starting lamber...') for i=0 to 15 if uo.warmode()==1 then return 0 end if wait(200) uo.deletejournal() uo.waittargettile(type,x,y,z) uo.UseType('0x0F4B') ## Type ?????? Infologs() if WaitForChange()==1 then return 1 end if next return 0 end sub
sub ToRecall(FromScroll) RecallToHome(FromScroll) wait(500) repeat wait(500) repeat wait(500) repeat wait(500) repeat wait(600) UO.SetReceivingContainer('0x416A2AA5') ## ID ?????????? ??? ?????? uo.findtype('ZLK') wait(1000) UO.Grab('all','finditem') wait(1000) until uo.GetQuantity('finditem')==0 T1() UO.UnSetReceivingContainer() takereg() RecallToLumber(FromScroll) end sub
sub RecallToHome(FromScroll) var i uo.print('Recall to home...') for i=1 to 10 uo.deletejournal() uo.waittargetobject('0x4169EB4A') ## ID Runki domoi if FromScroll==0 then uo.cast('Recall') else uo.useobject('RecallScroll') end if if WaitForRecall()==1 then return 1 end if next return 0 end sub
sub RecallToLumber(FromScroll) var i uo.print('Recall to les...') for i=1 to 10 uo.deletejournal() uo.waittargetobject('0x4169EB4C') ## Id runki v les uo.cast('Recall') if waitForRecall()==1 then return 1 end if next return 0 end sub
sub ToHide() var i uo.print('V haid...') for i=1 to 15 uo.deletejournal() uo.useskill('Stealth') if WaitForHide()==1 then return 1 end if next return 0 end sub
sub WaitForRecall() var Text1=uo.getname()+": The spell fizzles." var mess='',lastX=uo.getX(),lastY=uo.getY() for var i=0 to 200 mess=uo.journal(0) if uo.Journal(0)==Text1 then return 0 end if if uo.getX()<>lastX OR uo.getY()<>LastY then return 1 end if wait(50) next return 0 end sub
sub WaitForHide() var Text1=uo.getname()+": You have hidden yourself well" var Text2=uo.getname()+": You can't seem to hide here." var mess for var i=0 to 200 mess=uo.journal(0) if uo.Journal(0)==Text1 then return 1 end if if uo.Journal(0)==Text2 then return 0 end if wait(50) next return 0 end sub
sub WaitForChange() var Text1=uo.getname()+': You hack at the tree for a while, but fail to produce any useable wood' var Text2='There is nothing here to chop.' var Text3="You can't reach this." var mess for var i=0 to 200 mess=uo.journal(0) if uo.Journal(0)==Text2 OR uo.Journal(0)==Text3 then return 1 end if if uo.Journal(0)==Text1 then return 0 end if if mess[0]=='Y' AND mess[1]=='o' AND mess[2]=='u' AND mess[4]=='p' AND mess[5]=='u' AND mess[6]=='t' then return 0 end if wait(50) next return 0 end sub
sub WaitForTryRock() var Text1="That is too far away." var Text2="You can't use the %s where it is." var Text3="Try mining elsewhere." var Text4="You have no line of sight to that location" var Text5="You can't see the target" for var i=0 to 50 if uo.Journal(0)==Text1 OR uo.Journal(0)==Text2 OR uo.Journal(0)==Text3 OR uo.Journal(0)==Text4 OR uo.Journal(0)==Text5 then return 1 end if wait(200) next return 0 end sub
sub WaitForTarget() for var i=0 to 50 if uo.Targeting()==1 then return 1 end if wait(200) next return 0 end sub
sub WaitForChangeXY(myX,myY,lastX,lastY) for var i=1 to 50 if lastX<>myX OR lastY<>myY then return 1 end if wait(200) next return 0 end sub
sub gotoXY(x,y) var myX,myY,lastX=0,lastY=0,i,halt=0,z,r=0 for i=1 to 60 MyX=uo.getX(); MyY=uo.getY(); if LastX==MyX AND LastY==MyY then halt=halt+1 else halt=0 end if if halt>=10 then if uo.GetDir()==1 then for z=0 to 8 uo.press(40) next end if if uo.GetDir()==3 then for z=0 to 8 uo.press(37) next end if if uo.GetDir()==5 then for z=0 to 8 uo.press( 38 ) next end if if uo.GetDir()==7 then for z=0 to 8 uo.press(39) next end if halt=15 end if if abs(x-myX)<=1 AND abs(y-myY)<=2 then return 1 end if if x<=MyX then if y<=MyY then for z=0 to 3 uo.press( 38 ) next else for z=0 to 3 uo.press(37) next end if else if y<=MyY then for z=0 to 3 uo.press(39) next else for z=0 to 3 uo.press(40) next end if end if lastX=myX lastY=myY wait(200) next return 0 end sub
sub abs(num) if num>=0 then return num else return num*(-1) end if end sub
sub SaveToFile(TreeCount,TreeX,TreeY,TreeT) var f=file("C:\trees.dat") var s=0,i=0 f.open() f.create() s=safe call f.writeln(TreeCount) for i=1 to TreeCount s=safe call f.writeln(str(TreeT[i])+' '+str(treeX[i])+' '+str(TreeY[i])) next f.close() end sub
sub Reconnector() var ReconnectTime, RFlag ReconnectTime = '0' RFlag = 1 Repeat While (UO.ObjAtLayer('Bpack') == '') if RFlag Then ReconnectTime = MakeTime() RFlag = 0 endif Wait(20000) # WorldSave Protection UO.Say('') Wait(3000) UO.Say('') Wait(3000) UO.Say('') Wait(3000) UO.LDblClick(357,164) UO.LClick(616,459) Wait(3000) WEnd Wait(3000) if (RFlag == 0) and (ReconnectTime <> '0') Then UO.TextOpen() UO.TextPrint('Disconnected & Reconnected @ '+ReconnectTime) RFlag = 1 ReconnectTime = '0' endif Until false end sub
sub MakeTime() VAR D, T, Ret, i Ret = STR(UO.Time()) T = "" For i = 0 To Len(Ret) T = Ret[Len(Ret)-i] + T If (I == 2) OR (I == 4) Then T = ":" + T EndIf Next Ret = STR(UO.Date()) D = "" For i = 0 To Len(Ret) D = Ret[Len(Ret)-i] + D If (I == 2) OR (I == 4) Then D = "." + D EndIf Next Ret = T + " @ " + D RETURN Ret end sub
sub time() var hh,mm,ss,hms,t=str(UO.Time()) if len(t)<=2 then hh="0" mm="0" ss=t endif if len(t)==3 then hh="0" mm=left(t,len(t)-2) ss=right(t,len(t)-1) endif if len(t)==4 then hh="0" mm=left(t,len(t)-2) ss=right(t,len(t)-2) endif if len(t)==5 then hh=left(t,len(t)-4) hms=left(t,len(t)-2) mm=right(hms,len(hms)-1) ss=right(t,len(t)-3) endif if len(t)==6 then hh=left(t,len(t)-4) hms=left(t,len(t)-2) mm=right(hms,len(hms)-2) ss=right(t,len(t)-4) endif return hh+":"+mm+":"+ss end sub
sub pwavw(); ???? ??? ?????? UO.DeleteJournal() REPEAT uo.playwav("E:\UO\inject\SOUND\by.wav") WAIT(3500) UNTIL UO.InJournal('all stop') endsub
sub Check() var Time Time = Time() while not UO.dead() wait(1000) wend UO.Exec("exec pwavw") uo.textopen() UO.TextPrint('You are dead in: '+Time) end sub
sub T1() var Time Time = Time() uo.textopen() UO.TextPrint('Unload to container: '+Time) end sub
sub Infologs() UO.Print('You have '+Str(UO.Count('0x1BDD'))+' logov v symke:') UO.Print('there is '+Str(UO.Count('0x1BDD','0x0000'))+' standart and ' +str(uo.count('0x1BDD')-uo.count('0x1BDD','0x0000'))+' colored.') end sub
sub takereg() lockunlock() var regcount = '0x416A2AA5' ## ID conteinera s regami DIM reg[3] var i,n reg[1]='0x0F86' ; MR reg[2]='0x0F7A' ; BP reg[3]='0x0F7B' ; BM
UO.UseObject(regcount) for i=1 to 3 while UO.Count(reg[i])<5 UO.FindType(reg[i],-1,regcount) n=UO.Count(reg[i]) UO.Grab(str(5-n),'finditem') wait(1000) wend next lockunlock() end sub
sub RecLes() ; uo.print('Recall to les...') var mx, my reccal: uo.deletejournal() if uo.waiting() then uo.canceltarget() endif mx = UO.GetX("self") my = UO.GetY("self") UO.DeleteJournal() uo.waittargetobject('0x4169EB4C') ## id runki v les wait(500) uo.cast('Recall') wait(6000) if not UO.GetX("self") <> mx and not UO.GetY("self") <> my then goto reccal endif wait(2000) end sub
sub lockunlock() Var seif = '0x416A2AA5' Var kluch = '0x416D08BD' UO.WaitTargetObject( seif ) UO.UseObject( kluch ) wait(1000) end sub
sub terminate() UO.Print("ALL OFF") UO.DeleteJournal() uo.exec("terminate all") end sub
|