Доработайте скрипт

Anything and all.

Moderators: Murderator+, Murderator

Post Reply
Alarm
Posts: 9
Joined: 2005-07-06 22:35:32

Доработайте скрипт

Post by Alarm »

Вот скрипт на мининг помогите сделать, так, чтобы после каждого "копка" вставал в хид.

Code: Select all

var OreLimit=300
var q, w, p
var f=file("C:\mine.dat")

################################################
sub main()
UO.DeleteJournal()
var Minepoints, Mine1
var i
dim PX[50], PY[50]
uo.Print('Loading from file...')
f.open()
Mine1=safe call f.ReadNumber()
Minepoints=1
for i=1 to 30
    PX[i]=safe call f.ReadNumber()
    PY[i]=safe call f.ReadNumber()
next
f.close()
uo.Print('Загружено точек... '+str(i))
wait(300)
   while not UO.Dead()
      for p=1 to 30
           uo.concolor(0x0003)
             uo.Print('X- '+str(PX[p])+' Y- '+str(PY[p]))
             uo.Print('Иду к точке...'+str(p))
             WalkN(PX[p],PY[p],'')
             uo.Print('Начинаю копать в точке... '+str(p))
            UO.Warmode("0")
            while not uo.hidden()
            uo.useskill('Hiding')
            wait(2400)
            wend
              mine(PX,PY)
              wait(300)
      next
   wend
end sub
################################################
sub Mark()
dim PX[50], PY[50]
var Minepoints=0
var i
uo.Print('Начинаю марчить...')
for i=1 to 50
  UO.DeleteJournal()
  uo.Print('Set point '+ str(i))
  repeat
     wait(500)
     if UO.InJournal('stop')then
        SaveToFile(i-1,PX,PY)
        return
     endif
  until UO.InJournal('set')
    PX[i] = UO.GetX("self")
    PY[i] = UO.GetY("self")
    uo.Print('Point '+str(i)+' X- '+str(PX[i])+' Y- '+str(PY[i])+' есть')
next
end sub
#############################
sub SaveToFile(mp,PX,PY)
var s=0,k=0
f.open()
f.create()
uo.Print('points = '+ str(mp))
   s=safe call f.writeln(mp)
for k=1 to mp
   s=safe call f.writeln(str(PX[k])+' '+str(PY[k]))
next
f.close()
end sub
##################################
sub mine(PX,PY)
   var x,y,z,kz,jz,summ,art
   art=0
   Dim Ores[4]
   Dim Ruda[9]
   Dim Cvet[9]
   Ores[1]=0x19B9 ; 4 and more ore
   Ores[2]=0x19B7 ; 1 ore
   Ores[3]=0x19BA ; 2 ore
   Ores[4]=0x19B8 ; 3 ore
   Cvet[1]=0x04FD
   Cvet[2]=0x0817
   Cvet[3]=0x0498
   Cvet[4]=0x05B7
   Cvet[5]=0x04A1
   Cvet[6]=0x049C
   Cvet[7]=0x0000
   Cvet[8]=0x04EA
   Cvet[9]=0x062D
   VAR LastTimer
   UO.Set('finddistance','2')
   z=UO.GetZ("self")
   uo.concolor(0x19B9)
      for x=-2 to 2
         for y=-2 to 2
         UO.Print("Копаю в ("+str(x)+" "+str(y)+")  Точка - "+str(p))
            repeat
            UO.DeleteJournal()
            uo.print('Удаляю журнал майне')
            Summ=0
                for kz=1 to 4
               Summ=Summ+uo.Count(Ores[kz])
         next
            for kz=1 to 9
               Ruda[kz]=0
                  for jz=1 to 4
                     Ruda[kz]=Ruda[kz]+uo.Count(Ores[jz],Cvet[kz])
                  next
            next
          uo.Print('У вас всего '+str(Summ)+' ингов - ')
          uo.Print(str(Ruda[1])+' титан, ' +str(Ruda[2])+' раптор, '+str(Ruda[3])+' стил')
                   uo.Print(str(Ruda[4])+' блекрок, ' +str(Ruda[5])+' мифрил, '+str(Ruda[6])+' ацид')
                   uo.Print(str(Ruda[8])+' дайм-д, ' +str(Ruda[9])+' валор, '+str(Ruda[7])+' ирона')
          uo.exec('warmode 0')
          UO.WaitTargetTile("1341",STR(UO.GetX()+x),STR(UO.GetY()+Y),str(z))
             UO.UseType('0x0E85')
             LastTimer=UO.Timer()
                Repeat
                     wait(300)
                Until UO.InJournal("You put") or UO.InJournal("Opps") or UO.InJournal("can't see") or UO.InJournal("must wait") or UO.InJournal("elsewhere") or UO.InJournal("where it")or UO.InJournal("nothing") or UO.InJournal("no ore") or UO.InJournal("location") or UO.InJournal("far away") or UO.InJournal("in rock") or uo.Timer()>LastTimer+100 or UO.InJournal("fail")
                     if UO.InJournal("fail") then
                        art=art+1
                     end if
                     if art==4 then
                         UO.DeleteJournal()
                         wait(7000)
            art=0
                     end if
           Until UO.InJournal("You put") or UO.InJournal("Opps") or UO.InJournal("can't see") or UO.InJournal("must wait") or UO.InJournal("elsewhere") or UO.InJournal("where it")or UO.InJournal("nothing") or UO.InJournal("no ore") or UO.InJournal("location") or UO.InJournal("far away") or UO.InJournal("in rock") or uo.Timer()>LastTimer+100 and not UO.InJournal("fail")
               if UO.Weight>OreLimit-20 then
                  sell()
           end if
           next

      next
