Page 1 of 1

помогите доработать скрипт на мининг

Posted: 2006-07-31 11:01:48
by Nort777
шард ДРВ
вот обычный скрипт на мининг в випке, помогите его изменить так чтоб он когда копает выбрасывал руду начиная с айрона и до голда куданибуть (хоть себе под ноги хоть в сторону) для облегчения веса..
и когда набирал бы максимальный вес останавливал скрипт.
плиз хелп.

Code: Select all

############################################################### 
#===---====----===---===---= Mining
#"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""#
#"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""#
# To start script use ",exec mine" command from client window #
###############################################################

;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
;==================== Main mining script ======================
;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
sub mine()
   VAR DigDistance, TileNum, KillElemental
   VAR ElemSignal, LastTimer
   DIM BaseX[4], BaseY[4]
   VAR BaseZ, WayPoint, WayPoints
   VAR MaxWeight

   VAR i,j,TileY,TileX,DirX,DirY
   VAR Delta,BeginX,EndX,BeginY,EndY
   

;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
; TileNum='Num' - Use ",infotile" command on the floor
; Iiia? oaeea a eioi?ii ii?ii eiiaou ,iioueaeoa eiiaiaie
; ",infotile" ii ?aciai oaeeai e iiniio?eoa ia ioee?a?ony ee eo
; iiia?a.
;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
   TileNum='1339'
   

;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
; Iaeneiaeuiue aan, eioi?ue ii?ao iiaiyou ?a?. Noaauoa aai
; iaiiiai iaiuoa ?aaeuiiai. Oi anou anee ?a? iiaieiaao 760, oi
; noaaei 730.
;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
   MaxWeight=400

;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
; DigDistance=4 - Distance from tile where pickaxe targeting
; ?aaeon e?oaa ii eioi?iio aoaao eiiaou ?a?, oi anou ?annoiyiea
; ai eeaoee eoaa ii?ii aioyioouny ee?eie.
;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
   DigDistance=4

;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
; KillElemental='Yes'/'No' - Use 'Yes' if char skilled to morph
;                            in daemon and wrestling > 50
; Anee ?a? ainoaoi?ii i?iea?ai ?oia aeou yeaiia, noaauoa 'Yes'
;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
   KillElemental='Yes'

;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
; ElemSignal='Off'/'On' - Play sound when elemental is digged
; Iiiaaoaou i?e iiyaeaiee yeaia
;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
   ElemSignal='On'


;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
; Caanu oeacuaaai eii?aeiaou oi?ae eiiaiey. Io?ii anoaou ia
; iiceoe? e iiniio?aou eii?aeiaou a ei?aeoa. Eo e io?ii
; iianoaaeou aianoi iieo. ?a?a noaauoa ia 4 eeaoee io noai.
;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

   BaseX[0]=5612
   BaseY[0]=1661
   BaseZ=0

   BaseX[1]=5603
   BaseY[1]=1661



;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
; Oeacuaaai eiee?anoai oi?ae eiiaiey
;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

   WayPoints=2


   CheckLag()
   UO.UseObject('Sunduk')
   LastTimer=UO.Timer()
   Repeat
      wait(500)
   Until UO.InJournal('You can') OR UO.InJournal('What is the') OR UO.Timer()>LastTimer+100
   
   If UO.InJournal('see the') Then
      UO.Say("Podoydi k sunduku i tkni v nego pricelom!")
      UO.AddObject('Sunduk')
      While UO.Targeting()==2
         wait(500)
      Wend
      UO.SaveConfig()
      UO.UseObject('Sunduk')
   Else
;      UO.Say("Ok! Viju sunduk.")
   Endif


   CheckLag()
   UO.UseObject('IronBag')
   LastTimer=UO.Timer()
   Repeat
      wait(500)
   Until UO.InJournal('You can') OR UO.InJournal('What is the')OR UO.Timer()>LastTimer+100
   
   If UO.InJournal('see the') Then
      UO.Say("V kakoy meshok kidat' Iron Ore")
      UO.AddObject('IronBag')
      While UO.Targeting()==2
         wait(500)
      Wend
      UO.SaveConfig()
   Else
