| Yoko http://forum.yoko.com.ua/ |
|
| Спецы проверьте плз макро на Мининг http://forum.yoko.com.ua/viewtopic.php?f=20&t=212 |
Page 1 of 1 |
| Author: | MASSAM [ 2004-04-28 09:02:20 ] |
| Post subject: | Спецы проверьте плз макро на Мининг |
Не работает ((((((( Ошибок не выдает, но не работает: sub main() var i=1, z=0 DIM x[51] DIM y[51] DIM tilen[51] x[1]=1937 y[1]=321 tilen[1]=1342 x[2]=1937 #SS y[2]=320 tilen[2]=1343 x[3]=1937 #SS y[3]=319 tilen[3]=1339 x[4]=1937 #SS y[4]=318 tilen[4]=1342 x[5]=1937 #SS y[5]=317 tilen[5]=1339 x[6]=1937 #SS y[6]=316 tilen[6]=1340 x[7]=1937 #SS y[7]=315 tilen[7]=1342 x[8]=1936 #SS y[8]=315 tilen[8]=1342 x[9]=1935 #SS y[9]=315 tilen[9]=1342 x[10]=1934 #SS y[10]=315 tilen[10]=1343 x[11]=1933 #SS y[11]=315 tilen[11]=1339 x[12]=1932 #SS y[12]=315 tilen[12]=1339 x[13]=1931 #SS y[13]=315 tilen[13]=1343 x[14]=1931 #SS y[14]=316 tilen[14]=1342 x[15]=1931 #SS y[15]=317 tilen[15]=1339 x[16]=1931 #SS y[16]=318 tilen[16]=1343 x[17]=1931 #SS y[17]=319 tilen[17]=1341 x[18]=1931 #SS y[18]=320 tilen[18]=1342 x[19]=1931 #SS y[19]=321 tilen[19]=1343 x[20]=1932 #SS y[20]=321 tilen[20]=1339 x[21]=1933 #SS y[21]=321 tilen[21]=1341 x[22]=1934 #SS y[22]=321 tilen[22]=1343 x[23]=1935 #SS y[23]=321 tilen[23]=1342 x[24]=1936 #SS y[24]=321 tilen[24]=1343 x[25]=1936 #SS y[25]=320 tilen[25]=1339 x[26]=1936 #SS y[26]=319 tilen[26]=1341 x[27]=1936 #SS y[27]=318 tilen[27]=1342 x[28]=1936 #SS y[28]=317 tilen[28]=1343 x[29]=1936 #SS y[29]=316 tilen[29]=1339 x[30]=1935 #SS y[30]=316 tilen[30]=1340 x[31]=1934 #SS y[31]=316 tilen[31]=1343 x[32]=1933 #SS y[32]=316 tilen[32]=1340 x[33]=1932 #SS y[33]=316 tilen[33]=1343 x[34]=1932 #SS y[34]=317 tilen[34]=1340 x[35]=1932 #SS y[35]=318 tilen[35]=1339 x[36]=1932 #SS y[36]=319 tilen[36]=1340 x[37]=1932 #SS y[37]=320 tilen[37]=1343 x[38]=1933 #SS y[38]=320 tilen[38]=1342 x[39]=1934 #SS y[39]=320 tilen[39]=1341 x[40]=1935 #SS y[40]=320 tilen[40]=1339 x[41]=1935 #SS y[41]=319 tilen[41]=1343 x[42]=1935 #SS y[42]=318 tilen[42]=1340 x[43]=1935 #SS y[43]=317 tilen[43]=1339 x[44]=1934 #SS y[44]=317 tilen[44]=1340 x[45]=1933 #SS y[45]=317 tilen[45]=1341 x[46]=1933 #SS y[46]=318 tilen[46]=1342 x[47]=1933 #SS y[47]=319 tilen[47]=1339 x[48]=1934 #SS y[48]=319 tilen[48]=1341 x[49]=1934 #SS y[49]=318 tilen[49]=1341 while not UO.Dead() uo.waittargettile(tilen[i],x[i],y[i],z) UO.Exec("usetype 0x0E85"); wait(1000); if UO.Life<150 then UO.Exec("bandageself"); endif if UO.InJournal("There is no ore here to mine.") then UO.DeleteJournal(); i=i+1; endif if i>49 then i=1; endif wend end sub |
|
| Author: | Psimorph [ 2004-04-28 22:12:26 ] |
| Post subject: | Re: Спецы проверьте плз макро на Мининг |
А зачем вот это UO.Exec("usetype 0x0E85"); ? Не проще UO.UseType('') ??? |
|
| Author: | Psimorph [ 2004-04-28 22:15:37 ] |
| Post subject: | Re: Спецы проверьте плз макро на Мининг |
И по мойму, лучше вставить проверку на UO.InJournal Тоесть repeat основной скрипт until UO.InJournal('всё вырыто уже тут') if UO.InJournal('всё вырыто уже тут') then i=i+1 endif так не проще? |
|
| Author: | Smoke [ 2004-04-29 14:05:26 ] |
| Post subject: | Re: Спецы проверьте плз макро на Мининг |
Psimorph wrote: И по мойму, лучше вставить проверку на UO.InJournal
Тоесть repeat основной скрипт until UO.InJournal('всё вырыто уже тут') if UO.InJournal('всё вырыто уже тут') then i=i+1 endif так не проще? ################MINIG#################################### ;--------------------------- Flags ---------------------------- ; 0-Actions flag. If =1 ResidentACT paused script and run self ; 1-Elemental flag ; 2-World save flag ; 99-Pause main script flag ;-------------------------------------------------------------- sub ResidentMSG() VAR i UO.DeleteJournal() ;------------------ Clear global var ------------------------- for i=0 to 2 UO.SetEasyUO(i,"0") next ;-------------------- Check situations ----------------------- while 1==1 If UO.InJournal("OOPS") then UO.SetJournalLine(UO.InJournal("OOPS")-1,"Fixed") UO.SetEasyUO(1,"1") UO.SetEasyUO(0,"1") endif If UO.InJournal("Elemental is attacking you") AND UO.GetEasyUO(0)=="0" then UO.SetJournalLine(UO.InJournal("Elemental is attacking you")-1,"Fixed") UO.SetEasyUO(1,"1") UO.SetEasyUO(0,"1") endif If UO.InJournal("World save") then UO.SetJournalLine(UO.InJournal("World save")-1,"Fixed") UO.SetEasyUO(2,"1") UO.SetEasyUO(0,"1") endif wait(250) wend end sub ;-------------------- Action for situation -------------------- sub ResidentACT() UO.SetEasyUO(99,"0") while 1==1 if UO.GetEasyUO(0)=="1" then UO.SetEasyUO(99,"1") ;Pause main script if UO.GetEasyUO(1)=="1" then KillElem() UO.SetEasyUO(1,"0") endif if UO.GetEasyUO(2)=="1" then UO.Click('self') repeat wait(500) until UO.InJournal("Dirath: Dirath") UO.SetEasyUO(2,"0") endif UO.SetEasyUO(0,"0") UO.SetEasyUO(99,"0") endif wait(250) wend end sub ;------------- Pause main script while situations ------------- sub CheckPause() if UO.GetEasyUO(99)=="1" then repeat wait(100) until UO.GetEasyUO(99)=="0" endif end sub ;==================== Main mining script ====================== sub mine() VAR i,TileY,TileX,DirX,DirY UO.Exec('exec alarm') ; alarm when char lose HP UO.Exec('exec ResidentMSG') ; check messages UO.Exec('exec ResidentACT') ; action on messages While NOT UO.Dead() UO.DeleteJournal() DirX=1 DirY=1 For TileY=1 to 7 For TileX=1 to 16 ToHide() CheckPause() digit() walk(1*DirX,0) next ToHide() CheckPause() digit() DirX=-1*DirX walk(0,1*DirY) next ToHide() CheckPause() digit() DirY=-1*DirY unloadore() walk(5645-UO.GetX(),1050-UO.GetY()) wend end sub ;-------------------- Try to mine under self ------------------ sub digit() VAR Last=0,LastTimer VAR MaxWeight=650 if UO.Weight>=MaxWeight then unloadore() endif repeat CheckLag() ; deleting journal UO.WaitTargetSelf() UO.UseType('0x0E85') LastTimer=UO.Timer() repeat wait(100) until UO.InJournal("You put") OR UO.InJournal("You loosen") OR UO.InJournal("There is no") OR UO.InJournal("That is too") OR UO.InJournal("OOPS") OR UO.InJournal("attacking you") OR LastTimer+150<UO.Timer() wait(1000) CheckPause() if UO.InJournal('You loosen') then repeat wait(100) until UO.InJournal("You put") OR LastTimer+105<UO.Timer() endif until UO.InJournal("There is no") OR UO.InJournal("That is too") wait(1000) CheckPause() end sub ;------------------------- Unload ore ------------------------- sub unloadore() VAR TempX,TempY,i,Exit DIM Ore[5] TempX=UO.GetX() TempY=UO.GetY() CheckPause() walk(5646-TempX,1057-TempY) CheckPause() ToHide() CheckPause() Ore[0]=0x19B9 ; 4 and more ore Ore[1]=0x19B7 ; 1 ore Ore[2]=0x19BA ; 2 ore Ore[3]=0x19B8 ; 3 ore UO.SetReceivingContainer('0x400BF86D') ; storecontainer wait(500) For i=0 to 3 Exit=0 repeat UO.FindType(Ore[i]) CheckLag() if UO.GetQuantity('finditem')>0 then UO.Grab('0','finditem') CheckLag() wait(1500) Else Exit=1 endif until Exit==1 Next UO.UnSetReceivingContainer() walk(TempX-5446,TempY-1057) CheckPause() ToHide() CheckPause() end sub ;----------- Morf in Daemon, kill elem and loot him ----------- sub killelem() VAR Count, LastTimer UO.UseType('0x0F0E','0x0631') ; inviz potion repeat If UO.Mana>=50 then UO.WaitMenu('What','Daemon') UO.Cast('Polymorph') wait(8000) else while UO.Mana<50 UO.UseType('0x0F0E','0x09DF') ; total mana potion wait(3000) wend endif until UO.STR>200 ; U'r not morfed char max Strength LastTimer=UO.Timer() repeat UO.BandageSelf() wait(4000) until UO.Life==UO.STR OR LastTimer+170<UO.Timer() UO.UseType(0x1B76) ; heater shield UO.UseType(0x1413) ; platemail gorget UO.DeleteJournal() UO.WarMode(1) UO.UseSkill('Meditation') ; reveal self ; "Corpse autoopen" in "main" need be checked repeat wait(5000) until UO.InJournal('Body') OR UO.InJournal('You can') If UO.InJournal('You can') then UO.WaitTargetGround('0x19B9') ; 4 and more ore wait(1500) UO.Grab('all') UO.WaitTargetGround('0x0EED') ; gold coins wait(500) UO.Grab('all') Else UO.WaitTargetObject('lastcorpse') UO.UseType('0x0F51') ; dagger wait(500) UO.FindType('0x19B9',-1,'lastcorpse') ; ore wait(500) UO.Grab(0,'finditem') UO.FindType('0x0EED',-1,'lastcorpse') ; coins wait(500) UO.Grab(0,'finditem') UO.FindType('0x1BF5',-1,'lastcorpse') ; ings wait(500) UO.Grab(0,'finditem') UO.FindType('0x0E76',-1,'lastcorpse') ; bag wait(500) UO.Grab(0,'finditem') endif UO.WarMode('flip') wait(1000) UO.WarMode(0) wait(1000) LastTimer=UO.Timer() if UO.Life<170 then ; U'r max HP repeat UO.BandageSelf() wait(4000) until UO.Life>170 OR LastTimer+170<UO.Timer() endif ToHide() end sub sub tohide() while NOT UO.Hidden() UO.DeleteJournal() if UO.Life<170 then UO.UseType('0x0F0E','0x0631') ; inviz potion wait(2000) else UO.UseSkill('Hiding') repeat wait(50) until UO.InJournal('You have hidden') OR UO.InJournal('seem to hide') OR UO.InJournal('preoccupied') endif UO.WarMode('flip') wait(100) UO.Warmode(0) wend end sub sub CheckLag() UO.DeleteJournal() UO.Click('backpack') repeat wait(50) until UO.InJournal('backpack') end sub sub gong(times) ; play wav-file VAR i for i=1 to times UO.Exec("playwav c:\game\uo\cow") wait(1200) ; time to play sample at once next end sub sub alarm() while 1==1 wait(1000) if UO.Life<170 then gong(1) endif wend end sub sub walk(dx,dy) VAR i, walkwait=300 If dx<>0 then If dx>0 then If UO.GetDir()<>2 then UO.Press(34) wait(walkwait) CheckPause() Endif For i=1 to dx UO.Press(34) wait(walkwait) CheckPause() next Else If UO.GetDir()<>6 then UO.Press(36) wait(walkwait) CheckPause() Endif For i=1 to dx*-1 UO.Press(36) wait(walkwait) CheckPause() next Endif endif If dy<>0 then If dy>0 then If UO.GetDir()<>4 then UO.Press(35) wait(walkwait) CheckPause() Endif For i=1 to dy UO.Press(35) wait(walkwait) CheckPause() next Else If UO.GetDir()<>0 then UO.Press(33) wait(walkwait) CheckPause() Endif For i=1 to dy*-1 UO.Press(33) wait(walkwait) CheckPause() next Endif endif wait(1000) end sub этот лучше |
|
| Author: | Psimorph [ 2004-04-29 20:52:27 ] |
| Post subject: | Re: Спецы проверьте плз макро на Мининг |
Копирайты можно оставлять............ =0 |
|
| Page 1 of 1 | All times are UTC+02:00 |
| Powered by phpBB® Forum Software © phpBB Limited https://www.phpbb.com/ |
|