end sub
####################################
sub Sell()
UO.Say(".sell")
UO.Waittargettype('0x19b9',0x0000)
wait(1000)
UO.LClick(341,315)   #клик по Ок
wait(300)
end sub
#########################################
sub CheckLag()
if uo.Waiting()>0 then
uo.Exec('canceltarget')
end if
uo.Click('backpack')
repeat
wait(50)
until uo.InJournal('backpack')
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
 
##################################
#==============================================================
#  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!
#       serial - Serial of target or "" - string
#     walkwait - delay after keypress
#     Example:
#     WalkN(2080,2113,'') - go to coordinates
#     WalkN(0,0,'0x12345678') - go to target position
#--------------------------------------------------------------
sub WalkN(x,y,Target)
   VAR i,StepSucess
   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
            StepSucess=Go(3,40,0) ;SE - DownArrow
            If StepSucess==-1 Then
               StepSucess=Go(7,38,0) ;WN - UpArrow
               StepSucess=Go(1,39,0) ;NE - RightArrow
               If StepSucess==-1 Then
                  StepSucess=Go(5,37,0) ;SW - LeftArrow
               Endif
            Endif
         Endif

         If dx>0 AND dy<0 Then
            StepSucess=Go(1,39,0) ;NE - RightArrow
            If StepSucess==-1 Then
               StepSucess=Go(5,37,0) ;SW - LeftArrow
               StepSucess=Go(3,40,0) ;SE - DownArrow
               If StepSucess==-1 Then
                  StepSucess=Go(7,38,0) ;WN - UpArrow
               Endif
            Endif
         Endif

         If dx<0 AND dy>0 Then
            StepSucess=Go(5,37,0) ;SW - LeftArrow
            If StepSucess==-1 Then
               StepSucess=Go(1,39,0) ;NE - RightArrow
               StepSucess=Go(7,38,0) ;WN - UpArrow
               If StepSucess==-1 Then
                  StepSucess=Go(3,40,0) ;SE - DownArrow
               Endif
            Endif
         Endif

         If dx<0 AND dy<0 Then
            StepSucess=Go(7,38,0) ;WN - UpArrow
            If StepSucess==-1 Then
               StepSucess=Go(3,40,0) ;SE - DownArrow
               StepSucess=Go(5,37,0) ;SW - LeftArrow
               If StepSucess==-1 Then
                  StepSucess=Go(1,39,0) ;NE - RightArrow
               Endif
            Endif
         Endif

      Endif
   
      If dx<>0 AND dy==0 Then
         If dx>0 Then
            StepSucess=Go(2,34,0) ;E - PgDown
            If StepSucess==-1 Then
               StepSucess=Go(3,40,0) ;SE - DownArrow
               If StepSucess==-1 Then
                  StepSucess=Go(1,39,0) ;NE - RightArrow
               Endif
               StepSucess=Go(2,34,0) ;E - PgDown
            Endif
         Endif
         
         If dx<0 Then
            StepSucess=Go(6,36,0) ;W - Home
            If StepSucess==-1 Then
               StepSucess=Go(7,38,0) ;WN - UpArrow
               If StepSucess==-1 Then
                  StepSucess=Go(5,37,0) ;SW - LeftArrow
               Endif
               StepSucess=Go(6,36,0) ;W - Home
            Endif
         Endif
      Endif

      If dx==0 AND dy<>0 Then
         If dy>0 Then
            StepSucess=Go(4,35,0) ;S - End
            If StepSucess==-1 Then
               StepSucess=Go(3,40,0) ;SE - DownArrow
               If StepSucess==-1 Then
                  StepSucess=Go(5,37,0) ;SW - LeftArrow
               Endif
               StepSucess=Go(4,35,0) ;S - End
            Endif
         Endif
         
         If dy<0 Then
            StepSucess=Go(0,33,0) ;N - PgUp
            If StepSucess==-1 Then
               StepSucess=Go(1,39,0) ;NE - RightArrow
               If StepSucess==-1 Then
                  StepSucess=Go(7,38,0) ;WN - UpArrow
               Endif
               StepSucess=Go(0,33,0) ;N - PgUp
            Endif
         Endif
      Endif
   Wend