;      UO.Say("Meshok dlya Iron Ore viju")
   Endif


   CheckLag()
   UO.UseObject('OtherBag')
   LastTimer=UO.Timer()
   Repeat
      wait(500)
   Until UO.InJournal('You can') OR UO.InJournal('What is the')OR UO.Timer()>LastTimer+100
   
   If UO.InJournal('see the') Then
      UO.Say("V kakoy meshok kidat' rudu?")
      UO.AddObject('OtherBag')
      While UO.Targeting()==2
         wait(500)
      Wend
      UO.SaveConfig()
   Else
;      UO.Say("Meshok dlya rudy viju.")
   Endif


   CheckLag()
   UO.UseObject('BestBag')
   LastTimer=UO.Timer()
   Repeat
      wait(500)
   Until UO.InJournal('You can') OR UO.InJournal('What is the')OR UO.Timer()>LastTimer+100
   
   If UO.InJournal('see the') Then
      UO.Say("V kakoy meshok kidat' vihu?")
      UO.AddObject('BestBag')
      While UO.Targeting()==2
         wait(500)
      Wend
      UO.SaveConfig()
   Else
;      UO.Say("Meshok dlya vihi viju.")
   Endif

   While NOT UO.Dead()
   
      For WayPoint=0 to WayPoints-1
         walkn(BaseX[WayPoint],BaseY[WayPoint],"")
         digitstay(MaxWeight,DigDistance,KillElemental,ElemSignal,BaseX[WayPoint],BaseY[WayPoint])
      Next
   wend
end sub


; I?iaa?ea io?iinoe ?oau. Caeiiaioe?iaaou oi ?oi io?ii eiiaou.
sub CheckOre()
   VAR Cont=1, i=0, Exit=0
   VAR Count=7   ; Neieuei yeaiaioia a ianneaa.
   DIM Ores[15]   

   Ores[0]="Iron"
   Ores[1]="Rusty"
   Ores[2]="Old Copper"
   Ores[3]="Dull Copper"
   Ores[4]="Copper"
   Ores[5]="Bronze"
   Ores[6]="Silver"
;   Ores[7]="Shadow"
;   Ores[8]="Rose"
;   Ores[9]="Gold"
;   Ores[10]="Agapite"
;   Ores[11]="Blood Rock"
;   Ores[12]="Verite"
;   Ores[13]="Valorite"
;   Ores[14]="Mytheril"

   While i<Count AND Exit==0
      If UO.InJournal(Ores[i]) Then
         Cont=0
         Exit=1
      Endif
;      UO.Print(STR(i))
;      UO.Print(Ores[i])
      i=i+1
   Wend
   
   return Cont
end sub


;-------------------- Try to mine under self ------------------
sub digitstay(MaxWeight,MaxDistance,KillElemental,ElemSignal,BaseX,BaseY)
   VAR x,y,z='0',TileNum='1339'
   VAR Last=0,LastTimer, ContFlag=1
   VAR MaxTimer=110

   For x=-MaxDistance to MaxDistance
      For y=-MaxDistance to MaxDistance
         Repeat
            CheckLag() ; deleting journal
            ToHide()
           
            UO.WaitTargetTile(TileNum,STR(UO.GetX()+x),STR(UO.GetY()+Y),z)
            UO.UseType('0x0E85')

            LastTimer=UO.Timer()

            Repeat
               wait(500)
            until UO.InJournal("Try mining") OR 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+200<UO.Timer()

            If NOT UO.InJournal('There is no') then
               ContFlag=CheckOre()
            Endif

            If UO.InJournal('You loosen') then
               repeat
                  wait(500)
               until UO.InJournal("You put") OR LastTimer+MaxTimer<UO.Timer()
            Endif

            If UO.InJournal('something with ore') OR UO.InJournal("attacking you") then
               If ElemSignal=='On' Then
                  Gong(2)
               Endif

               If KillElemental=='Yes' Then
                  KillElem()
                  walkn(BaseX,BaseY,"")
               Else
