Sodo's LJ 1.0

Discussion in 'Player Submitted Guides' started by SirSodo, Nov 14, 2015.

  1. SirSodo

    SirSodo Adept

    Joined:
    Sep 3, 2015
    Messages:
    430
    Likes Received:
    87
    Trophy Points:
    28
    Wrote an LJ macro tonight. It chops the direction you are facing, so face the tree. If the tree is on a different Z axis (higher or lower ground than you) it probably won't work, sorry! It's currently set to chop the tree 3 times in a row, if you want one change for 3 to for 1, or if you want 5 to for 5, etc.

    Pack llamas = 1560
    Pack bears = 2360

    Throw a chopping tool in your left hand and hit play!

    Edit: Macro now continues to chop until you get a macrocheck gump. Then it waits 2 seconds for you to gather wood. Previously it'd let you machine gun it out, but that just wastes trees since you weren't getting resources.
    Code:
    /////////////////////////////
    // Sodo's Lumberjacker 1.5 //
    // Must be facing the tree //
    // Must have Axe in hand   //
    // Tree must be on same Z  //
    /////////////////////////////
    if not @inrange 'Pack1' 9
      promptalias 'Pack1'
    endif
    if not @inrange 'Pack2' 9
      promptalias 'Pack2'
    endif
    if not timerexists 'packwarn'
      createtimer 'packwarn'
    endif
    while not dead
      // Uses Axe in hand
      if not @useobject 'lefthand'
        // If no axe in hand tries to find hatchet
        if not @findtype 0xf43 'any' 'backpack'
          headmsg "No axe in left hand"
          stop
        endif
        // Arms hatchet and uses it
        equipitem 'found' 2
        pause 650
        @useobject 'lefthand'
      endif
      waitfortarget 550
      // Targets the tile you are facing. If the tree is higher/lower than you it won't work
      targettilerelative self 1
      pause 1300
      // Waits until you've clicked the macrocheck gump
      if @gumpexists 0x47d09e42
        while @gumpexists 0x47d09e42
          pause 100
        endwhile
        pause 2200
      endif
      // Turns Logs into boards
      if @findtype 0x1bdd 'any' 'backpack'
        useobject 'lefthand'
        waitfortarget 500
        target! 'found'
        pause 700
      endif
      // Is pack1 inrange and not full?
      if counttype 0x1bd7 'any' 'Pack1' < 2360 and @inrange 'Pack1' 2
        // If yes then move boards to pack1
        if @movetype 0x1bd7 'backpack' 'Pack1'
          pause 700
        endif
      elseif counttype 0x1bd7 'any' 'Pack2' < 2360 and @inrange 'Pack2' 2
        if @movetype 0x1bd7 'backpack' 'Pack2'
          pause 700
        endif
        // If there are boards in your bag but you can't move them
      elseif counttype 0x1bd7 'any' 'backpack' > 0
        // Only gives warning once every 30s
        if timer 'packwarn' > 30000
          headmsg "Packs full or too far!" '32'
          settimer 'packwarn' 0
        endif
      endif
    endwhile
    
     
    Last edited: Jan 23, 2016
    karazon and ArborTheTree like this.
  2. SirSodo

    SirSodo Adept

    Joined:
    Sep 3, 2015
    Messages:
    430
    Likes Received:
    87
    Trophy Points:
    28
    Modified for pack bears and a few other small tweaks. Would you guys prefer it pause when a macro check pop up? Or does it run fine as is. I tried it with the pause and I didn't like it. Either way, if you want it edit out the // after pause 1200 for the gumpexists portion.
    Edit: Use newest version
     
    Last edited: Dec 31, 2015
  3. SirSodo

    SirSodo Adept

    Joined:
    Sep 3, 2015
    Messages:
    430
    Likes Received:
    87
    Trophy Points:
    28
    Remade it so it'll continue to chop trees until it finds logs in your pack.

    Edit: Apparently if you try to LJ again before the logs show up in your pack you don't get more logs... Added a wait in there to make sure you're not wasting trees. Best macro in OP
     
    Last edited: Dec 31, 2015
  4. SirSodo

    SirSodo Adept

    Joined:
    Sep 3, 2015
    Messages:
    430
    Likes Received:
    87
    Trophy Points:
    28
    Big thanks for BlackTea for pointing out my mistake, macro in OP works most efficiently.
     
    ArborTheTree likes this.
  5. SirSodo

    SirSodo Adept

    Joined:
    Sep 3, 2015
    Messages:
    430
    Likes Received:
    87
    Trophy Points:
    28
    updated to be a little cleaner
     

Share This Page