end sub
###############################################################
sub Go(dir,key,walkwait)
   VAR x,y, OldDir
   x=UO.GetX()
   y=UO.GetY()
   OldDir=UO.GetDir()
   If UO.GetDir()<>dir Then
      UO.Press(key)
      wait(walkwait)
      If UO.GetDir()<>dir Then
         CheckLag()
      Endif
   Endif
   UO.Press(key)
   wait(walkwait)
   If x==UO.GetX() AND y==UO.GetY() Then
      CheckLag()
   Endif
   If x==UO.GetX() AND y==UO.GetY() AND OldDir<>UO.GetDir() Then
      UO.Press(key)
      wait(walkwait)
   Endif
   If x==UO.GetX() AND y==UO.GetY() Then
      CheckLag()
   Endif
      If x==UO.GetX() AND y==UO.GetY() Then
      UO.Print("Zasada!")
      return -1
   Else
      return 1
   Endif
end sub
flake
Expert!
Posts: 746
Joined: 2004-08-11 23:56:17
Location: The Citadel
Contact:

Re: Доработайте скрипт

Post by flake »

Code: Select all

var OreLimit=300 
var q, w, p
var f=file("C:\mine.dat")

################################################
sub main()
UO.DeleteJournal()
var Minepoints, Mine1
var i
dim PX[50], PY[50]
uo.Print('Loading from file...')
f.open()
Mine1=safe call f.ReadNumber()
Minepoints=1
for i=1 to 30
    PX[i]=safe call f.ReadNumber()
    PY[i]=safe call f.ReadNumber()
next
f.close()
uo.Print('Загружено точек... '+str(i))
wait(300)
   while not UO.Dead()
      for p=1 to 30
           uo.concolor(0x0003)
             uo.Print('X- '+str(PX[p])+' Y- '+str(PY[p]))
             uo.Print('Иду к точке...'+str(p))
             WalkN(PX[p],PY[p],'')
             uo.Print('Начинаю копать в точке... '+str(p))
            UO.Warmode("0")
            while not uo.hidden()
            uo.useskill('Hiding')
            wait(2400)
            wend
              mine(PX,PY)
              wait(300)
      next
   wend
