[EasyUO] Auto logging script

If you make a Client-side script you can publish it here for other players to use
Locked
ticketguru
Grandmaster Scribe
Posts: 99
Joined: Fri Jun 12, 2009 11:25 pm

[EasyUO] Auto logging script

Post by ticketguru »

I took this script from the EasyUO forum and modified it for the custom wood types on Excelsior and added Blaze's base routine for loading the logs onto keys. All the credit needs to go to the original scriptor, Ending.

This is a real sweet script that has a nice display window that will keep count of the wood that is logged. Just start the script and walk from tree to tree, targeting each. When your pack is full, it will load the logs to keys if you have them, or turn them into boards and load onto a packey. (Thank you Blaze for the crafting key routine)

Please post any comments or problems and I will see what I can do to fix the issues.

Code: Select all

;========================================
; Script Name: Ending's LumberHacker
; Author: ending - updated by Ticketguru for Excelsior
; Version: 5.3.2
; Client Tested with: 5.0.9
; EUO version tested with: 1.5 TV 149
; Shard OSI / FS: Excelsior FS
; Revision Date: 29Jul09
; Public Release: 28Oct04
; Purpose: Free hand lumberjacking with beetle support and keys
;========== UPDATES =======================
;v5.3.2 - Added wood keys support (thanks Blaze Budd)
;         Updated bugtypes to include mules and rideable pack llamas
;v5.3.1 - Replaced #sysmsg scanning with journal scanning
;v5.3.0 - Updated for Excelsior shard with custom wood types
;v5.2.1 - Fixed dismount sub, fixed scan sub, corrected the status
;       display when the packy is full.
;v5.2 - Allows support for packies.
;v5.1.2 - Fixed typos...thanks regs2.
;v5.1.1 - Fixed a typo, line 1 (gosub init) was commented out by
;       accident. This was the problem with it not recognizing axes.
;v5.1 - Fixed another Jscanning issue. Added in skill checking.
;v5.0 - Rewrite, again. Fixed journal scanning issues.
;v4.1 - Updated Object type IDs. Equips axe from backpack when needed.
;v4.0 - Reconstruction of script; rewritten for ML and EUO 1.5.
;v3.13 - No backpack positioning required.
;v3.12b - Updated wait times due to OSI's lag with SE and changed
;       full beetle resume from EUO to menu
;v3.12 - Fixed gump issues. Added pause/resume function and
;      changed the menu up a bit.
;v3.11 - Added in a Status section in the menu.
;v3.10 - Whole new menu added, big thanks to Tecmo for his
;      support and to Akilae for his testing and great
;      suggestions.
;v2.11 - Fixed loading beetle.
;v2.1 - Beetle support fixed, thanks Roadkill!
;v2.0 - Took subs out mostly so it wont dig down too far.
;v1.2b - Customized a few things, not really and large scale
;      changes.
;v1.2 - Added in tinkering of carpentry tools, supports wood tools
;     and ingot tools.
;v1.1b - Fixed the whole method of logs to boards, more efficient
;      and no one can steal the logs on the ground. Also
;      fixed lots of other misc. things.
;v1.1 - Added in chopping up the logs to boards.
;v1.0 - Up and running :)
;===========================================
;========== DON'T EDIT BELOW HERE ===========
gosub init
gosub showMenu
gosub setup
main:
     gosub settree
     gosub choptree
     goto main


sub setup
     set %status Checking , #spc , for , #spc , elf
     gosub changestatus
     event macro 8 2
     wait 20
     if #conttype = XU || #conttype = AV
        set %elf #true
     gosub updateTime
     gosub dismount new
     set %status Setting , #spc , up , #spc , bug , #spc , IDs
     gosub changestatus
     finditem %bugtypes G_3
     if #findkind = -1
     {
        display ok Can't find beetle/packy. Target it please.
        set #targcurs 1
        gosub usertargwait
        set %bugid #ltargetid
        finditem %bugid G_3
     }
     else
        set %bugid #findid
     set %bugtype #findtype
     set %bugbag %bugid
     wait 20
     gosub mount

     gosub findwoodkeys
return

sub findwoodkeys
_findwoodkeys:
  findItem NUI C_ , #backpackID
  if #findkind = -1
     return
  event property #findID
  if Wood in #property
  {
     set %keys #true
     set %keysid #findid
     return
  }
  ignoreitem #findID
  goto _findwoodkeys
return

sub usertargwait
     _usertargwait:
     gosub updateTime
     if #targcurs = 1
        goto _usertargwait
return

sub targwait
     set %curscnt #scnt
     _targwait:
     if #targcurs <> 1
     {
        if ( %curscnt + 5 ) < #scnt
           return timeout
        goto _targwait
     }
return

sub contwait
    set %curCont #contid
    _contchange:
    {
        if ( %curscnt + 5 ) < #scnt
           return timeout
        if %curCont = #contid
           goto _contchange
    }
return

sub gumpwait
    set %curscnt #scnt
    _gumpWait:
    if worn in #journal || worn in #sysmsg
       return
    if #CONTSIZE <> 530_437
       goto _gumpWait
    wait 5
return

sub statuscheck
    if #charname = n/a
    {
       event macro 8 2
       wait 20
    }
return

sub mount
    if %bugtype notin %bugtypes
       return
    _findmount:
    finditem %bugid G_16
    if #findkind = -1
    {
       display ok Cannot find mount, halting.
       halt
    }
    _mounttry:
    set #lobjectid %bugid
    event macro 17 0
    wait 10
    finditem %bugid G_3
    if #findkind <> -1
       goto _mounttry
    wait 10
return

sub dismount
    if %bugtype notin %bugtypes && %1 <> new
       return
    _dismount:
    set #lobjectid #charid
    event macro 17 0
    wait 20
    if %1 <> new
    {
       finditem %bugid G_3
       if #findkind = -1
          goto _dismount
    }
return

sub choptree
     gosub equipaxe
     set #lobjectid %axeid
     set #ltargetid %curTree
     while new notin #result
     {
          gosub updateTime

          _chop:
          set %status Chopping , #spc , tree
          gosub changestatus
          gosub checkButton
          gosub statuscheck
          gosub skillCheck
          if #weight >= #maxweight - 20
             gosub logs2boards
          set %status Chopping , #spc , tree
          gosub changestatus

          ; set journal position before chopping
          set %jcurrent #jIndex + 1
          set #lobjectid %axeid
          event macro 17 0
          gosub targwait
          event macro 22 0
          gosub journalscan
          if cut in #result
             gosub logs2boards
     }
return

sub settree
     gosub checkButton
     gosub statuscheck
     if #weight >= #maxweight - 20
        gosub logs2boards
     gosub updateTime
     gosub equipaxe
     set %status Setting , #spc , tree
     gosub changestatus
     set #lobjectid %axeid
     _retryselect:
     gosub checkButton
     event macro 17 0
     gosub usertargwait
     set %curTree #lobjectid
     gosub journalscan
     if cut in #result
     {
        gosub logs2boards
        goto _retryselect
     }
     if chop in #result {
        wait 30
        return
     }
     if new in #result || mustwait in #result
        goto _retryselect
return

sub equipaxe
     set %status Checking , #spc , for , #spc , axe
     gosub changestatus
     finditem %axes C_ , #charid
     if #findkind = -1
     {
        finditem %axes C_ , #backpackid
        if #findkind = -1
        {
           display ok Error: Cannot find axe. Halting.
           halt
        }
        set %axeid #findid
        set #lhandid #findid
        event macro 24 1
        wait 20
     }
     set %axeid #findid