; any user defined command when char digget elemental

               Endif
            Endif
           
            If UO.InJournal("attacking you") then
               gong(3)
            Endif

            If UO.Weight>=MaxWeight then
               unloadore()
            Endif
         Until UO.InJournal("There is no") OR UO.InJournal("That is too") OR UO.InJournal("Try mining") OR ContFlag==0
      Next
   Next
end sub


;------------------------- Unload ore -------------------------
sub unloadore()
   VAR TempX,TempY,i,Exit, Exit1, ConTainer, j
   VAR SundukX=5599
   VAR SundukY=1674
   VAR Index=14 ; eiee?anoai yeaiaioia ianneaa
   DIM Ore[5], Colors[20]

   Colors[0]="0x09F0" ; Gorgan
   Colors[1]="0x09D3" ; Steel
   Colors[3]="0x0BA7" ; Eldar
   Colors[4]="0x08AF" ; Plut
   Colors[5]="0x0085" ; Dragon
   Colors[6]="0x0060" ; Aqua
   Colors[7]="0x09E6" ; Elvin
   Colors[8]="0x010F" ; Krinit
   Colors[9]="0x09DA" ; Vulkan
   Colors[10]="0x09EC" ; Blood Crest
   Colors[11]="0x008F" ; Sand Rock
   Colors[12]="0x09B9" ; Acid
   Colors[13]="0x09A4" ; Crystaline


   TempX=UO.GetX()
   TempY=UO.GetY()
   
   walkn(SundukX,SundukY,"")
   ToHide()
   UO.UseObject("Sunduk")

   Ore[0]=0x19B9 ; 4 and more ore
   Ore[1]=0x19B7 ; 1 ore
   Ore[2]=0x19BA ; 2 ore
   Ore[3]=0x19B8 ; 3 ore

   For i=0 to 3
      Exit=0
      repeat
         UO.FindType(Ore[i])
         
         if UO.GetQuantity('finditem')>0 then
            If UO.GetColor('finditem')=='0x0000' Then
               Container=UO.GetSerial('IronBag')
            Else
               Container=UO.GetSerial('OtherBag')
               Exit1=0
               j=0
               While j<Index AND Exit1<>1
                  If UO.GetColor('finditem')==Colors[j] Then
                     Container=UO.GetSerial('BestBag')
                     Exit1=1
                  Endif
                  j=j+1
               Wend
            Endif
            UO.MoveItem('finditem',0,Container)
            CheckLag()
            wait(1000)
         Else
            Exit=1
         endif
      until Exit==1
   Next

   walkn(TempX,TempY,"")
   ToHide()
end sub

;----------- Morf in Daemon, kill elem and loot him -----------
sub killelem()
   VAR Count, LastTimer, Elem
      UO.UseType('0x0F0E','0x0631') ; inviz potion
      UO.UseType('0x0DD6','0x05FA') ; priz fish
  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 OR LastTimer+300<UO.Timer()

   UO.UseType(0x1B76) ; heater1
   wait(500)
   UO.UseType(0x1413) ; heater2
   wait(500)
   UO.UseType('0x13B9') ; v1
   wait(500)
   UO.UseType('0x0F0E','0x0964') ; stone skeen
 
   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.WaitTargetGround('0x19B9') ; 4 and more ore
   wait(1500)
   UO.Grab('all')
   UO.WaitTargetGround('0x19B8') ; 3 ore
   wait(1500)
   UO.Grab('all')
   UO.WaitTargetGround('0x0EED') ; gold coins
   wait(500)
   UO.Grab('all')


   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<200 then ; U'r max HP
      repeat
         UO.BandageSelf()
         wait(4000)
      until UO.Life>200 OR LastTimer+300<UO.Timer()
   endif
   UO.DeleteJournal()

end sub