end sub
################################################
sub Mark()
dim PX[50], PY[50]
var Minepoints=0
var i
uo.Print('Начинаю марчить...')
for i=1 to 50
  UO.DeleteJournal()
  uo.Print('Set point '+ str(i))
  repeat
     wait(500)
     if UO.InJournal('stop')then
        SaveToFile(i-1,PX,PY)
        return
     endif
  until UO.InJournal('set')
    PX[i] = UO.GetX("self")
    PY[i] = UO.GetY("self")
    uo.Print('Point '+str(i)+' X- '+str(PX[i])+' Y- '+str(PY[i])+' есть')
next
end sub
#############################
sub SaveToFile(mp,PX,PY)
var s=0,k=0
f.open()
f.create()
uo.Print('points = '+ str(mp))
   s=safe call f.writeln(mp)
for k=1 to mp
   s=safe call f.writeln(str(PX[k])+' '+str(PY[k]))
next
f.close()
end sub
##################################
sub mine(PX,PY)
   var x,y,z,kz,jz,summ,art
   art=0
   Dim Ores[4]
   Dim Ruda[9]
   Dim Cvet[9]
   Ores[1]=0x19B9 ; 4 and more ore
   Ores[2]=0x19B7 ; 1 ore
   Ores[3]=0x19BA ; 2 ore
   Ores[4]=0x19B8 ; 3 ore
   Cvet[1]=0x04FD
   Cvet[2]=0x0817
   Cvet[3]=0x0498
   Cvet[4]=0x05B7
   Cvet[5]=0x04A1
   Cvet[6]=0x049C
   Cvet[7]=0x0000
   Cvet[8]=0x04EA
   Cvet[9]=0x062D
   VAR LastTimer
   UO.Set('finddistance','2')
   z=UO.GetZ("self")
   uo.concolor(0x19B9)
      for x=-2 to 2
         for y=-2 to 2
         UO.Print("Копаю в ("+str(x)+" "+str(y)+")  Точка - "+str(p))
            repeat
            UO.DeleteJournal()
            uo.print('Удаляю журнал майне')
            Summ=0
                for kz=1 to 4
               Summ=Summ+uo.Count(Ores[kz])
         next
            for kz=1 to 9
               Ruda[kz]=0
                  for jz=1 to 4
                     Ruda[kz]=Ruda[kz]+uo.Count(Ores[jz],Cvet[kz])
                  next
            next
          uo.Print('У вас всего '+str(Summ)+' ингов - ')
          uo.Print(str(Ruda[1])+' титан, ' +str(Ruda[2])+' раптор, '+str(Ruda[3])+' стил')
                   uo.Print(str(Ruda[4])+' блекрок, ' +str(Ruda[5])+' мифрил, '+str(Ruda[6])+' ацид')
                   uo.Print(str(Ruda[8])+' дайм-д, ' +str(Ruda[9])+' валор, '+str(Ruda[7])+' ирона')
          uo.exec('warmode 0')
          UO.WaitTargetTile("1341",STR(UO.GetX()+x),STR(UO.GetY()+Y),str(z))
             UO.UseType('0x0E85')
             LastTimer=UO.Timer()
                Repeat
                     wait(300)
                Until UO.InJournal("You put") or UO.InJournal("Opps") or UO.InJournal("can't see") or UO.InJournal("must wait") or UO.InJournal("elsewhere") or UO.InJournal("where it")or UO.InJournal("nothing") or UO.InJournal("no ore") or UO.InJournal("location") or UO.InJournal("far away") or UO.InJournal("in rock") or uo.Timer()>LastTimer+100 or UO.InJournal("fail")
                      ToHide()
                     if UO.InJournal("fail") then
                        art=art+1
                     end if
                     if art==4 then
                         UO.DeleteJournal()
                         wait(7000)
            art=0
                     end if
           Until UO.InJournal("You put") or UO.InJournal("Opps") or UO.InJournal("can't see") or UO.InJournal("must wait") or UO.InJournal("elsewhere") or UO.InJournal("where it")or UO.InJournal("nothing") or UO.InJournal("no ore") or UO.InJournal("location") or UO.InJournal("far away") or UO.InJournal("in rock") or uo.Timer()>LastTimer+100 and not UO.InJournal("fail")
               if UO.Weight>OreLimit-20 then
                  sell()
           end if
           next

      next
