Lumberjacking scripts?

Anything and all.

Moderators: Murderator+, Murderator

Post Reply
Greyhound_Killer
Posts: 1
Joined: 2004-04-20 21:32:16

Lumberjacking scripts?

Post by Greyhound_Killer »

I tried to use this lumberjacking script:

Code: Select all

#============================================================== 
#  lj() - LumberJacking
#
#  Journal has been deleted!!!
#--------------------------------------------------------------
sub lj()
   UO.Exec('exec alarm')
   while NOT UO.Dead()
      lj1()
      lj2()
      lj3()
   wend
end sub


sub lj1()
   VAR ct=1,StepCount
   DIM dbX[6],deX[6],dbY[6],deY[6],Dir[6]

;----- InitTrack-----
   dbX[1]=2078
   deX[1]=2078
   dbY[1]=2082
   deY[1]=2139
   Dir[1]=1

   dbX[2]=2086
   deX[2]=2086
   dbY[2]=2130
   deY[2]=2087
   Dir[2]=-1
   
   dbX[3]=2094
   deX[3]=2094
   dbY[3]=2073
   deY[3]=2133
   Dir[3]=1
   
   dbX[4]=2102
   deX[4]=2102
   dbY[4]=2130
   deY[4]=2096
   Dir[4]=-1

   dbX[5]=2102
   dbY[5]=2096

;--------------------
   mrecal(0x400ACC97) ; start position

   for ct=1 to 4
      repeat
         tohide()
         chopit(278,171,6)
         chopit(362,253,2)
         StepCount=1
         while UO.GetY()<>deY[ct] AND StepCount<=3
            walk(0,1*Dir[ct],0)
            StepCount=StepCount+1
         wend
      until UO.GetY()==deY[ct]
      walk(dbX[ct+1]-deX[ct],dbY[ct+1]-deY[ct],0)
   next
   mrecal(0x4008B896) ; home
   logunload()
end sub


sub lj2()
   VAR ct=1,StepCount
   DIM dbX[6],deX[6],dbY[6],deY[6],Dir[6]

;----- InitTrack-----
   dbX[1]=3382
   deX[1]=3382
   dbY[1]=426
   deY[1]=474
   Dir[1]=1

   dbX[2]=3374
   deX[2]=3374
   dbY[2]=474
   deY[2]=502
   Dir[2]=1
   
   dbX[3]=3366
   deX[3]=3366
   dbY[3]=516
   deY[3]=484
   Dir[3]=-1
   
   dbX[4]=3358
   deX[4]=3358
   dbY[4]=510
   deY[4]=432
   Dir[4]=-1

   dbX[5]=3358
   dbY[5]=432

;--------------------
   mrecal(0x4008B064) ; start position

   for ct=1 to 4
      repeat
         tohide()
         chopit(278,171,6)
         chopit(362,253,2)
         StepCount=1
         while UO.GetY()<>deY[ct] AND StepCount<=3
            walk(0,1*Dir[ct],0)
            StepCount=StepCount+1
         wend
      until UO.GetY()==deY[ct]
      walk(dbX[ct+1]-deX[ct],dbY[ct+1]-deY[ct],0)
   next
   mrecal(0x4008B896) ; home
   logunload()
end sub


sub lj3()
   VAR ct=1,StepCount
   DIM dbX[6],deX[6],dbY[6],deY[6],Dir[6]

;----- InitTrack-----
   dbX[1]=3266
   deX[1]=3266
   dbY[1]=261
   deY[1]=326
   Dir[1]=1

   dbX[2]=3258
   deX[2]=3258
   dbY[2]=378
   deY[2]=250
   Dir[2]=-1
   
   dbX[3]=3246
   deX[3]=3246
   dbY[3]=219
   deY[3]=310
   Dir[3]=1
   
   dbX[4]=3238
   deX[4]=3238
   dbY[4]=315
   deY[4]=348
   Dir[4]=1

   dbX[5]=3238
   dbY[5]=348

;--------------------
   mrecal(0x4008B06A) ; start position
   for ct=1 to 4
      repeat
         tohide()
         chopit(278,171,6)
         chopit(362,253,2)
         StepCount=1
         while UO.GetY()<>deY[ct] AND StepCount<=3
            walk(0,1*Dir[ct],0)
            StepCount=StepCount+1
         wend
      until UO.GetY()==deY[ct]
      walk(dbX[ct+1]-deX[ct],dbY[ct+1]-deY[ct],0)
   next
   mrecal(0x4008B896) ; home
   logunload()
end sub