return

sub journalscan
    set %status Scanning , #spc , journal...
    gosub changestatus
    scanwait:
    if %jcurrent > #jindex
    {
       wait 10
       goto scanwait
    }
    scanjournal %jcurrent
    if You_found_a_bark in #journal
    {
 	      set %bark %bark + 1
        gosub updatemenu bark
    }
    if You_found_a_parasitic_plant in #journal
    {
 	      set %plant %plant + 1
        gosub updatemenu plant
    }
    if You_found_a_luminescent in #journal
    {
     	   set %fungi %fungi + 1
     	   gosub updatemenu fungi
    }
    if You_found_a_switch in #journal
    {
     	   set %switch %switch + 1
     	   gosub updatemenu switch
    }
    if You_found_a_brilliant_amber in #journal
    {
     	   set %amber %amber + 1
     	   gosub updatemenu amber
    }
     if You_put_some_Regular in #journal
    {
       gosub checkLands
   	   set %normal %normal + %addamt
   	   gosub updatemenu ordinary
       return chop
    }
    if You_put_some_Pine in #journal
    {
   	   gosub checkLands
   	   set %pine %pine + %addamt
   	   gosub updatemenu pine
       return chop
    }
    if You_put_some_Ash in #journal
    {
   	   gosub checkLands
   	   set %ash %ash + %addamt
   	   gosub updatemenu ash
       return chop
    }
    if You_put_some_Mohogany in #journal
    {
   	   gosub checkLands
   	   set %mohogany %mohogany + %addamt
   	   gosub updatemenu mohogany
       return chop
    }
    if You_put_some_Yew in #journal
    {
   	   gosub checkLands
   	   set %yew %yew + %addamt
   	   gosub updatemenu yew
       return chop
    }
    if You_put_some_Oak in #journal
    {
   	   gosub checkLands
       set %oak %oak + %addamt
       gosub updatemenu oak
       return chop
    }
    if You_put_some_Zircote in #journal
    {
        gosub checkLands
        set %zircote %zircote + %addamt
        gosub updatemenu zircote
        return chop
    }
    if You_put_some_Ebony in #journal
    {
        gosub checkLands
        set %ebony %ebony + %addamt
        gosub updatemenu ebony
        return chop
    }
    if You_put_some_Bamboo in #journal
    {
        gosub checkLands
        set %bamboo %bamboo + %addamt
        gosub updatemenu bamboo
        return chop
    }
    if You_put_some_Purple in #journal
    {
        gosub checkLands
        set %purpleh %purpleh + %addamt
        gosub updatemenu purpleh
        return chop
    }
    if You_put_some_Redwood in #journal
    {
        gosub checkLands
        set %redwood %redwood + %addamt
        gosub updatemenu redwood
        return chop
    }
    if You_put_some_Petrified in #journal
    {
        gosub checkLands
        set %petrified %petrified + %addamt
        gosub updatemenu petrified
        return chop
    }
    if you_hack in #journal
       return chop
    if You_must_wait in #journal
       return mustwait
    if you_can't_place in #journal
       return cut
    if that_is_too_far in #journal || Target_cannot_be_seen in #journal || You_can't_use_an_axe_on_that in #journal || That_is_not_accessible in #journal || not_enough_wood_here in #journal
       return new
    set %jcurrent %jcurrent + 1
    goto scanwait
return

sub checkLands
    set %addamt 10
;    if %elf = #true
;       set %addamt 10
    if #curskind = 0
       set %addamt %addamt * 2
return

sub skillCheck
    if %currentSkill < #skill
    {
        set %currentSkill #skill
    		set %Gains %Gains + 1
    		set %skillGain %currentSkill - %startingskill
    		menu Font Name Arial
    		menu Font Style
    		menu Font Size 8
    		menu Font Color Lime
    		menu Font Transparent #true
    		menu Font BGColor Black
    		menu delete currentSkill
    		menu delete skillGain
    		menu delete gains
    		menu Text currentSkill 314 176 %currentSkill
    		menu Text skillGain 314 191 %skillGain
    		menu Text gains 314 206 %gains
    		menu Delete status
    		menu Font Color Red
    		menu Text status 91 87 Skill gain!
    		wait 10
    }
return