end sub
####################################
sub Sell()
UO.Say(".sell")
UO.Waittargettype('0x19b9',0x0000)
wait(1000)
UO.LClick(341,315)   #клик по Ок
wait(300)
end sub
#########################################
sub CheckLag()
if uo.Waiting()>0 then
uo.Exec('canceltarget')
end if
uo.Click('backpack')
repeat
wait(50)
until uo.InJournal('backpack')
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
 
##################################
#==============================================================
#  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!
#       serial - Serial of target or "" - string
#     walkwait - delay after keypress
#     Example:
#     WalkN(2080,2113,'') - go to coordinates
#     WalkN(0,0,'0x12345678') - go to target position
#--------------------------------------------------------------
sub WalkN(x,y,Target)
   VAR i,StepSucess
   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
            StepSucess=Go(3,40,0) ;SE - DownArrow
            If StepSucess==-1 Then
               StepSucess=Go(7,38,0) ;WN - UpArrow
               StepSucess=Go(1,39,0) ;NE - RightArrow
               If StepSucess==-1 Then
                  StepSucess=Go(5,37,0) ;SW - LeftArrow
               Endif
            Endif
         Endif

         If dx>0 AND dy<0 Then
            StepSucess=Go(1,39,0) ;NE - RightArrow
            If StepSucess==-1 Then
               StepSucess=Go(5,37,0) ;SW - LeftArrow
               StepSucess=Go(3,40,0) ;SE - DownArrow
               If StepSucess==-1 Then
                  StepSucess=Go(7,38,0) ;WN - UpArrow
               Endif
            Endif
         Endif

         If dx<0 AND dy>0 Then
            StepSucess=Go(5,37,0) ;SW - LeftArrow
            If StepSucess==-1 Then
               StepSucess=Go(1,39,0) ;NE - RightArrow
               StepSucess=Go(7,38,0) ;WN - UpArrow
               If StepSucess==-1 Then
                  StepSucess=Go(3,40,0) ;SE - DownArrow
               Endif
            Endif
         Endif

         If dx<0 AND dy<0 Then
            StepSucess=Go(7,38,0) ;WN - UpArrow
            If StepSucess==-1 Then
               StepSucess=Go(3,40,0) ;SE - DownArrow
               StepSucess=Go(5,37,0) ;SW - LeftArrow
               If StepSucess==-1 Then
                  StepSucess=Go(1,39,0) ;NE - RightArrow
               Endif
            Endif
         Endif

      Endif
   
      If dx<>0 AND dy==0 Then
         If dx>0 Then
            StepSucess=Go(2,34,0) ;E - PgDown
            If StepSucess==-1 Then
               StepSucess=Go(3,40,0) ;SE - DownArrow
               If StepSucess==-1 Then
                  StepSucess=Go(1,39,0) ;NE - RightArrow
               Endif
               StepSucess=Go(2,34,0) ;E - PgDown
            Endif
         Endif
         
         If dx<0 Then
            StepSucess=Go(6,36,0) ;W - Home
            If StepSucess==-1 Then
               StepSucess=Go(7,38,0) ;WN - UpArrow
               If StepSucess==-1 Then
                  StepSucess=Go(5,37,0) ;SW - LeftArrow
               Endif
               StepSucess=Go(6,36,0) ;W - Home
            Endif
         Endif
      Endif

      If dx==0 AND dy<>0 Then
         If dy>0 Then
            StepSucess=Go(4,35,0) ;S - End
            If StepSucess==-1 Then
               StepSucess=Go(3,40,0) ;SE - DownArrow
               If StepSucess==-1 Then
                  StepSucess=Go(5,37,0) ;SW - LeftArrow
               Endif
               StepSucess=Go(4,35,0) ;S - End
            Endif
         Endif
         
         If dy<0 Then
            StepSucess=Go(0,33,0) ;N - PgUp
            If StepSucess==-1 Then
               StepSucess=Go(1,39,0) ;NE - RightArrow
               If StepSucess==-1 Then
                  StepSucess=Go(7,38,0) ;WN - UpArrow
               Endif
               StepSucess=Go(0,33,0) ;N - PgUp
            Endif
         Endif
      Endif
   Wend
