Вот старый скрипт, и его давно использую, главное правильно настроить:
Code: ############################################################### #===---====----===---===---= Mining =---=-=-=-=-=--=-=-=-=-=-=# ############################################################### ;--------------------------- 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("You 111see") AND UO.GetEasyUO(0)=="0" then UO.SetJournalLine(UO.InJournal("You see")-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 unloadore() UO.SetEasyUO(1,"0") endif if UO.GetEasyUO(2)=="1" then UO.Click('self') repeat wait(500) until UO.InJournal(":") 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() UO.SetEasyUO(99,"0") 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,g,j g=8 ; кол - во рун DIM rune[8] ; кол-во рун UO.Exec('exec alarm') ; alarm when char lose HP UO.Exec('exec ResidentMSG') ; check messages UO.Exec('exec ResidentACT') ; action on messages
rune[0]=0x406C58FA ; rune dungeon 1 rune[1]=0x406C5A2B ; rune dungeon 2 rune[2]=0x406C5A2C rune[3]=0x406C5B6C rune[4]=0x406C5B6B rune[5]=0x406C5A2A rune[6]=0x406C5A2E rune[7]=0x4106A6CD
While NOT UO.Dead() For j=0 to (g-1) UO.DeleteJournal() DirX=1 DirY=1
For TileY=1 to 3 For TileX=1 to 5 ToHide() CheckPause() attack() digit() walk(1*DirX,0) next ToHide() CheckPause() digit() DirX=-1*DirX walk(0,1*DirY) next ToHide() CheckPause() digit() DirY=-1*DirY unloadore() CheckPause() mrecal(rune[j]) CheckPause() next wend end sub
;-------------------- Try to mine under self ------------------ sub digit() VAR Last=0,LastTimer VAR MaxWeight=400 ;----------------------------макс вес
if UO.Weight>=MaxWeight then unloadore() endif repeat attack() CheckLag() UO.WaitTargetSelf() UO.UseType('0x0F39') ; Type (Лопата)------------------------------------ LastTimer=UO.Timer()
repeat attack() wait(100) attack() 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() attack() if UO.InJournal('You loosen') then repeat attack() wait(100) attack() until UO.InJournal("You put") OR LastTimer+105<UO.Timer() endif attack() until UO.InJournal("There is no") OR UO.InJournal("That is too") attack() wait(1000) attack() CheckPause() end sub
sub Adigit() VAR Last=0,LastTimer VAR MaxWeight=400 ;-----------------------------Макс вес
if UO.Weight>=MaxWeight then unloadore() endif repeat attack() CheckPause() UO.WaitTargetSelf() UO.UseType('0x0E86') ;Type (кирка)----------------------------- LastTimer=UO.Timer()
repeat attack() wait(100) attack() 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 LastTimer+150<UO.Timer() wait(1000) attack() CheckPause()
if UO.InJournal('You loosen') then repeat attack() wait(100) attack() until UO.InJournal("You put") OR LastTimer+105<UO.Timer() endif attack() until UO.InJournal("There is no") OR UO.InJournal("That is too") OR UO.InJournal("attacking you") OR UO.InJournal("You see") attack() wait(1000) attack() CheckPause() end sub
;------------------------- Unload ore ------------------------- sub unloadore() VAR TempX,TempY,i,Exit DIM Ore[5]
TempX=UO.GetX() TempY=UO.GetY() CheckPause()
RecalHome()
CheckPause() ToHide() CheckPause()
Ore[0]=0x19B9 ; Type (Руда) больше 4 в куче Ore[1]=0x19B7 ; 3 в куче Ore[2]=0x19BA ; 2 в куче Ore[3]=0x19B9 ; 1 в куче (у меня такое значение из за патча вердаты) UO.SetReceivingContainer('0x412B1F90') ;---------------- Unload 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() eat() CheckPause() eat() CheckPause() eat() CheckPause() eat() CheckPause() eat() wait (1000) CheckPause() ToHide() CheckPause() end sub
;----------- Morf in Daemon, kill elem and loot him -----------
sub tohide() attack() while NOT UO.Hidden() UO.DeleteJournal()
if UO.Life<100 then UO.UseType('0x0F09','0x0060') attack() wait(2000) attack() else attack() UO.UseSkill('Hiding') repeat attack() wait(50) until UO.InJournal('You have hidden') OR UO.InJournal('seem to hide') OR UO.InJournal('preoccupied') endif attack() UO.WarMode('flip') wait(100) UO.Warmode(0) attack() 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:\Ultima Online\attack") ; play wav wait(1200) ; time to play sample at once next end sub
sub alarm() while 1==1 wait(1000) if UO.Life<100 then attack() UO.WaitTargetSelf() UO.UseType('0x0e21') 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
sub mrecal(rune) while UO.mana<13 UO.useskill("Medit") wait (2000) wend repeat CheckLag() CheckPause() UO.DeleteJournal() UO.WaitTargetObject(rune) UO.Cast('Recal') wait(8000) until NOT UO.InJournal("spell fizzles") end sub
sub RecalHome() while UO.mana<13 UO.useskill("Medit") wait (2000) wend repeat CheckLag() CheckPause() UO.DeleteJournal() UO.Cast('Recall','0x4171D285') ;-------------------------- Object home rune wait(8000) until NOT UO.InJournal("spell fizzles") end sub
sub eat() UO.UseType("fish") ; Type Åäû end sub
sub attack() If UO.InJournal("attacking you") then UO.UseType("0x0f09") unloadore() CheckPause() RecalHome() endif If UO.InJournal("An Ex Por") then UO.UseType("0x0f09") unloadore() CheckPause() RecalHome() endif If UO.InJournal("Ort Rel") then UO.UseType("0x0f09") unloadore() CheckPause() RecalHome() endif end sub
Иногда сглючивает и остается не реколясь на руну, не разберался почему, пользовался то 1 раз
Главное начинать с пещеры, а потом будет сам летать домой и т.д
|