sub logs2boards
    set %status Cutting , #spc , logs , #spc ,  to , #spc , boards
    gosub changestatus

    ; addd to use keys 7/29/2009
    if %keys = #true
    {
       gosub woodKeys
       gosub unloadtobug
       return
    {
    
    menu Get cutLogs
    if #menuRes = #false
    {
       gosub unloadtobug
       return
    }
    wait 30
    _logs2boards:
    finditem ZLK C_ , #backpackid
    if #findkind = -1
    {
       ignoreitem reset 1
       gosub unloadtobug
       return
    }
    set %curWood #findcol
    set %curlogs #findid
    findItem KGG_EGG_AGG_IGG_BIG_ZHG_WFG_YFG_XFG C_ , #backpackid
    if #findkind = -1
    {
       display ok No carp tools, pausing.
       gosub pauseScript
       goto _logs2boards
    }
    set #lobjectid #findid
    _carpretry:
    gosub checkButton
    event macro 17 0
    gosub gumpwait
    if timeout in #result
       goto _carpretry
    gosub calcClicks
    click %woodtypex %woodtypey
    wait 5
    if %curWood = %normalCol
       click %woodx %woody
    if %curWood = %pineCol
       click %woodx %piney
    if %curWood = %ashCol
       click %woodx %ashy
    if %curWood = %mohoganyCol
       click %woodx %mohoganyy
    if %curWood = %yewCol
       click %woodx %yewy
    if %curWood = %oakCol
       click %woodx %oaky
    if %curWood = %zircoteCol
       click %woodx %zircotey
    if %curWood = %ebonyCol
       click %woodx %ebonyy
    if %curWood = %bambooCol
       click %woodx %bambooy
    if %curWood = %purplehCol
       click %woodx %purplehy
    if %curWood = %redwoodCol
    {
       click %nexttypex %nexttypey
       wait 5
       click %woodx %redwoody
    }
    if %curWood = %petrifiedCol
    {
       click %nexttypex %nexttypey
       wait 5
       click %woodx %petrifiedy
    }
    gosub gumpWait
    if timeout in #result
       goto _carpretry
    click %othermenux %othermenuy
    gosub gumpWait
    if timeout in #result
       goto _carpretry
    click %boardmenux %boardmenuy
    gosub gumpwait
    click %exitx %exity
    ignoreitem %curlogs 1
    goto _logs2boards
return

sub unloadtobug
    gosub dismount
    _loadbeetle:
    wait 30
    finditem TLK_ZLK_NWS_YWS_XWS_BWR_FXS C_ , #backpackid
    if #findkind = -1
    {
       gosub mount
       wait 2s
       return
    }
    exevent drag #findid #findstack
    exevent dropc %bugbag
    wait 5
    if That_container_cannot_hold_more_weight. in #sysmsg
    {
       gosub mount
       set %status Paused , #spc , - , #spc , Beetle , #spc , full.
       gosub changestatus
       gosub pauseScript
    }
    goto _loadbeetle
return

sub calcClicks
    set %woodtypex #contposx + 30
    set %woodtypey #contposy + 375
    set %nexttypex #contposx + 500
    set %nexttypey #contposy + 270
    set %woodx #contposx + 235
    set %woody #contposy + 70
    set %piney #contposy + 90
    set %ashy #contposy + 110
    set %mohoganyy #contposy + 130
    set %yewy #contposy + 150
    set %oaky #contposy + 170
    set %zircotey #contposy + 190
    set %ebonyy #contposy + 210
    set %bambooy #contposy + 230
    set %purplehy #contposy + 250
    set %redwoody #contposy + 70
    set %petrifiedy #contposy + 90
    set %othermenux #contposx + 28
    set %othermenuy #contposy + 90
    set %boardmenux #contposx + 233
    set %boardmenuy #contposy + 70
    set %exitx #contposx + 30
    set %exity #contposy + 413
return

sub checkButton
    if #menubutton = pause
    {
       set %status Paused by user.
       gosub changestatus
       gosub pauseScript
    }
return

sub pauseScript
    menu Delete pause
    menu Font Name MS Sans Serif
    menu Font Size 8
    menu Font Color WindowText
    menu Font BGColor BtnFace
    menu Button resume 36 122 49 21 Resume
    set #menubutton n/a
    _pause:
    if #menubutton  = resume
    {
       menu Font Name Arial
       menu Font Style
       menu Font Size 8
       menu Font Color Lime
       menu Font Transparent #true
       menu Delete status
       menu Text status 91 87 Resuming...
       menu Delete resume
       menu Font Name MS Sans Serif
       menu Font Size 8
       menu Font Color WindowText
       menu Font BGColor BtnFace
       menu Button pause 36 122 49 21 Pause
       set #menubutton n/a
       return
    }
    wait 2 ;takes a load off the cpu
    gosub updateTime
    goto _pause
return

sub init
    set %version 5.3.2
   	set #menubutton n/a
    set %axes LSF_BSF_NFS_ZRF_RMH_LPH_UOH_FSF_OFR
    set %carpTools KGG_EGG_AGG_IGG_BIG_ZHG_WFG
    set %tinkerTools GTL_KTL_JTL
    set %bugtypes ZGB_GC_EG
    chooseSkill carp
    set %carpSkill #skill
    chooseSkill lumb
    set %startingSkill #skill
    set %currentSkill #skill
    set %starttime #scnt
    set %normal 0
    set %pine 0
    set %ash 0
    set %mohogany 0
    set %yew 0
    set %oak 0
    set %zircote 0
    set %ebony 0
    set %bamboo 0
    set %purpleh 0
    set %redwood 0
    set %petrified 0
    set %total 0
    set %bph 0
    set %skillGain 0
    set %gains 0
    set %bark 0
    set %amber 0
    set %switch 0
    set %plant 0
    set %fungi 0
    set #lobjectid
    set #ltargetid
    set #findid
    set %normalCol 0
    set %pineCol 1262
    set %ashCol 961
    set %mohoganyCol 355
    set %yewCol 1281
    set %oakCol 488
    set %zircoteCol 1271
    set %ebonyCol 43
    set %bambooCol 1152
    set %purplehCol 114
    set %redwoodCol 37
    set %petrifiedCol 1153
;    set %oakCol 2010
;    set %ashCol 1191
;    set %yewCol 1192
;    set %heartCol 1193
;    set %bloodCol 1194
;    set %frostCol 1151
     set %keys #false
return

sub updateTime
	set %time #scnt - %starttime
	set %seconds %time % 60
	set %minutes ( %time / 60 ) % 60
	set %hours %time / 3600

	if %seconds < 10
		 set %timeresult : , 0 , %seconds
	else
		set %timeresult : , %seconds
	if %minutes < 10
		set %timeresult : , 0 , %minutes , %timeresult
	else
		set %timeresult : , %minutes , %timeresult
	if %hours < 10
		set %timeresult 0 , %hours , %timeresult
	else
		set %timeresult %hours , %timeresult

	menu Font Transparent #true
	menu Font Name Arial
	menu Font Align Left
	menu Font BGColor None
	menu Font Color Lime
	menu Font Size 8
	menu Delete time
	menu Text time 155 125 %timeresult
return

sub updatemenu
    menu Font Name Arial
    menu Font Style
    menu Font Color Lime
    menu Font Size 8
    menu Font Transparent #true
    menu Font BGColor Black
    if %1 = bark
    {
       menu Delete bark
       menu Text bark 340 251 %bark
    }
    if %1 = plant
    {
       menu Delete plant
       menu Text plant 340 281 %plant
    }
    if %1 = fungi
    {
       menu Delete fungi
       menu Text fungi 340 266 %fungi
    }
    if %1 = switch
    {
       menu Delete switch
       menu Text switch 340 296 %switch
    }
    if %1 = amber
    {
       menu Delete amber
       menu Text amber 340 311 %amber
    }
    if %1 = ordinary
    {
       menu Delete normal
       menu Text normal 142 164 %normal
    }
    if %1 = pine
    {
       menu Delete pine
       menu Text pine 142 179 %pine
    }
    if %1 = ash
    {
       menu Delete ash
       menu Text ash 142 194 %ash
    }
    if %1 = mohogany
    {
       menu Delete mohogany
       menu Text mohogany 142 209 %mohogany
    }
    if %1 = yew
    {
       menu Delete yew
       menu Text yew 142 224 %yew
    }
    if %1 = oak
    {
       menu Delete oak
       menu Text oak 142 239 %oak
    }
    if %1 = zircote
    {
       menu Delete zircote
       menu Text zircote 142 254 %zircote
    }
    if %1 = ebony
    {
       menu Delete ebony
       menu Text ebony 142 269 %ebony
    }
    if %1 = bamboo
    {
       menu Delete bamboo
       menu Text bamboo 142 284 %bamboo
    }
    if %1 = purpleh
    {
       menu Delete purpleh
       menu Text purpleh 142 299 %purpleh
    }
    if %1 = redwood
    {
       menu Delete redwood
       menu Text redwood 142 314 %redwood
    }
    if %1 = petrified
    {
       menu Delete petrified
       menu Text petrified 142 329 %petrified
    }
    gosub updatetime
    set %total %normal + %pine + %ash + %mohogany + %yew + %oak + %zircote + %ebony + %bamboo + %purpleh + %redwood + %petrified
    set %bph %total * 3600 / %time
    menu Delete total
    menu Text total 142 351 %total
    menu Delete bph
    menu Text bph 142 375 %bph
return

sub changestatus
    menu Font Name Arial
    menu Font Style
    menu Font Color Lime
    menu Font Size 8
    menu Font Transparent #true
    menu Font BGColor Black
    menu Delete status
    menu Text status 91 87 %status
return

sub showMenu
    menu Clear
    menu Window Title LumberHacker for Excelsior
    menu Window Color Black
;    menu Window Size 409 335
    menu Window Size 409 409
    menu Font Transparent #true
    menu Font Align Right
    menu Shape EUOShape1 -128 -4 485 85 3 1 1 Black 7 3DDkShadow
    menu Shape EUOShape2 322 16 69 65 2 1 1 Black 7 3DDkShadow
    menu Shape EUOShape3 250 -28 141 81 3 1 1 Black 7 3DDkShadow
;    menu Shape EUOShape4 45 109 493 300 3 1 1 Black 7 3DDkShadow
    menu Shape EUOShape4 45 109 493 374 3 1 1 Black 7 3DDkShadow
    menu Shape EUOShape5 13 109 69 65 2 1 1 Black 7 3DDkShadow
    menu Shape EUOShape6 13 137 141 300 3 1 1 Black 7 3DDkShadow
    menu Shape EUOShape7 294 14 45 45 1 1 1 Black 7 White
    menu Shape EUOShape8 302 22 29 29 1 1 1 Black 7 3DDkShadow
    menu Shape EUOShape9 315 26 33 8 3 1 1 Black 7 White
;    menu Shape EUOShape10 35 153 169 177 4 7 1 Black 7 3DDkShadow
    menu Shape EUOShape10 35 153 169 251 4 7 1 Black 7 3DDkShadow
    menu Shape EUOShape11 217 150 178 81 4 7 1 Black 7 3DDkShadow
    menu Shape EUOShape14 217 241 178 89 4 7 1 Black 7 3DDkShadow
    menu Font Name Arial
    menu Font Size 14
    menu Font Style b
    menu Font Color Lime
    menu Font Align Left
    menu Font BGColor Black
    menu Text EUOLabel1 42 28 LumberHacker
    menu Font Size 8
    menu Text EUOLabel2 140 48 v
    menu Text EUOLabel3 148 48 %version
    menu Font Color Silver
    menu Text EUOLabel4 32 16 Operation:
    menu Text EUOLabel6 242 22 By:
    menu Font Size 14
    menu Font Color Fuchsia
    menu Text EUOLabel5 242 28 ticketguru
    menu Font Name MS Sans Serif
    menu Font Size 8
    menu Font Color WindowText
    menu Font Transparent #false
    menu Font BGColor 3DDkShadow
    menu Text EUOLabel35 238 235 Additional Resources
    menu Text EUOLabel23 55 147 Wood Information
    menu Text EUOLabel24 238 144 Skill Information
    menu Font Name Arial
    menu Font Style
    menu Font Color Fuchsia
    menu Font Transparent #true
    menu Font BGColor Black
    menu Text EUOLabel48 46 87 Status:
    menu Text EUOLabel7 48 164 Regular Wood:
    menu Text EUOLabel8 48 179 Pine:
    menu Text EUOLabel9 48 194 Ash:
    menu Text EUOLabel10 48 209 Mohogany:
    menu Text EUOLabel13 48 224 Yew:
    menu Text EUOLabel12 48 239 Oak:
    menu Text EUOLabel11 48 254 Zircote:
    menu Text EUOLabel9 48 269 Ebony:
    menu Text EUOLabel10 48 284 Bamboo:
    menu Text EUOLabel13 48 299 Purple Heart:
    menu Text EUOLabel12 48 314 Redwood:
    menu Text EUOLabel11 48 329 Petrified:
;    menu Text EUOLabel21 48 277 Total:
;    menu Text EUOLabel25 48 301 BPH:
    menu Text EUOLabel21 48 351 Total:
    menu Text EUOLabel25 48 375 BPH:
    menu Text EUOLabel27 233 161 Starting Skill:
    menu Text EUOLabel30 233 176 Current Skill:
    menu Text EUOLabel31 233 191 Skill Gain:
    menu Text EUOLabel34 233 206 Gains:
    menu Text EUOLabel37 234 251 Bark Fragments:
    menu Text EUOLabel38 234 266 Luminescent Fungi:
    menu Text EUOLabel39 234 281 Parasitic Plant:
    menu Text EUOLabel40 234 296 Switch:
    menu Text EUOLabel41 234 311 Brillant Amber:
    menu Text EUOLabel46 97 125 Run Time:
    menu Font Color Lime
    menu Text status 91 87 Initializing...
    menu Text normal 142 164 %normal
    menu Text pine 142 179 %pine
    menu Text ash 142 194 %ash
    menu Text mohogany 142 209 %mohogany
    menu Text yew 142 224 %yew
    menu Text oak 142 239 %oak
    menu Text zircote 142 254 %zircote
    menu Text ebony 142 269 %ebony
    menu Text bamboo 142 284 %bamboo
    menu Text purpleh 142 299 %purpleh
    menu Text redwood 142 314 %redwood
    menu Text petrified 142 329 %petrified
;    menu Text total 142 277 %total
;    menu Text bph 142 301 %bph
    menu Text total 142 351 %total
    menu Text bph 142 375 %bph
    menu Text startingSkill 314 161 %startingSkill
    menu Text currentSkill 314 176 %currentSkill
    menu Text skillGain 314 191 %skillGain
    menu Text gains 314 206 %gains
    menu Text bark 340 251 %bark
    menu Text amber 340 311 %amber
    menu Text switch 340 296 %switch
    menu Text plant 340 281 %plant
    menu Text fungi 340 266 %fungi
    menu Text time 148 125 %time
;    menu Shape EUOShape13 48 294 144 5 3 1 1 Black 7 Gray
;    menu Shape EUOShape12 48 272 144 5 3 1 1 Black 7 Gray
    menu Shape EUOShape13 48 368 144 5 3 1 1 Black 7 Gray
    menu Shape EUOShape12 48 346 144 5 3 1 1 Black 7 Gray
    menu Font Color Fuchsia
    menu Text EUOLabel16 262 124 Cut Logs If Possible
    menu Font Name MS Sans Serif
    menu Font Color WindowText
    menu Font BGColor BtnFace
    menu Button pause 41 122 49 21 Pause
    menu Font BGColor Black
    menu Check cutLogs 244 124 13 13 #true CutLogs
    menu Show 421 270
return

;;;;; Wood ;;;;;
sub woodKeys
set #lObjectID %keysid
event macro 17 0
gosub keyMenuWait

set %clickX #contPosX + 290
set %clickY #contPosY + 260

click %clickX %clickY
target

set %lTargetKind #lTargetKind
set #lTargetKind 1

woodAddLoop:
finditem ZLK C_ , #backpackID
if #findKind = -1
{
   key ESC
   wait 1
   click %clickX %clickY r
   set #lTargetKind %lTargetKind
   return
}

set #lTargetID #findID
event macro 22 0
target
goto woodAddLoop

;;;;; 'Waits' for key menu ;;;
sub keyMenuWait
keyLoop:
wait 1
if #contSize <> 505_295
   goto keyLoop
return
User avatar
Larsa
Legendary Scribe
Posts: 265
Joined: Thu Dec 09, 2010 2:56 pm

Re: [EasyUO] Auto logging script

Post by Larsa »

Last night I tried this macro... after backpack was full it try to chop the logs into boards and there is where it hangs. I have a high usage saw and I was using a mule at the time. Everything else works.
Now offering free tours to Sgail and Umbris camp, bring your own weapons as safety is not guaranteed.
User avatar
Mystery Man
Elder Scribe
Posts: 156
Joined: Thu Nov 04, 2010 2:13 pm
Location: Connecticut

Re: [EasyUO] Auto logging script

Post by Mystery Man »

I got it to work just fine...just wish it automaticly walk u around lol
After everything i've been threw, i'm still smiling...Not because i'm strong...But because i'm crazy!
Now that should scare you.....
paulus
Elder Scribe
Posts: 155
Joined: Sun Feb 20, 2011 4:24 am

Re: [EasyUO] Auto logging script

Post by paulus »

Larsa wrote:Last night I tried this macro... after backpack was full it try to chop the logs into boards and there is where it hangs. I have a high usage saw and I was using a mule at the time. Everything else works.
Having the same issue atm.. :(
Shotta
Legendary Scribe
Posts: 295
Joined: Thu Mar 10, 2011 2:04 am

Re: [EasyUO] Auto logging script

Post by Shotta »

I am wondering why the logs even need to be boards before going in the keys.
Would this omission make the script a bit more simple, thus smoother running?
Elmseeker
Novice Scribe
Posts: 9
Joined: Thu Apr 07, 2011 5:18 pm

Re: [EasyUO] Auto logging script

Post by Elmseeker »

Loved this script at first glance. I did, however, notice that it ran kind of slow. I have since found the reason for the slowdown and have fixed them. Script speed now improved by 25%+ I also removed the need to target a packy unless you are using one by asking if you are or not.

Code: Select all

    ;========================================
    ; Script Name: Ending's LumberHacker
    ; Author: ending - updated by Ticketguru for Excelsior modded by Elmseeker
    ; Version: 5.3.2
    ; Client Tested with: 5.0.9
    ; EUO version tested with: 1.5 TV 149
    ; Shard OSI / FS: Excelsior FS
    ; Revision Date: 29Jul09
    ; Public Release: 28Oct04
    ; Purpose: Free hand lumberjacking with beetle support and keys
    ;========== UPDATES =======================
    ;v5.3.3 - Removed run time display and several timer update calls increasing script speed by 25%+ - Elmseeker
    ;         Changed skills to display as xx.x rather than xxx - Elmseeker
    ;         Added pop-up to ask if using packy or not, if not sets packy id to backpack - Elmseeker
    ;v5.3.2 - Added wood keys support (thanks Blaze Budd)
    ;         Updated bugtypes to include mules and rideable pack llamas
    ;v5.3.1 - Replaced #sysmsg scanning with journal scanning
    ;v5.3.0 - Updated for Excelsior shard with custom wood types
    ;v5.2.1 - Fixed dismount sub, fixed scan sub, corrected the status
    ;       display when the packy is full.
    ;v5.2 - Allows support for packies.
    ;v5.1.2 - Fixed typos...thanks regs2.
    ;v5.1.1 - Fixed a typo, line 1 (gosub init) was commented out by
    ;       accident. This was the problem with it not recognizing axes.
    ;v5.1 - Fixed another Jscanning issue. Added in skill checking.
    ;v5.0 - Rewrite, again. Fixed journal scanning issues.
    ;v4.1 - Updated Object type IDs. Equips axe from backpack when needed.
    ;v4.0 - Reconstruction of script; rewritten for ML and EUO 1.5.
    ;v3.13 - No backpack positioning required.
    ;v3.12b - Updated wait times due to OSI's lag with SE and changed
    ;       full beetle resume from EUO to menu
    ;v3.12 - Fixed gump issues. Added pause/resume function and
    ;      changed the menu up a bit.
    ;v3.11 - Added in a Status section in the menu.
    ;v3.10 - Whole new menu added, big thanks to Tecmo for his
    ;      support and to Akilae for his testing and great
    ;      suggestions.
    ;v2.11 - Fixed loading beetle.
    ;v2.1 - Beetle support fixed, thanks Roadkill!
    ;v2.0 - Took subs out mostly so it wont dig down too far.
    ;v1.2b - Customized a few things, not really and large scale
    ;      changes.
    ;v1.2 - Added in tinkering of carpentry tools, supports wood tools
    ;     and ingot tools.
    ;v1.1b - Fixed the whole method of logs to boards, more efficient
    ;      and no one can steal the logs on the ground. Also
    ;      fixed lots of other misc. things.
    ;v1.1 - Added in chopping up the logs to boards.
    ;v1.0 - Up and running :)
    ;===========================================
    ;========== DON'T EDIT BELOW HERE ===========
    gosub init
    gosub showMenu
    gosub setup
    main:
         gosub settree
         gosub choptree
         goto main


    sub setup
         set %status Checking , #spc , for , #spc , elf
         gosub changestatus
         event macro 8 2
         wait 20
         if #conttype = XU || #conttype = AV
            set %elf #true
         gosub dismount new
         set %status Setting , #spc , up , #spc , bug , #spc , IDs
         gosub changestatus
         finditem %bugtypes G_3
Display YesNo Are you using a packy? $ ; Elms Ask Mod
if #dispres = yes
{
         if #findkind = -1
         {
            display ok Can't find beetle/packy. Target it please.
            set #targcurs 1
            gosub usertargwait
            set %bugid #ltargetid
            finditem %bugid G_3
         }
         else
            set %bugid #findid
         set %bugtype #findtype
         set %bugbag %bugid
}
else
set %bugid #backpackid ; End Elms Ask Mod
         wait 20
         gosub mount

         gosub findwoodkeys
    return

    sub findwoodkeys
    _findwoodkeys:
      findItem NUI C_ , #backpackID
      if #findkind = -1
         return
      event property #findID
      if Wood in #property
      {
         set %keys #true
         set %keysid #findid
         return
      }
      ignoreitem #findID
      goto _findwoodkeys
    return

    sub usertargwait
         _usertargwait:
         if #targcurs = 1
            goto _usertargwait
    return

    sub targwait
         set %curscnt #scnt
         _targwait:
         if #targcurs <> 1
         {
            if ( %curscnt + 5 ) < #scnt
               return timeout
            goto _targwait
         }
    return

    sub contwait
        set %curCont #contid
        _contchange:
        {
            if ( %curscnt + 5 ) < #scnt
               return timeout
            if %curCont = #contid
               goto _contchange
        }
    return

    sub gumpwait
        set %curscnt #scnt
        _gumpWait:
        if worn in #journal || worn in #sysmsg
           return
        if #CONTSIZE <> 530_437
           goto _gumpWait
        wait 5
    return

    sub statuscheck
        if #charname = n/a
        {
           event macro 8 2
           wait 20
        }
    return

    sub mount
        if %bugtype notin %bugtypes
           return
        _findmount:
        finditem %bugid G_16
        if #findkind = -1
        {
           display ok Cannot find mount, halting.
           halt
        }
        _mounttry:
        set #lobjectid %bugid
        event macro 17 0
        wait 10
        finditem %bugid G_3
        if #findkind <> -1
           goto _mounttry
        wait 10
    return

    sub dismount
        if %bugtype notin %bugtypes && %1 <> new
           return
        _dismount:
        set #lobjectid #charid
        event macro 17 0
        wait 20
        if %1 <> new
        {
           finditem %bugid G_3
           if #findkind = -1
              goto _dismount
        }
    return

    sub choptree
         gosub equipaxe
         set #lobjectid %axeid
         set #ltargetid %curTree
         while new notin #result
         {
              _chop:
              set %status Chopping , #spc , tree
              gosub changestatus
              gosub checkButton
              gosub statuscheck
              gosub skillCheck
;Elms Weight Check Mod
      if #maxweight >= 445
      {
              if #weight >= 425 ;#maxweight - 20
              gosub logs2boards
      }
      else
      {
          if #weight >= #maxweight - 20
          gosub logs2boards

      }
;End Elms Weight Check Mod
              set %status Chopping , #spc , tree
              gosub changestatus

              ; set journal position before chopping
              set %jcurrent #jIndex + 1
              set #lobjectid %axeid
              event macro 17 0
              gosub targwait
              event macro 22 0
              gosub journalscan
              if cut in #result
                 gosub logs2boards
         }
    return

    sub settree
         gosub checkButton
         gosub statuscheck
         if #weight >= #maxweight - 20
            gosub logs2boards
         gosub equipaxe
         set %status Setting , #spc , tree
         gosub changestatus
         set #lobjectid %axeid
         _retryselect:
         gosub checkButton
         event macro 17 0
         gosub usertargwait
         set %curTree #lobjectid
         gosub journalscan
         if cut in #result
         {
            gosub logs2boards
            goto _retryselect
         }
         if chop in #result {
            wait 30
            return
         }
         if new in #result || mustwait in #result
            goto _retryselect
    return

    sub equipaxe
         set %status Checking , #spc , for , #spc , axe
         gosub changestatus
         finditem %axes C_ , #charid
         if #findkind = -1
         {
            finditem %axes C_ , #backpackid
            if #findkind = -1
            {
               display ok Error: Cannot find axe. Halting.
               halt
            }
            set %axeid #findid
            set #lhandid #findid
            event macro 24 1
            wait 20
         }
         set %axeid #findid
    return

    sub journalscan
        set %status Scanning , #spc , journal...
        gosub changestatus
        scanwait:
        if %jcurrent > #jindex
        {
           wait 10
           goto scanwait
        }
        scanjournal %jcurrent
        if You_found_a_bark in #journal
        {
             set %bark %bark + 1
            gosub updatemenu bark
        }
        if You_found_a_parasitic_plant in #journal
        {
             set %plant %plant + 1
            gosub updatemenu plant
        }
        if You_found_a_luminescent in #journal
        {
               set %fungi %fungi + 1
               gosub updatemenu fungi
        }
        if You_found_a_switch in #journal
        {
               set %switch %switch + 1
               gosub updatemenu switch
        }
        if You_found_a_brilliant_amber in #journal
        {
               set %amber %amber + 1
               gosub updatemenu amber
        }
         if You_put_some_Regular in #journal
        {
           gosub checkLands
             set %normal %normal + %addamt
             gosub updatemenu ordinary
           return chop
        }
        if You_put_some_Pine in #journal
        {
             gosub checkLands
             set %pine %pine + %addamt
             gosub updatemenu pine
           return chop
        }
        if You_put_some_Ash in #journal
        {
             gosub checkLands
             set %ash %ash + %addamt
             gosub updatemenu ash
           return chop
        }
        if You_put_some_Mohogany in #journal
        {
             gosub checkLands
             set %mohogany %mohogany + %addamt
             gosub updatemenu mohogany
           return chop
        }
        if You_put_some_Yew in #journal
        {
             gosub checkLands
             set %yew %yew + %addamt
             gosub updatemenu yew
           return chop
        }
        if You_put_some_Oak in #journal
        {
             gosub checkLands
           set %oak %oak + %addamt
           gosub updatemenu oak
           return chop
        }
        if You_put_some_Zircote in #journal
        {
            gosub checkLands
            set %zircote %zircote + %addamt
            gosub updatemenu zircote
            return chop
        }
        if You_put_some_Ebony in #journal
        {
            gosub checkLands
            set %ebony %ebony + %addamt
            gosub updatemenu ebony
            return chop
        }
        if You_put_some_Bamboo in #journal
        {
            gosub checkLands
            set %bamboo %bamboo + %addamt
            gosub updatemenu bamboo
            return chop
        }
        if You_put_some_Purple in #journal
        {
            gosub checkLands
            set %purpleh %purpleh + %addamt
            gosub updatemenu purpleh
            return chop
        }
        if You_put_some_Redwood in #journal
        {
            gosub checkLands
            set %redwood %redwood + %addamt
            gosub updatemenu redwood
            return chop
        }
        if You_put_some_Petrified in #journal
        {
            gosub checkLands
            set %petrified %petrified + %addamt
            gosub updatemenu petrified
            return chop
        }
        if you_hack in #journal
           return chop
        if You_must_wait in #journal
           return mustwait
        if you_can't_place in #journal
           return cut
        if that_is_too_far in #journal || Target_cannot_be_seen in #journal || You_can't_use_an_axe_on_that in #journal || That_is_not_accessible in #journal || not_enough_wood_here in #journal
           return new
        set %jcurrent %jcurrent + 1
        goto scanwait
    return

    sub checkLands
        set %addamt 10
    ;    if %elf = #true
    ;       set %addamt 10
        if #curskind = 0
           set %addamt %addamt * 2
    return

    sub skillCheck
        if %currentSkill < #skill
        {
            set %currentSkill #skill
              set %Gains %Gains + 1
              set %skillGain %currentSkill - %startingskill
              menu Font Name Arial
              menu Font Style
              menu Font Size 8
              menu Font Color Lime
              menu Font Transparent #true
              menu Font BGColor Black
              menu delete currentSkill
              menu delete skillGain
              menu delete gains
;Elms Skill Display Mod
              set %cskillm %currentSkill / 10
              set %sgainm %skillGain / 10
              set %cskillr %currentSkill % 10
              set %sgainr %skillGain % 10
              set %dot .
              set %cskill %cskillm , %dot , %cskillr
              set %sgain %sgainm , %dot , %sgainr
              menu Text currentSkill 314 176 %cskill
              menu Text skillGain 314 191 %sgain
; End Elms Skill Display Mod
;             menu Text currentSkill 314 176 %currentSkill
;              menu Text skillGain 314 191 %skillGain
              menu Text gains 314 206 %gains
              menu Delete status
              menu Font Color Red
              menu Text status 91 87 Skill gain!
              wait 10
        }
    return

    sub logs2boards
        set %status Cutting , #spc , logs , #spc ,  to , #spc , boards
        gosub changestatus

        ; addd to use keys 7/29/2009
        if %keys = #true
        {
           gosub woodKeys
           gosub unloadtobug
           return
        {

        menu Get cutLogs
        if #menuRes = #false
        {
           gosub unloadtobug
           return
        }
        wait 30
        _logs2boards:
        finditem ZLK C_ , #backpackid
        if #findkind = -1
        {
           ignoreitem reset 1
           gosub unloadtobug
           return
        }
        set %curWood #findcol
        set %curlogs #findid
        findItem KGG_EGG_AGG_IGG_BIG_ZHG_WFG_YFG_XFG C_ , #backpackid
        if #findkind = -1
        {
           display ok No carp tools, pausing.
           gosub pauseScript
           goto _logs2boards
        }
        set #lobjectid #findid
        _carpretry:
        gosub checkButton
        event macro 17 0
        gosub gumpwait
        if timeout in #result
           goto _carpretry
        gosub calcClicks
        click %woodtypex %woodtypey
        wait 5
        if %curWood = %normalCol
           click %woodx %woody
        if %curWood = %pineCol
           click %woodx %piney
        if %curWood = %ashCol
           click %woodx %ashy
        if %curWood = %mohoganyCol
           click %woodx %mohoganyy
        if %curWood = %yewCol
           click %woodx %yewy
        if %curWood = %oakCol
           click %woodx %oaky
        if %curWood = %zircoteCol
           click %woodx %zircotey
        if %curWood = %ebonyCol
           click %woodx %ebonyy
        if %curWood = %bambooCol
           click %woodx %bambooy
        if %curWood = %purplehCol
           click %woodx %purplehy
        if %curWood = %redwoodCol
        {
           click %nexttypex %nexttypey
           wait 5
           click %woodx %redwoody
        }
        if %curWood = %petrifiedCol
        {
           click %nexttypex %nexttypey
           wait 5
           click %woodx %petrifiedy
        }
        gosub gumpWait
        if timeout in #result
           goto _carpretry
        click %othermenux %othermenuy
        gosub gumpWait
        if timeout in #result
           goto _carpretry
        click %boardmenux %boardmenuy
        gosub gumpwait
        click %exitx %exity
        ignoreitem %curlogs 1
        goto _logs2boards
    return

    sub unloadtobug
        gosub dismount
        _loadbeetle:
        wait 30
        finditem TLK_ZLK_NWS_YWS_XWS_BWR_FXS C_ , #backpackid
        if #findkind = -1
        {
           gosub mount
           wait 2s
           return
        }
        exevent drag #findid #findstack
        exevent dropc %bugbag
        wait 5
        if That_container_cannot_hold_more_weight. in #sysmsg
        {
           gosub mount
           set %status Paused , #spc , - , #spc , Beetle , #spc , full.
           gosub changestatus
           gosub pauseScript
        }
        goto _loadbeetle
    return

    sub calcClicks
        set %woodtypex #contposx + 30
        set %woodtypey #contposy + 375
        set %nexttypex #contposx + 500
        set %nexttypey #contposy + 270
        set %woodx #contposx + 235
        set %woody #contposy + 70
        set %piney #contposy + 90
        set %ashy #contposy + 110
        set %mohoganyy #contposy + 130
        set %yewy #contposy + 150
        set %oaky #contposy + 170
        set %zircotey #contposy + 190
        set %ebonyy #contposy + 210
        set %bambooy #contposy + 230
        set %purplehy #contposy + 250
        set %redwoody #contposy + 70
        set %petrifiedy #contposy + 90
        set %othermenux #contposx + 28
        set %othermenuy #contposy + 90
        set %boardmenux #contposx + 233
        set %boardmenuy #contposy + 70
        set %exitx #contposx + 30
        set %exity #contposy + 413
    return

    sub checkButton
        if #menubutton = pause
        {
           set %status Paused by user.
           gosub changestatus
           gosub pauseScript
        }
    return

    sub pauseScript
        menu Delete pause
        menu Font Name MS Sans Serif
        menu Font Size 8
        menu Font Color WindowText
        menu Font BGColor BtnFace
        menu Button resume 36 122 49 21 Resume
        set #menubutton n/a
        _pause:
        if #menubutton  = resume
        {
           menu Font Name Arial
           menu Font Style
           menu Font Size 8
           menu Font Color Lime
           menu Font Transparent #true
           menu Delete status
           menu Text status 91 87 Resuming...
           menu Delete resume
           menu Font Name MS Sans Serif
           menu Font Size 8
           menu Font Color WindowText
           menu Font BGColor BtnFace
           menu Button pause 36 122 49 21 Pause
           set #menubutton n/a
           return
        }
        wait 2 ;takes a load off the cpu
        goto _pause
    return

    sub init
        set %version 5.3.2
          set #menubutton n/a
        set %axes LSF_BSF_NFS_ZRF_RMH_LPH_UOH_FSF_OFR
        set %carpTools KGG_EGG_AGG_IGG_BIG_ZHG_WFG
        set %tinkerTools GTL_KTL_JTL
        set %bugtypes ZGB_GC_EG
        chooseSkill carp
        set %carpSkill #skill
        chooseSkill lumb
        set %startingSkill #skill
        set %currentSkill #skill
        set %starttime #scnt
        set %normal 0
        set %pine 0
        set %ash 0
        set %mohogany 0
        set %yew 0
        set %oak 0
        set %zircote 0
        set %ebony 0
        set %bamboo 0
        set %purpleh 0
        set %redwood 0
        set %petrified 0
        set %total 0
        set %bph 0
        set %skillGain 0
        set %gains 0
        set %bark 0
        set %amber 0
        set %switch 0
        set %plant 0
        set %fungi 0
        set #lobjectid
        set #ltargetid
        set #findid
        set %normalCol 0
        set %pineCol 1262
        set %ashCol 961
        set %mohoganyCol 355
        set %yewCol 1281
        set %oakCol 488
        set %zircoteCol 1271
        set %ebonyCol 43
        set %bambooCol 1152
        set %purplehCol 114
        set %redwoodCol 37
        set %petrifiedCol 1153
    ;    set %oakCol 2010
    ;    set %ashCol 1191
    ;    set %yewCol 1192
    ;    set %heartCol 1193
    ;    set %bloodCol 1194
    ;    set %frostCol 1151
         set %keys #false
    return

    sub updateTime
       set %time #scnt - %starttime
       set %seconds %time % 60
       set %minutes ( %time / 60 ) % 60
       set %hours %time / 3600

       if %seconds < 10
           set %timeresult : , 0 , %seconds
       else
          set %timeresult : , %seconds
       if %minutes < 10
          set %timeresult : , 0 , %minutes , %timeresult
       else
          set %timeresult : , %minutes , %timeresult
       if %hours < 10
          set %timeresult 0 , %hours , %timeresult
       else
          set %timeresult %hours , %timeresult

       menu Font Transparent #true
       menu Font Name Arial
       menu Font Align Left
       menu Font BGColor None
       menu Font Color Lime
       menu Font Size 8
       menu Delete time
       menu Text time 155 125 %timeresult
    return

    sub updatemenu
        menu Font Name Arial
        menu Font Style
        menu Font Color Lime
        menu Font Size 8
        menu Font Transparent #true
        menu Font BGColor Black
        if %1 = bark
        {
           menu Delete bark
           menu Text bark 340 251 %bark
        }
        if %1 = plant
        {
           menu Delete plant
           menu Text plant 340 281 %plant
        }
        if %1 = fungi
        {
           menu Delete fungi
           menu Text fungi 340 266 %fungi
        }
        if %1 = switch
        {
           menu Delete switch
           menu Text switch 340 296 %switch
        }
        if %1 = amber
        {
           menu Delete amber
           menu Text amber 340 311 %amber
        }
        if %1 = ordinary
        {
           menu Delete normal
           menu Text normal 142 164 %normal
        }
        if %1 = pine
        {
           menu Delete pine
           menu Text pine 142 179 %pine
        }
        if %1 = ash
        {
           menu Delete ash
           menu Text ash 142 194 %ash
        }
        if %1 = mohogany
        {
           menu Delete mohogany
           menu Text mohogany 142 209 %mohogany
        }
        if %1 = yew
        {
           menu Delete yew
           menu Text yew 142 224 %yew
        }
        if %1 = oak
        {
           menu Delete oak
           menu Text oak 142 239 %oak
        }
        if %1 = zircote
        {
           menu Delete zircote
           menu Text zircote 142 254 %zircote
        }
        if %1 = ebony
        {
           menu Delete ebony
           menu Text ebony 142 269 %ebony
        }
        if %1 = bamboo
        {
           menu Delete bamboo
           menu Text bamboo 142 284 %bamboo
        }
        if %1 = purpleh
        {
           menu Delete purpleh
           menu Text purpleh 142 299 %purpleh
        }
        if %1 = redwood
        {
           menu Delete redwood
           menu Text redwood 142 314 %redwood
        }
        if %1 = petrified
        {
           menu Delete petrified
           menu Text petrified 142 329 %petrified
        }
        gosub updatetime
        set %total %normal + %pine + %ash + %mohogany + %yew + %oak + %zircote + %ebony + %bamboo + %purpleh + %redwood + %petrified
        set %bph %total * 3600 / %time
        menu Delete total
        menu Text total 142 351 %total
        menu Delete bph
        menu Text bph 142 375 %bph
    return

    sub changestatus
        menu Font Name Arial
        menu Font Style
        menu Font Color Lime
        menu Font Size 8
        menu Font Transparent #true
        menu Font BGColor Black
        menu Delete status
        menu Text status 91 87 %status
    return

    sub showMenu
        menu Clear
        menu Window Title LumberHacker for Excelsior
        menu Window Color Black
    ;    menu Window Size 409 335
        menu Window Size 409 409
        menu Font Transparent #true
        menu Font Align Right
        menu Shape EUOShape1 -128 -4 485 85 3 1 1 Black 7 3DDkShadow
        menu Shape EUOShape2 322 16 69 65 2 1 1 Black 7 3DDkShadow
        menu Shape EUOShape3 250 -28 141 81 3 1 1 Black 7 3DDkShadow
    ;    menu Shape EUOShape4 45 109 493 300 3 1 1 Black 7 3DDkShadow
        menu Shape EUOShape4 45 109 493 374 3 1 1 Black 7 3DDkShadow
        menu Shape EUOShape5 13 109 69 65 2 1 1 Black 7 3DDkShadow
        menu Shape EUOShape6 13 137 141 300 3 1 1 Black 7 3DDkShadow
        menu Shape EUOShape7 294 14 45 45 1 1 1 Black 7 White
        menu Shape EUOShape8 302 22 29 29 1 1 1 Black 7 3DDkShadow
        menu Shape EUOShape9 315 26 33 8 3 1 1 Black 7 White
    ;    menu Shape EUOShape10 35 153 169 177 4 7 1 Black 7 3DDkShadow
        menu Shape EUOShape10 35 153 169 251 4 7 1 Black 7 3DDkShadow
        menu Shape EUOShape11 217 150 178 81 4 7 1 Black 7 3DDkShadow
        menu Shape EUOShape14 217 241 178 89 4 7 1 Black 7 3DDkShadow
        menu Font Name Arial
        menu Font Size 14
        menu Font Style b
        menu Font Color Lime
        menu Font Align Left
        menu Font BGColor Black
        menu Text EUOLabel1 42 28 LumberHacker
        menu Font Size 8
        menu Text EUOLabel2 140 48 v
        menu Text EUOLabel3 148 48 %version
        menu Font Color Silver
        menu Text EUOLabel4 32 16 Operation:
        menu Text EUOLabel6 242 12 By:
        menu Font Size 14
        menu Font Color Fuchsia
        menu Text EUOLabel5 242 23 ticketguru
        menu Font Size 8
        menu Font Color Silver
        menu Text EUOLabel998 242 43 W/Mods By:
        menu Font Size 14
        menu Font Color Fuchsia
        menu Text EUOLabel999 242 53 Elmseeker
        menu Font Name MS Sans Serif
        menu Font Size 8
        menu Font Color WindowText
        menu Font Transparent #false
        menu Font BGColor 3DDkShadow
        menu Text EUOLabel35 238 235 Additional Resources
        menu Text EUOLabel23 55 147 Wood Information
        menu Text EUOLabel24 238 144 Skill Information
        menu Font Name Arial
        menu Font Style
        menu Font Color Fuchsia
        menu Font Transparent #true
        menu Font BGColor Black
        menu Text EUOLabel48 46 87 Status:
        menu Text EUOLabel7 48 164 Regular Wood:
        menu Text EUOLabel8 48 179 Pine:
        menu Text EUOLabel9 48 194 Ash:
        menu Text EUOLabel10 48 209 Mohogany:
        menu Text EUOLabel13 48 224 Yew:
        menu Text EUOLabel12 48 239 Oak:
        menu Text EUOLabel11 48 254 Zircote:
        menu Text EUOLabel9 48 269 Ebony:
        menu Text EUOLabel10 48 284 Bamboo:
        menu Text EUOLabel13 48 299 Purple Heart:
        menu Text EUOLabel12 48 314 Redwood:
        menu Text EUOLabel11 48 329 Petrified:
    ;    menu Text EUOLabel21 48 277 Total:
    ;    menu Text EUOLabel25 48 301 BPH:
        menu Text EUOLabel21 48 351 Total:
        menu Text EUOLabel25 48 375 BPH:
        menu Text EUOLabel27 233 161 Starting Skill:
        menu Text EUOLabel30 233 176 Current Skill:
        menu Text EUOLabel31 233 191 Skill Gain:
        menu Text EUOLabel34 233 206 Gains:
        menu Text EUOLabel37 234 251 Bark Fragments:
        menu Text EUOLabel38 234 266 Luminescent Fungi:
        menu Text EUOLabel39 234 281 Parasitic Plant:
        menu Text EUOLabel40 234 296 Switch:
        menu Text EUOLabel41 234 311 Brillant Amber:
;        menu Text EUOLabel46 97 125 Run Time:
        menu Font Color Lime
        menu Text status 91 87 Initializing...
        menu Text normal 142 164 %normal
        menu Text pine 142 179 %pine
        menu Text ash 142 194 %ash
        menu Text mohogany 142 209 %mohogany
        menu Text yew 142 224 %yew
        menu Text oak 142 239 %oak
        menu Text zircote 142 254 %zircote
        menu Text ebony 142 269 %ebony
        menu Text bamboo 142 284 %bamboo
        menu Text purpleh 142 299 %purpleh
        menu Text redwood 142 314 %redwood
        menu Text petrified 142 329 %petrified
    ;    menu Text total 142 277 %total
    ;    menu Text bph 142 301 %bph
        menu Text total 142 351 %total
        menu Text bph 142 375 %bph
; Elms Skill Display Mod
        set %stskillm %startingSkill / 10
        set %cskillm %currentSkill / 10
        set %sgainm %skillGain / 10
        
        set %stskillr %startinSkill % 10
        set %cskillr %currentSkill % 10
        set %sgainr %skillGain % 10
        set %dot .
        set %stskill %stskillm , %dot , %stskillr
        set %cskill %cskillm , %dot , %cskillr
        set %sgain %sgainm , %dot , %sgainr

        menu Text startingSkill 314 161 %stskill
        menu Text currentSkill 314 176 %cskill
        menu Text skillGain 314 191 %sgain
; End Elms Skill Display Mod
        menu Text gains 314 206 %gains
        menu Text bark 340 251 %bark
        menu Text amber 340 311 %amber
        menu Text switch 340 296 %switch
        menu Text plant 340 281 %plant
        menu Text fungi 340 266 %fungi
    ;    menu Shape EUOShape13 48 294 144 5 3 1 1 Black 7 Gray
    ;    menu Shape EUOShape12 48 272 144 5 3 1 1 Black 7 Gray
        menu Shape EUOShape13 48 368 144 5 3 1 1 Black 7 Gray
        menu Shape EUOShape12 48 346 144 5 3 1 1 Black 7 Gray
        menu Font Color Fuchsia
        menu Text EUOLabel16 262 124 Cut Logs If Possible
        menu Font Name MS Sans Serif
        menu Font Color WindowText
        menu Font BGColor BtnFace
        menu Button pause 41 122 49 21 Pause
        menu Font BGColor Black
        menu Check cutLogs 244 124 13 13 #true CutLogs
        menu Show 421 270
    return

    ;;;;; Wood ;;;;;
    sub woodKeys
    set #lObjectID %keysid
    event macro 17 0
    gosub keyMenuWait

    set %clickX #contPosX + 290
    set %clickY #contPosY + 260

    click %clickX %clickY
    target

    set %lTargetKind #lTargetKind
    set #lTargetKind 1

    woodAddLoop:
    finditem ZLK C_ , #backpackID
    if #findKind = -1
    {
       key ESC
       wait 1
       click %clickX %clickY r
       set #lTargetKind %lTargetKind
       return
    }

    set #lTargetID #findID
    event macro 22 0
    target
    goto woodAddLoop

    ;;;;; 'Waits' for key menu ;;;
    sub keyMenuWait
    keyLoop:
    wait 1
    if #contSize <> 505_295
       goto keyLoop
    return
Locked