end sub
###############################################################
sub Go(dir,key,walkwait)
   VAR x,y, OldDir
   x=UO.GetX()
   y=UO.GetY()
   OldDir=UO.GetDir()
   If UO.GetDir()<>dir Then
      UO.Press(key)
      wait(walkwait)
      If UO.GetDir()<>dir Then
         CheckLag()
      Endif
   Endif
   UO.Press(key)
   wait(walkwait)
   If x==UO.GetX() AND y==UO.GetY() Then
      CheckLag()
   Endif
   If x==UO.GetX() AND y==UO.GetY() AND OldDir<>UO.GetDir() Then
      UO.Press(key)
      wait(walkwait)
   Endif
   If x==UO.GetX() AND y==UO.GetY() Then
      CheckLag()
   Endif
      If x==UO.GetX() AND y==UO.GetY() Then
      UO.Print("Zasada!")
      return -1
   Else
      return 1
   Endif
end sub

Sub ToHide()
VAR fail = "You can't seem to hide here."
  If UO.Hidden() Then
    UO.Print( 'Hidden!' )
  Else
    UO.Print( 'Now Hiding...' )
    StartHide:
      UO.WarMode(0)
      UO.UseSkill( 'Hiding' )
      UO.DeleteJournal()
        Repeat
          If UO.InJournal( fail ) Then
            GoTo StartHide
          Else
            Wait(100)
          EndIf
        Until UO.Hidden()
    UO.Print( 'Hidden!' )
  EndIf
end sub
omi4
Posts: 457
Joined: 2005-07-10 21:53:05

Post by omi4 »

flake Вот процедура которую добавил ты.

Code: Select all

Sub ToHide() 
   VAR fail = "You can't seem to hide here."
   If UO.Hidden() Then
      UO.Print( 'Hidden!' )
   Else
      UO.Print( 'Now Hiding...' )
StartHide:
      UO.WarMode(0)
      UO.UseSkill( 'Hiding' )
      UO.DeleteJournal()
      Repeat
         If UO.InJournal( fail ) Then
            GoTo StartHide
         Else
            Wait(100)
         EndIf
      Until UO.Hidden()
      UO.Print( 'Hidden!' )
   EndIf
end sub


ошибки
1) двойная проверка не спрятался. UO.InJournal( fail ) и UO.Hidden()
2) пауза на уход в хайд отсутствует Wait(100) маловато даже для ГМ
3) UO.DeleteJournal() сотрет все сообщения. А их ждет основной скрипт
а) Убери журнал совсем
б) Оставь, но лови по You have и не три его
в) Три выборочно

Вот пример

Code: Select all

sub F_Play_Hide()
   UO.WarMode(0)
   while not UO.Hidden()
      UO.Print('Сейчас заныкаюсь наглухо.......пусть поищут.')
      UO.UseSkill('Hiding')
      repeat
         wait(100)
      until UO.InJournal("You have|You can")
      F_DeleteJournal("You have")
      F_DeleteJournal("You can")
   wend
   wait(100)
end sub

Sub F_DeleteJournal( string1 )
   VAR nom = UO.InJournal( string1 )
   If nom > 0 Then
      UO.SetJournalLine( Nom - 1, 'string replaced' )
      F_DeleteJournal( string1 )
   Endif
endsub
flake
Expert!
Posts: 746
Joined: 2004-08-11 23:56:17
Location: The Citadel
Contact:

Post by flake »

Омычь, это не ошибки. Я прекрасно пользуюсь этой процедурой.
Проблема в его совместимости с конкретным скриптом из-за журнала.
omi4
Posts: 457
Joined: 2005-07-10 21:53:05

Post by omi4 »

Спорить не буду…. Просто смотри ниже.
Не нужно обижаться, нужно учится.
А не ошибается только тот, кто нечего не делает

----------- >8 -------------------