###############################################################
###############################################################
;
;                        Shared Subs
;
###############################################################
###############################################################

#==============================================================
#  tohide() - try hidding char. When char lose HP, drink inviz
#             potion if it found in backpack
#
#  Journal has been deleted!!!
#--------------------------------------------------------------
sub tohide()
   while NOT UO.Hidden()
      UO.DeleteJournal()
      UO.FindType('0x0F0E','0x0631','my')

      if UO.Life<UO.STR/2 AND UO.GetQuantity('finditem')>0 then
         UO.UseType('0x0F0E','0x0631') ; inviz potion
         UO.Exec('warmode 0')
         wait(2000)
      else
         UO.Exec('warmode 0')
         UO.UseSkill('Stealth')
         repeat
            wait(50)
         until UO.InJournal('You have hidden') OR UO.InJournal('seem to hide') OR UO.InJournal('preoccupied')
      endif
   wend
end sub


#==============================================================
#  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


#==============================================================
#  Gong(counter) - playing wav-file 'counter'-times
#  http://www.jetta.ru/cow.wav
#--------------------------------------------------------------
sub Gong(times) ; play wav-file
   VAR i
   for i=1 to times
      UO.Exec("playwav d:\game\uo\injection\cow")
      wait(1200) ; time to play sample at once
   next
end sub


#==============================================================
#  Alarm() - when char lose some HP, U are informed :)
#--------------------------------------------------------------
sub Alarm()
   VAR CharHP=150
   while 1==1
      wait(1000)
      if UO.Life<CharHP then
         gong(1)
      endif     
   wend
end sub

;---------------- Oiaeeea -----------------------
sub GoW()
   VAR walkwait=300
   VAR x,y,dir=6
   VAR key=36 ; Home key
   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 UO.GetX()+1==x Then
      return -1
   Else
      return 1
   Endif
end sub


sub GoN()
   VAR walkwait=300
   VAR x,y,dir=0
   VAR key=33 ; PgUp
   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 UO.GetY()+1==y Then
      return -1
   Else
      return 1
   Endif
end sub


sub GoE()
   VAR walkwait=300
   VAR x,y,dir=2
   VAR key=34 ; PgDown
   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 UO.GetX()-1==x Then
      return -1
   Else
      return 1
   Endif
end sub


sub GoS()
   VAR walkwait=300
   VAR x,y,dir=4
   VAR key=35 ; End
   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 UO.GetY()-1==y Then
      return -1
   Else
      return 1
   Endif
end sub


sub GoWN()
   VAR walkwait=300
   VAR x,y,dir=7
   VAR key=38 ; UpArrow
   x=UO.GetX()
   y=UO.GetY()

   If UO.GetDir()<>dir Then
      UO.Press(key)
      wait(walkwait)
      If UO.GetDir()<>dir Then
         CheckLag()
      Endif
   Endif

   If UO.GetDir()==dir Then
      UO.Press(key)
      wait(walkwait)
      If x==UO.GetX() AND y==UO.GetY() Then
         CheckLag()
      Endif
      If UO.GetDir()==dir Then
         return -1
      Else
         return UO.GetDir()
      Endif
   Else
      return UO.GetDir()
   Endif
end sub


sub GoNE()
   VAR walkwait=300
   VAR x,y,dir=1
   VAR key=39 ; RightArrow
   x=UO.GetX()
   y=UO.GetY()

   If UO.GetDir()<>dir Then
      UO.Press(key)
      wait(walkwait)
      If UO.GetDir()<>dir Then
         CheckLag()
      Endif
   Endif

   If UO.GetDir()==dir Then
      UO.Press(key)
      wait(walkwait)
      If x==UO.GetX() AND y==UO.GetY() Then
         CheckLag()
      Endif
      If UO.GetDir()==dir Then
         return -1
      Else
         return UO.GetDir()
      Endif
   Else
      return UO.GetDir()
   Endif
end sub


