Исправти!

Anything and all.

Moderators: Murderator+, Murderator

Locked
kAkTyC
Posts: 11
Joined: 2006-12-15 23:31:23
Contact:

Исправти!

Post by kAkTyC »

Простите за то что я вам наговорил больше так не буду исправлючь!
Помогите со скриптом,он не стого несчего просто отрубается без всяких ошибок просто отключяется в чём дело подскажите??

Code: Select all

sub main()
     while not uo.dead()
          Mining()
     wend
end sub

sub Mining()
     VAR MaxWeight=800 ; vash maksimal'niy ves
     VAR UnloadBox='0x40260661' ; ID containera
     VAR UnloadBag='0x401AF775' ; ID Meshka
     VAR Lopata='0x403E8D03' ; ID kirki&lopati
     VAR Timer=0
     
     VAR MyX, MyY, MyZ, i, j,t=false
     
     MyX = UO.GetX()
     MyY = UO.GetY()
     MyZ = UO.GetZ()
     
     Wait(1500)
     UO.TextOpen()
     UO.TextPrint('Script start '+MakeTime())
     for i = -4 to 4
          for j = -3 to 4
               repeat
                    uo.deletejournal()
                    UO.Waittargettile("6044", str(myx+i), str(myy+j), str(myz))
                    UO.UseObject(Lopata)
                    Timer = UO.Timer()
                    while not UO.InJournal("You put") and not UO.InJournal("location") and not UO.InJournal("no ore") and not UO.InJournal("but fail") and not UO.InJournal("far away") and not UO.InJournal("in rock") and not UO.InJournal("OOPS") and not UO.InJournal("attacking you") and not UO.InJournal("no line") and Timer + 1200 > UO.Timer()
                         wait(300)
                    wend
                    If UO.InJournal('Elemental') then
                         uo.playwav("C:\WINDOWS\Media\tada.wav")
                         UO.TextPrint('Elemental founded '+MakeTime())
                         uo.closeuo()
                         repeat
                              wait(1200)
                         until UO.InJournal('go')
                         UO.TextPrint('Back to script '+MakeTime())
                    End If
                    if UO.InJournal("but fail") then
                         if t then
                              wait(1200)
                              t = false
                         else
                              t = true
                         end if
                    else
                         t = false
                    end if
               until not UO.InJournal("but fail")
               If UO.Weight>MaxWeight then
                    WalkN(0,0,UnloadBox)
                    Unload(UnloadBag)
                    WalkN(MyX,MyY,'')
               End if
          next
     next
end sub

sub Unload(UnloadBox)
     VAR Exit,i
     DIM Ore[4]
     Ore[0]='0x19B7' ; 1 ore
     Ore[1]='0x19BA' ; 2 ore
     Ore[2]='0x19B8' ; 3 ore
     Ore[3]='0x19B9' ; 4 and more ore
UO.SetReceivingContainer(UnloadBox)
UO.TextPrint('Unload '+MakeTime())
     For i=0 to 3
          Exit=0
          While Exit<>1
               UO.FindType(Ore[i])     
               If UO.GetQuantity('finditem')>0 then
                    UO.Grab('all','finditem')
                    CheckLag()
                    Wait(1200)
               Else
                    Exit=1
               Endif
          Wend
     Next
     UO.UnSetReceivingContainer()
     end sub
     
Sub ToHide()
     While NOT UO.Hidden()
          UO.DeleteJournal()
          UO.Exec('warmode 0')
          UO.UseSkill('Stealth')
          Repeat
               Wait(300)
          Until UO.InJournal('You have hidden') OR UO.InJournal('seem to hide') OR UO.InJournal('preoccupied') OR UO.Dead()
     Wend
end sub

Sub CheckLag()
   UO.DeleteJournal()
   UO.Click('backpack')
   repeat
      Wait(50)
   until UO.InJournal('backpack')
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(5136,1276,'') - 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 
          ToHide()
      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,300) ;SE - DownArrow
            If StepSucess==-1 Then
               StepSucess=Go(7,38,300) ;WN - UpArrow
               StepSucess=Go(1,39,300) ;NE - RightArrow
               If StepSucess==-1 Then
                  StepSucess=Go(5,37,300) ;SW - LeftArrow
               Endif
            Endif
         Endif

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

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

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

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


      If dx==0 AND dy<>0 Then
         If dy>0 Then
            StepSucess=Go(4,35,300) ;S - End
            If StepSucess==-1 Then
               StepSucess=Go(3,40,300) ;SE - DownArrow
               If StepSucess==-1 Then
                  StepSucess=Go(5,37,300) ;SW - LeftArrow
               Endif
               StepSucess=Go(4,35,300) ;S - End
            Endif
         Endif
         
         If dy<0 Then
            StepSucess=Go(0,33,300) ;N - PgUp
            If StepSucess==-1 Then
               StepSucess=Go(1,39,300) ;NE - RightArrow
               If StepSucess==-1 Then
                  StepSucess=Go(7,38,300) ;WN - UpArrow
               Endif
               StepSucess=Go(0,33,300) ;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 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.Exec('terminate BowCraft_torch')
wait(1000)
UO.Exec('exec BowCraft_torch')
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


Можете ещё вставить пожайлусто в этот скрипт чтобы када выкапывал элеметателя пил инвизку и на этого элеметателя All kill када убьёт дракон эльку подходить брать металл и капать дальше!
Mihail
Expert!
Posts: 548
Joined: 2005-05-20 20:30:10
Contact:

Post by Mihail »

учитывая весь твой базар "простите я больше так не буду" не катит.. - ты же будешь..
посему.. иди нах.. и без wmz обратно не приходи :)

--edit
*почитал его посты*
не, все-таки перефразирую..
иди <в поиск> [ymd] , и без лавэ не возвращайся..
kAkTyC
Posts: 11
Joined: 2006-12-15 23:31:23
Contact:

Post by kAkTyC »

Яже извенился!! ты позореш ёко тут должны помогать а не то что ыт едлаеш))


ymd:

1. Причём здесь Yoko?
2. Сначала зделай хоть что-то сам, а затем критикуй других.
666||TORCHKI
Posts: 257
Joined: 2006-11-14 16:19:03
Contact:

Post by 666||TORCHKI »

ЫЫЫЫ
*РЖУ НЕ МОГУ*
Mihail
Expert!
Posts: 548
Joined: 2005-05-20 20:30:10
Contact:

Post by Mihail »

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