Code: Select all

   UO.Exec('warmode 0')
   ToHide() ; <<<--- сюда так как каждый тырк по земле тут и журнал еще не нужен
   UO.WaitTargetTile("1341",STR(UO.GetX()+x),STR(UO.GetY()+Y),str(z))
   UO.UseType('0x0E85')

----------- >8 -------------------

Code: Select all

sub ToHide()
   UO.DeleteJournal()
   If not UO.Hidden() then
      UO.UseSkill('Hiding')
      repeat
         wait(100)
      until UO.InJournal("You have") or UO.InJournal("You can")
      ToHide()
   Endif
endsub
Last edited by omi4 on 2005-07-28 01:17:28, edited 1 time in total.
flake
Expert!
Posts: 746
Joined: 2004-08-11 23:56:17
Location: The Citadel
Contact:

Post by flake »

Не, не нравиться мне так.
Твой вариант хуже, т.к. он может повторно начать хайдиться, если чар схайдиться через несколько мили-секунд после вейта, т.к. цикл Repeat опять запустит действие в цикле (юзание скила) и чар вылетит из хайда.
У меня такое случалось, не редко.
omi4
Posts: 457
Joined: 2005-07-10 21:53:05

Post by omi4 »

честно сказать не в первом ни во втором варианте цикла repeat я не вижу…….

Code: Select all

sub ToHide() 
   UO.DeleteJournal()
   If not UO.Hidden() then ; спрятан ?
      UO.UseSkill('Hiding')  ; прячим
; ----------------динамическая пауза. Ждем УРА или ЕПТ-------------
      repeat                                                    ;\
         wait(100)                                              ; |
      until UO.InJournal("You have") or UO.InJournal("You can") ;/
; -----------------------------------------------------------------
      ToHide(); все с начала. Но если спрятан то if не даст юзать скил
   Endif ;
endsub
так нам не страшен ни вордсейв ни что другое. Процедура не зависима от скилла
можно еще добавить UO.WarMode(0). Вдруг в нас кинут чем….
Last edited by omi4 on 2005-07-28 01:18:09, edited 1 time in total.
flake
Expert!
Posts: 746
Joined: 2004-08-11 23:56:17
Location: The Citadel
Contact:

Post by flake »

А всё ок, я не внимательно смотрел.
Sfagnum
Expert!
Posts: 1284
Joined: 2004-07-04 00:14:58
Contact:

Post by Sfagnum »

побаиваюсь в инже юзать рекурсию... посему пользую вот:

Code: Select all

Sub ToHide()
   while not UO.Hidden()
      UO.WarMode(0)
      UO.UseSkill('Hiding')
      repeat
         wait(200)
      until UO.InJournal('You have hidden') OR UO.InJournal('seem to hide') OR UO.InJournal('preocopured') or UO.Dead()
   wend
end sub
omi4
Posts: 457
Joined: 2005-07-10 21:53:05

Post by omi4 »

Sfagnum wrote:побаиваюсь в инже юзать рекурсию... посему пользую вот:

Code: Select all

Sub ToHide()
   while not UO.Hidden()
      UO.WarMode(0)
      UO.UseSkill('Hiding')
      repeat
         wait(200)
      until UO.InJournal('You have hidden') OR UO.InJournal('seem to hide') OR UO.InJournal('preocopured') or UO.Dead()
   wend
end sub


журнал надо бы почистить....

я и так и так показал
Sfagnum
Expert!
Posts: 1284
Joined: 2004-07-04 00:14:58
Contact:

Post by Sfagnum »

omi4 wrote:
Sfagnum wrote:побаиваюсь в инже юзать рекурсию... посему пользую вот:

Code: Select all

Sub ToHide()
   while not UO.Hidden()
Checklag()
      UO.WarMode(0)
      UO.UseSkill('Hiding')
      repeat
         wait(200)
      until UO.InJournal('You have hidden') OR UO.InJournal('seem to hide') OR UO.InJournal('preocopured') or UO.Dead()
   wend
end sub


журнал надо бы почистить....

я и так и так показал
угум... точно... Checklag() у мну просто стоял тут
Post Reply