sub chopit(ChopX,ChopY,Dir)
   VAR LastTimer,WaitTime=90, Last=0, Exit
   VAR MaxWeight=800
   VAR ChopCount, MaxChopCount=100

   if UO.Weight>MaxWeight then
      unload()
   endif
   
   ChopCount=0
   repeat
      Exit=0
      CheckLag()
      If Last then
         UO.WaitTargetTile('lasttile')
         UO.UseType('0x0F43') ; hatchet
      Else
         UO.UseType('0x0F43') ; hatchet
         wait(400)
         UO.LClick(ChopX,ChopY)
         Last=1
      endif
       
      wait(1000)
       
      If UO.GetDir()==Dir Then
         LastTimer=UO.Timer()
         while NOT UO.InJournal("You put") AND NOT UO.InJournal("You hack") AND NOT UO.InJournal("There are no") AND NOT UO.InJournal("That is too") AND NOT UO.InJournal("It appears") AND NOT UO.InJournal("You can") AND NOT LastTimer+WaitTime<UO.Timer()
            wait(100)
         wend
       
         If LastTimer+WaitTime<UO.Timer() Then
            Exit=1
         Endif
       
         if UO.InJournal("You hack") then
            repeat
               wait(100)
            until UO.InJournal("You put") OR LastTimer+WaitTime<UO.Timer()
         endif
         ChopCount=ChopCount+1
      Else
         Exit=1
      Endif
       
   until UO.InJournal("There are no") OR UO.InJournal("That is too") OR UO.InJournal("It appears") OR UO.InJournal("You can") OR ChopCount>=MaxChopCount OR Exit==1
end sub


sub unload()
   VAR TempRune=0x4008B061
markrune:
   CheckLag()
   UO.WaitTargetObject(TempRune)
   UO.Cast('Mark')
   wait(4000)
   If UO.InJournal("spell fizzles") then
      goto markrune
   endif   
   mrecal(0x4008B896) ; home
   logunload()
   mrecal(TempRune)
end sub


sub logunload()
   UO.SetReceivingContainer('0x40082EBA')
   wait(500)
begin:
   UO.FindType('0x1BDD') ; logs
   if UO.GetQuantity('finditem')>0 then
      UO.Grab('0','finditem')
      wait(800)
      goto begin
   endif
   UO.UnSetReceivingContainer()
end sub


sub mrecal(rune)
   repeat
      CheckLag()
      UO.WaitTargetObject(rune)
      UO.Cast('Recal')
      wait(4000)
   until NOT UO.InJournal("spell fizzles")

markrune:
   If UO.InJournal("fades completely")   then
      CheckLag()
      UO.WaitTargetObject(rune)
      UO.Cast('Mark')
   endif
   wait(4000)
   If UO.InJournal("spell fizzles") then
      goto markrune
   endif
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()
   VAR CharHP=150
   while NOT UO.Hidden()
      UO.DeleteJournal()
      UO.FindType('0x0F0E','0x0631','my')

      if UO.Life<CharHP AND UO.FindCount() then
         UO.UseType('0x0F0E','0x0631') ; inviz potion
         wait(2000)
      else
         UO.Exec('warmode 0')
         UO.UseSkill('Hiding')
         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(50)
   until UO.InJournal('backpack')
end sub


#==============================================================
#  Gong(counter) - playing wav-file 'counter'-times
#--------------------------------------------------------------
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


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


#==============================================================
#  Walk(dX,dY) - char is walking by dX and dY step
#                sub using Home, End, PgUp, PgDown keys
#                d'not rebind this key from default action!
#
#           dX - W->E direction of walking
#          -dX - W<-E direction of walking
#           dY - N->S direction of walking
#          -dY - N<-S direction of walking
#     walkwait - delay after keypress
#--------------------------------------------------------------
sub Walk(dx,dy,Check)
   VAR i, walkwait=300
   VAR DestX,DestY

   DestX=UO.GetX()+dx
   DestY=UO.GetY()+dy
   
   while DestX<>UO.GetX()
      dx=DestX-UO.GetX()
      If dx<>0 then
         If dx>0 then
            If UO.GetDir()<>2 then
               UO.Press(34)
               wait(walkwait)
               If Check Then
                  CheckPause()
               Endif
            Endif
            For i=1 to dx
               UO.Press(34)
               wait(walkwait)
               If Check Then
                  CheckPause()
               Endif
            next
         Else
            If UO.GetDir()<>6 then
               UO.Press(36)
               wait(walkwait)
               If Check Then
                  CheckPause()
               Endif
            Endif
            For i=1 to dx*-1
               UO.Press(36)
               wait(walkwait)
               If Check Then
                  CheckPause()
               Endif
            next
         Endif
      Endif
      If Check Then
         CheckPause()
      Endif
   wend
   
   while DestY<>UO.GetY()
      dy=DestY-UO.GetY()
      If dy<>0 then
         If dy>0 then
            If UO.GetDir()<>4 then
               UO.Press(35)
               wait(walkwait)
               If Check Then
                  CheckPause()
               Endif
            Endif
            For i=1 to dy
               UO.Press(35)
               wait(walkwait)
               If Check Then
                  CheckPause()
               Endif
            next
         Else
            If UO.GetDir()<>0 then
               UO.Press(33)
               wait(walkwait)
               If Check Then
                  CheckPause()
               Endif
            Endif
            For i=1 to dy*-1
               UO.Press(33)
               wait(walkwait)
               If Check Then
                  CheckPause()
               Endif
            next
         Endif
      endif
      If Check Then
         CheckPause()
      Endif
   wend       
end sub


But I really don't get it... for the init track I have to setup the coordinates right? I tried to but it dosn't do shit.. can anyone help?
Aceton
Posts: 13
Joined: 2004-05-13 15:59:12
Contact:

Post by Aceton »

Хотелось бы получить коментарии... Как настроить эту бадягу ? Что тут надо сделать ?
Post Reply