sub GoSE()
   VAR walkwait=300
   VAR x,y,dir=3
   VAR key=40 ; DownArrow
   x=UO.GetX()
   y=UO.GetY()

   If UO.GetDir()<>dir Then
      UO.Press(key)
      wait(walkwait)
      If UO.GetDir()<>dir Then
         CheckLag()
      Endif
   Endif

   If UO.GetDir()==dir Then
      UO.Press(key)
      wait(walkwait)
      If x==UO.GetX() AND y==UO.GetY() Then
         CheckLag()
      Endif
      If UO.GetDir()==dir Then
         return -1
      Else
         return UO.GetDir()
      Endif
   Else
      return UO.GetDir()
   Endif
end sub


sub GoSW()
   VAR walkwait=300
   VAR x,y,dir=5
   VAR key=37 ; LeftArrow
   x=UO.GetX()
   y=UO.GetY()

   If UO.GetDir()<>dir Then
      UO.Press(key)
      wait(walkwait)
      If UO.GetDir()<>dir Then
         CheckLag()
      Endif
   Endif

   If UO.GetDir()==dir Then
      UO.Press(key)
      wait(walkwait)
      If x==UO.GetX() AND y==UO.GetY() Then
         CheckLag()
      Endif
      If UO.GetDir()==dir Then
         return -1
      Else
         return UO.GetDir()
      Endif
   Else
      return UO.GetDir()
   Endif
end sub


#==============================================================
#  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!
#     walkwait - delay after keypress
#--------------------------------------------------------------
sub WalkN(x,y,Target)
   VAR i
   VAR dx,dy,Exit=0
   
   While Exit<>1   
      If Target<>"" Then
         dx=UO.GetX(Target)-UO.GetX()
         dy=UO.GetY(Target)-UO.GetY()
;         UO.Print("Target locked!")
         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
            GoSE()
         Endif

         If dx>0 AND dy<0 Then
            GoNE()
         Endif

         If dx<0 AND dy>0 Then
            GoSW()
         Endif

         If dx<0 AND dy<0 Then
            GoWN()
         Endif

      Endif
   
      If dx<>0 AND dy==0 Then
         If dx>0 Then
            GoE()
         Endif
         
         If dx<0 Then
            GoW()
         Endif
      Endif


      If dx==0 AND dy<>0 Then
         If dy>0 Then
            GoS()
         Endif
         
         If dy<0 Then
            GoN()
         Endif
      Endif
   Wend
end sub

Posted: 2006-07-31 12:20:10
by ghost_hnt
читай - здесь про это все написано

Posted: 2006-07-31 15:49:53
by Nort777
ghost_hnt wrote:читай - здесь про это все написано

ты про че?

Posted: 2006-07-31 16:51:45
by Savage

Posted: 2006-07-31 17:04:52
by ДРВ
Savage wrote:https://yoko.uokit.com/viewtopic.php?t=2922
Ув. Савадж,сделал все по иструкции,чар не копает!:(

Posted: 2006-07-31 17:17:17
by Savage
Так твоим скриптом чар копает? В нем исправь дроп руды.
Или постарайся выяснить причину почему не копает. Шаг за шагом. к точке копки подходит? Кирку берет?.....

Posted: 2006-07-31 17:30:04
by ДРВ
Savage wrote:Так твоим скриптом чар копает? В нем исправь дроп руды.
Или постарайся выяснить причину почему не копает. Шаг за шагом. к точке копки подходит? Кирку берет?.....
Это вы щас мне? :shock:

Posted: 2006-07-31 17:50:06
by Nort777
Savage wrote:https://yoko.uokit.com/viewtopic.php?t=2922

я прочитал все, только не нашел ответа
сам скрипт работает на ура, но нужно чтоб он выкидывал треш руду на пол и по набирании веса останавливался...я не могу просто подойти к сундуку
я понятия не имею как вставить дроп руды... :cry:

Posted: 2006-07-31 20:48:30
by ghost_hnt
все должно пахать- исправь нужные типы руды и тд
у мя и то пашет я на оском переделывал :D

Posted: 2006-07-31 20:56:15
by Savage
Да ему надо чтоб сразу скидывать, копнул - не то - выкинул. Это надо дописывать процедурку и вместо унлоада ее ставить.

Posted: 2006-07-31 22:41:02
by Nort777
Savage wrote:Да ему надо чтоб сразу скидывать, копнул - не то - выкинул. Это надо дописывать процедурку и вместо унлоада ее ставить.

типа того, или чтоб докопал до определенного веса и сбросил куданить ненужную руду и опять копать...но чтоб не сходить с точки

Posted: 2006-08-01 12:38:25
by ghost_hnt
Savage wrote:Да ему надо чтоб сразу скидывать, копнул - не то - выкинул. Это надо дописывать процедурку и вместо унлоада ее ставить.

ну все так же - вот мой скрипт - с твоей , чуток доработанной выкидкой

Code: Select all

sub mining() 
VAR x,y,z='0',TileNum='1339'
VAR Last=0,LastTimer
For x=-4 to 4
For y=-4 to 4
Repeat
CheckLag()
ToHide()
UO.WaitTargetTile(TileNum,STR(UO.GetX()+x),STR(UO.GetY()+Y),z)
UO.UseType('0x0e85')
LastTimer=UO.Timer()
repeat
wait(2000)
until UO.InJournal("Try mining") OR UO.InJournal("You put") OR UO.InJournal("Раздолбив") OR UO.InJournal("Тут не") OR UO.InJournal("Это слишком") OR UO.InJournal("OOPS") OR UO.InJournal("attacking you") OR LastTimer+150<UO.Timer()
if UO.InJournal('You loosen') then
repeat
wait (500)
sbroska()
until UO.InJournal("You put") OR LastTimer+105<UO.Timer()
endif
until UO.InJournal("Тут не осталось") OR UO.InJournal("Это слишком") OR UO.InJournal("Раздолбив")

Next
Next
mining()
end sub


sub tohide()
while NOT UO.Hidden()
UO.DeleteJournal()
UO.FindType('0x0F0E','0x0631','my')
if UO.Life<UO.STR/2 AND UO.GetQuantity('finditem')>0 then
UO.UseType('0x0F0E','0x0631')
UO.Exec('warmode 0')
wait(2000)
else
UO.Exec('warmode 0')
UO.UseSkill('Hiding')
repeat
wait(50)
until UO.InJournal('You have hidden') OR UO.InJournal('Вам не удалось') OR UO.InJournal('preoccupied')
endif
wend
end sub

sub CheckLag()
UO.DeleteJournal()

Sub sbroska()
var i,j
Dim OreType[4]
OreType[01]='0x19B7'  ## 1 ore
OreType[02]='0x19BA'  ## 2 ore
OreType[03]='0x19B8'  ## 3 ore
OreType[04]='0x19B9'  ## 4 and more ore

Dim OreColor[3] ## массив цветов трешевой руды
OreColor[1] = '0x0000'
OreColor[2] = '0x0641'
OreColor[3] = '0x077A'

for j=1 to 4
for i=1 to 3
uo.findtype(OreType[j],OreColor[i],'backpack')
while uo.findcount()>0
uo.moveitem('finditem','-1','ground')
wait(700)
uo.findtype(OreType[j],OreColor[i],'backpack')
wend
next
next
end sub

капает - если треш руда- сразу по дсебя :)

Posted: 2006-08-02 14:32:31
by Nort777
а как сделать чтоб он обкапывал все вокруг себя? и копал в двух точках, также после набирания полной сумки останавливал скрипт?

Posted: 2006-08-03 19:03:07
by Nort777
скрестить скрипты получилось, скажите плиз акая функция или скрипт останавливает основной скрипт?

Posted: 2006-08-03 19:51:07
by ghost_hnt
Nort777 wrote:скрестить скрипты получилось, скажите плиз акая функция или скрипт останавливает основной скрипт?

вроде uo.terminate :?

Na ne4evo neizprovlaj vse rabotajet :D

Posted: 2006-08-08 10:51:18
by no_t1m3
sub main()
var x,y,where_x,where_y,waits, coords , resources_count, times_dig=0, ore='0x19b9',goldsand='0x0eed', fishstake='0x097b',pickaxe='0x0e85',hammerpick='0x
#wait(1000)
#until uo.hidden

143c', shovel='0x0f39', dagger='0x0f51',clay='0x1be9'
while uo.weight<60000
x=-2
while x<=2
y=-2
while y<=2
while not UO.Hidden()
UO.Warmode("0")
uo.print("no_t1m3@mail.ru (c)2006")
UO.UseSkill("Hiding")
wait(6000)
wend
where_x=uo.getx()
where_y=uo.gety()
resources_count=uo.count(ore)+uo.count(goldsand)+uo.count(clay)
coords="waittargettile "+"0 "+str(where_x+x)+" "+str(where_y+y)+" 0"
uo.exec(coords)
if uo.count(pickaxe)>0 then
uo.usetype(pickaxe)
else
if uo.count(hammerpick)>0 then
uo.usetype(hammerpick)
else
if uo.count(shovel)>0 then
uo.usetype(shovel)
else
while (uo.count(pickaxe)+ uo.count(shovel)+uo.count(hammerpick)<1)
uo.waittargettype(dagger)
uo.useskill('Arms Lore')
wait(10000)
wend
endif
endif
endif
###uo.print(coords); - for debug - prints calculated coordinates in command line
waits=0
repeat
wait(1000)
waits=waits+1
until resources_count<>(uo.count(ore)+uo.count(goldsand)+uo.count(clay)) or waits>6
if (uo.count(ore)+uo.count(goldsand)+uo.count(clay))==resources_count then
y=y+1
endif
times_dig=times_dig+1
if times_dig>20 then
if uo.count(fishstake)>0 then
uo.usetype(fishstake)
endif
times_dig=0
endif
wend
x=x+1
wend
wend
end sub

Mining

Posted: 2006-08-08 10:52:05
by no_t1m3
sub main()
var x,y,where_x,where_y,waits, coords , resources_count, times_dig=0, ore='0x19b9',goldsand='0x0eed', fishstake='0x097b',pickaxe='0x0e85',hammerpick='0x
#wait(1000)
#until uo.hidden

143c', shovel='0x0f39', dagger='0x0f51',clay='0x1be9'
while uo.weight<60000
x=-2
while x<=2
y=-2
while y<=2
while not UO.Hidden()
UO.Warmode("0")
uo.print("no_t1m3@mail.ru (c)2006")
UO.UseSkill("Hiding")
wait(6000)
wend
where_x=uo.getx()
where_y=uo.gety()
resources_count=uo.count(ore)+uo.count(goldsand)+uo.count(clay)
coords="waittargettile "+"0 "+str(where_x+x)+" "+str(where_y+y)+" 0"
uo.exec(coords)
if uo.count(pickaxe)>0 then
uo.usetype(pickaxe)
else
if uo.count(hammerpick)>0 then
uo.usetype(hammerpick)
else
if uo.count(shovel)>0 then
uo.usetype(shovel)
else
while (uo.count(pickaxe)+ uo.count(shovel)+uo.count(hammerpick)<1)
uo.waittargettype(dagger)
uo.useskill('Arms Lore')
wait(10000)
wend
endif
endif
endif
###uo.print(coords); - for debug - prints calculated coordinates in command line
waits=0
repeat
wait(1000)
waits=waits+1
until resources_count<>(uo.count(ore)+uo.count(goldsand)+uo.count(clay)) or waits>6
if (uo.count(ore)+uo.count(goldsand)+uo.count(clay))==resources_count then
y=y+1
endif
times_dig=times_dig+1
if times_dig>20 then
if uo.count(fishstake)>0 then
uo.usetype(fishstake)
endif
times_dig=0
endif
wend
x=x+1
wend
wend
end sub