Lumberjack & Mining HUD

If you make a Client-side script you can publish it here for other players to use
Locked
DentonA
Passer by
Posts: 3
Joined: Sun Aug 14, 2011 7:06 pm

Lumberjack & Mining HUD

Post by DentonA »

I'm glad to present you my own script for EasyUO that is still developing.
For those who don't know how to act with EasyUO macroses: just copy the script to your EUO window, unzip Tiles_database.txt file to easyuo directory, read instructions carefully, manage to follow them and start the script.

If you find some bugs, feel free to say about them so that I can fix them.
PM in game xxDENTONxx

Enjoy.

Code: Select all

;========================================================================
;* @name Mining and Lumberjack HUD
;* @author Denton
;* @based on Penny's "Mining HUD v 1.02"
;* @ver 1.04 05 - September - 2011
;* @shard "Excelsior" - http://www.uoex.net
;* @purpose Point-and-click resource gatherer
;* @status developing
;*
;* @usage
;* - Click on the yellow button to decide which gatherer you would use
;* - If you have some spots in "Tiles_database.txt" file, you may load it before running the script (button "LOAD TILES FROM DATABASE")
;* - Press red button "START MACRO" to start the script
;* - Place the red circle under your feet (the left and bottom borders of macro window and game window would match)
;*
;* For mining you must have in your backpack 3 basic items:
;*     1) Mobile forge
;*     2) Shovel
;*     3) Metal Keys (item that may hold up to 60k of each metal type)
;*
;* For lumberjack you must have in your backpack 2 basic items:
;*     1) Any type of axe
;*     2) Wood Keys (item that may hold up to 60k of each wood type)
;*
;* Macro would actively remember and save the definite wood and metal type spots in "Tiles_database.txt" file in the following format: gosub zircote x1396y2028type3283_
;*
;* If you would like to share spots with others, then get the lines such as "gosub zircote x1396y2028type3283_" from "Tiles_database.txt" file. And if you want to add some shared spots to database file, just paste them in the end of "Tiles_database.txt".
;*
;* @todo list
;* 1) Fix some message bugs
;* 2) Save the spot information in separate file and ability to load it and share with others (mining left)
;* 3) Full mining support
;* 4) Ability to automatically pathfind the definite spot type only
;* 5) More flexible manual settings
;* 6) Add reset of the tool while mining
;*
;========================================================================

tile init

set %delta 23

set %veinEmptyMsg no_metal_here
set %miningFailMsg loosen_some_rocks
set %miningSuccessMsg ore_in_your_backpack
set %cantMineMsg mine_there
set %cantseeMsg Target_cannot_be_seen
set %tooFarMsg too_far_away
set %backpackfullMsg your_backpack_is_full
set %oregetMsg You_put

set %miningtiletypes x240x_x241x_x242x_x243x_x1353x_x1355x_x1357x_x1339x_x1340x_x1341x_x1342x_x1343x
set %treestile 3274_3275_3276_3277_3280_3283_3302_3286_3289_3296_3299_3291_3292_3294_3295_3417_3394_3395_3440_3461
set %axes ZRF_CSF_BSF_MSF_LSF_OSF_NSF_ISF_JOH_UOH_SMH_RMH_MPH_LPH_FSF_ASF_QCO_OFR_SFR

set %woodgetMsg You_put
set %treeEmptyMsg not_enough_wood
set %cantLumberMsg use_an_axe
set %cantPlaceWood place_any_wood_into
set %hackatthetree hack_at_the_tree
set %BreakAxeMsg broke_your

set %curskill mining

set #lpc 1000

menu font bgcolor green
menu window size 900 600
menu window transparent 60
menu shape targetCircle 385 285 30 30 1 2 1 red 2 red

menu button rawScan 810 50 80 30 Scan
menu button wipeGrid 810 90 80 30 Wipe
menu button smelt 810 130 80 30 Smelt
menu button keys 810 170 80 30 Keys

menu font bgcolor red
menu button load 350 100 200 30 LOAD TILES FROM DATABASE

menu font bgcolor red
menu button setup 400 210 100 30 START MACRO

menu font bgcolor yellow
menu button miningactive 375 250 150 30 Will mine ore

menu button minimize 0 0 20 20
set %minimized #false

menu show

set #menubutton none

while #true
  {
    if #menubutton = load
      {
      set #menubutton none
      menu delete load
      gosub load
      }
    if #menubutton = miningactive
      {
        set #menubutton none
        menu delete miningactive
        set %curskill lumber
        menu font bgcolor yellow
        menu button lumberactive 375 250 150 30 Will chop wood
      }
    if #menubutton = lumberactive
      {
        set #menubutton none
        menu delete lumberactive
        set %curskill mining
        menu font bgcolor yellow
        menu button miningactive 375 250 150 30 Will mine ore
      }
    if #menubutton = setup
      {
        set #menubutton none
        menu delete load
        menu button load 810 210 80 30 Load spots
        gosub setup
        while #true
          {
            if #menubutton = load
            {
            set #menubutton none
            gosub load
            gosub wipesmallgrid
            gosub wiperawgrid
            gosub rawscan
            }
            if #menubutton = minimize
              {
                set #menubutton none
                gosub minimize
              }
            if #menubutton = Smelt
              {
                set #menubutton none
                gosub smelt
              }
            if #menubutton = keys
              {
                set #menubutton none
                gosub keys
              }
            if #menubutton = rawScan
              {
                set #menubutton none
                gosub rawScan ;gosub rawScan #menures
              }
            if #menubutton = wipeGrid
              {
                set #menubutton none
                gosub wiperawGrid
                gosub wipesmallGrid
              }
            if #menubutton = equip
              {
                set #menubutton none
                finditem %axes C_ , #backpackid
                if #findcnt > 0
                  {
                    gosub equipaxe
                    set %hatchetid #findid
                  }
                else
                  {
                    event exmsg #charid 3 33 No hatchet found! stopping!
                    halt
                  }
              }
            if rawGrid in #menubutton
              {
                str mid #menubutton 8 6
                set #menubutton none
                gosub wipesmallGrid
                gosub smallGrid #strres
              }
            if smallGrid in #menubutton
              {
                str mid #menubutton 10 6
                set #menubutton none
                gosub wipesmallgrid
                gosub wipeRawgrid
                gosub handleSpot #strres
                gosub rawScan
              }
          }
      }
  }
halt

sub minimize
  {
    if %minimized
      {
        menu window size 900 600
        set %minimized #false
      }
    else
      {
        menu window size 20 20
        set %minimized #true
      }
    return
  }

sub handleSpot
  {
    set %string %1 
    str pos %string y 
    set %ypos #strres + 1 
    set %len %ypos - 3 
    str mid %string 2 %len
    set %smallx #strres   
    str mid %string %ypos 2
    set %smally #strres

    set %x %rawx * 5 + %smallx
    set %y %rawy * 5 + %smally
    
    if ( abs %x <= 1 &&  abs %y <= 1 )
      {
        gosub handleClose %x %y
      }
    else
      {
        set %x_check #charposx + %x
        set %y_check #charposy + %y 
        tile get %x_check %y_check 1
        set %tiletypefix x , #tiletype , x
        tile get %x_check %y_check 2
        set %tiletypefix2 x , #tiletype , x
        set %name2 #tilename
        tile get %x_check %y_check 3
        set %name3 #tilename
        if ( %tiletypefix in %miningtiletypes ) || ( %tiletypefix2 in %miningtiletypes )
          {
            ;event sysmessage Clicked on mining tile
            event pathfind %x_check %y_check #tilez
            set #lpc 10
            while ! ( #charposx = %x_check && #charposy = %y_check )
              wait 1
            set #lpc 1000
            set %x %x_check - #charposx
            set %y %y_check - #charposy
            gosub handleClose %x %y
            return
          }
        if ( ( tree notin %name2 ) && ( tree notin %name3 ) )
          {
            ;Event sysmessage Clicked on tile not tree
            event pathfind %x_check %y_check #tilez
            set #lpc 10
            while ! ( #charposx = %x_check && #charposy = %y_check )
              wait 1
            set #lpc 1000
          }
        else
          {
            ;event sysmessage Clicked on tree. My x: #charposx y: #charposy
            set %x_correct %x_check + 1
            set %y_correct %y_check + 1
            event sysmessage Going to x: %x_correct y: %y_correct
            event pathfind %x_correct %y_correct #tilez
            set #lpc 10
            while ! ( #charposx = %x_correct && #charposy = %y_correct )
              wait 1
            set #lpc 1000
            if %curskill = lumber
              {
                set %x %x_check - #charposx
                set %y %y_check - #charposy
                gosub handleClose %x %y
              }
          }
      }
    return
  }

sub handleClose
  {
    set %spotX #charposx + %1
    set %spotY #charposy + %2
    tile get %spotX %spotY 1

    ;========================
    ;==== LUMBERJACK SUB ====
    ;========================
    if %curskill = lumber
      {
        
        ;====== detect whether this tile is tree, if not - return
        tile cnt %spotx %spoty #cursKind
        if #TILECNT < 2
          return
        tile Get %spotx %spoty 2 #cursKind
        if #TILETYPE notin %treestile
          {
            if #TILECNT < 3
              return
            tile Get %spotx %spoty 3 #cursKind
            if #TILETYPE notin %treestile
              return
          }
        ;=======================================
        set #lpc 10
        set #lobjectid %hatchetid
        set #LTARGETTILE #TILETYPE
        set #ltargetx %spotX
        set #ltargety %spotY
        set #ltargetz #tilez
        set #ltargetkind 3
        set %stillLumber #true
        set %temptreeinfo x , %spotx , y , %spoty , type , #tiletype
        while %stillLumber
          {
            event macro 17
            target
            event macro 22
            gosub lookForStop
          }
        wait 20
        gosub keys
      }
    
    ;========================
    ;====== MINING SUB ======
    ;========================
    if %curskill = mining
      {
        tile get %spotx %spoty 2 #curskind
        if ( #TILETYPE notin %miningtiletypes ) && ( cave_floor notin %name2 )
          {
            event pathfind %spotX %spotY
            set #lpc 10
            while ! ( #charposx = %spotX && #charposy = %spotY )
              wait 1
            set #lpc 1000
            return
          }
        else
          {
            set #lpc 10
            set #lobjectid %shovelid
            set #LTARGETTILE #TILETYPE
            set #ltargetx %spotX
            set #ltargety %spotY
            set #ltargetz #tilez
            set #ltargetkind 3
            set %stillMining #true
            while %stillMining
              {
                event macro 17
                target
                event macro 22
                gosub lookForStop
              }
            wait 20
            gosub smelt
            set #lpc 1000
          }
        wait 20
        gosub keys
      }
    return
  }

sub lookForStop
  {
    set #lpc 1000
    set %jrnl #jindex
    while #true
      {
        if #jindex > %jrnl
          {
            set %jrnl %jrnl + 1
            scanjournal %jrnl

            ;==================================
            ;====== MINING WAIT MESSAGES ======
            ;==================================
            if %curskill = mining
              {
                if ( %oregetMsg in #journal ) || ( %miningfailmsg in #journal )
                  {
                    return
                  }
                if ( ( %veinEmptyMsg in #journal ) || ( %cantMineMsg in #journal ) || ( %cantseeMsg in #journal ) || ( %toofarMsg in #journal ) || ( %backpackfullMsg in #journal ) )
                  {
                    set %stillMining #false
                    return
                  }
              }

            ;=========================================
            ;====== LUMBERJACKING WAIT MESSAGES ======
            ;=========================================
            if %curskill = lumber
              {
                if ( %woodgetMsg in #journal ) || ( %hackatthetree in #journal )
                  {
                    if Pine in #journal && %temptreeinfo notin *pinetiles
                    {
                      execute cmd.exe /c echo gosub pine %temptreeinfo , _ >> Tiles_database.txt
                      set *pinetiles *pinetiles , %temptreeinfo , _
                      }
                    if Ash in #journal && %temptreeinfo notin *ashtiles
                    {
                       execute cmd.exe /c echo gosub ash %temptreeinfo , _ >> Tiles_database.txt
                      set *ashtiles *ashtiles , %temptreeinfo , _
                      }
                    if Mohogany in #journal && %temptreeinfo notin *mohoganytiles
                    {
                       execute cmd.exe /c echo gosub mohogany %temptreeinfo , _ >> Tiles_database.txt
                      set *mohoganytiles *mohoganytiles , %temptreeinfo , _
                      }
                    if Yew in #journal && %temptreeinfo notin *yewtiles
                    {
                       execute cmd.exe /c echo gosub yew %temptreeinfo , _ >> Tiles_database.txt
                      set *yewtiles *yewtiles , %temptreeinfo , _
                      }
                    if Oak in #journal && %temptreeinfo notin *oaktiles
                    {
                       execute cmd.exe /c echo gosub oak %temptreeinfo , _ >> Tiles_database.txt
                      set *oaktiles *oaktiles , %temptreeinfo , _
                      }
                    if Zircote in #journal && %temptreeinfo notin *zircotetiles
                    {
                       execute cmd.exe /c echo gosub zircote %temptreeinfo , _ >> Tiles_database.txt
                      set *zircotetiles *zircotetiles , %temptreeinfo , _
                      }
                    if Ebony in #journal && %temptreeinfo notin *ebonytiles
                    {
                       execute cmd.exe /c echo gosub ebony %temptreeinfo , _ >> Tiles_database.txt
                      set *ebonytiles *ebonytiles , %temptreeinfo , _
                      }
                    if Bamboo in #journal && %temptreeinfo notin *bambootiles
                    {
                       execute cmd.exe /c echo gosub bamboo %temptreeinfo , _ >> Tiles_database.txt
                      set *bambootiles *bambootiles , %temptreeinfo , _
                      }
                    if Purple in #journal && %temptreeinfo notin *purpletiles
                    {
                       execute cmd.exe /c echo gosub purple %temptreeinfo , _ >> Tiles_database.txt
                      set *purpletiles *purpletiles , %temptreeinfo , _
                      }
                    if Redwood in #journal && %temptreeinfo notin *redwoodtiles
                    {
                       execute cmd.exe /c echo gosub redwood %temptreeinfo , _ >> Tiles_database.txt
                      set *redwoodtiles *redwoodtiles , %temptreeinfo , _
                      }
                    if Petrified in #journal && %temptreeinfo notin *petrifiedtiles
                    {
                      execute cmd.exe /c echo gosub petrified %temptreeinfo , _ >> Tiles_database.txt
                      set *petrifiedtiles *petrifiedtiles , %temptreeinfo , _
                      }
                    return
                  }
                if ( %BreakAxeMsg in #journal ) || ( %treeEmptyMsg in #journal ) || ( %cantLumberMsg in #journal ) || ( %cantPlaceWood in #journal ) || ( %cantseeMsg in #journal ) || ( %toofarMsg in #journal ) || ( %backpackfullMsg in #journal )
                  {
                    set %stillLumber #false
                    return
                  }
              }
          }
      }
    return
  }

sub smelt
  {
    set #lpc 10
    smelt_start:
    finditem DWJ C_ , #backpackid
    if #findcnt > 0
      {
        for %i 1 #findcnt
          {
            set #findindex %i
            set #lobjectid #findid
            set #ltargetid %forgeID
            set #ltargetkind 1
            while #targcurs = 0
              {
                event macro 17
                wait 5
              }
            target
            event macro 22
            wait 5
          }
      }
    finditem DWJ C_ , #backpackid
    if #findcnt > 0
      goto smelt_start
    set #lpc 1000
    return
  }

sub keys
  {
    set #lpc 10

    ;=====================
    ;==== MINING KEYS ====
    ;=====================
    if %curskill = mining
      {
        if %keyid <> none
          {
            finditem ENK C_ , #backpackid
            if #findcnt > 0
              {
                set #lobjectid %keyID
                event macro 17
                while #contsize <> 505_270
                  wait 1
                set %x #contposx + 294
                set %y #contposy + 233
                click %x %y
                target
                for %i 1 #findcnt
                  {
                    set #findindex %i
                    set #ltargetid #findid
                    set #ltargetkind 1
                    event macro 22
                    target
                  }
                set %x #contposx + 294
                set %y #contposy + 233
                click %x %y r
                key esc
              }
          }
        if %stoneKeyID <> none
          {
            finditem BVI C_ , #backpackid
            if #findcnt > 0
              {
                set #lobjectid %stonekeyID
                event macro 17
                while #contsize <> 505_270
                  wait 1
                set %x #contposx + 294
                set %y #contposy + 233
                click %x %y
                target
                for %i 1 #findcnt
                  {
                    set #findindex %i
                    set #ltargetid #findid
                    set #ltargetkind 1
                    event macro 22
                    target
                  }
                set %x #contposx + 294
                set %y #contposy + 233
                click %x %y r
                key esc
              }
          }
      }

    ;============================
    ;==== LUMBERJACKING KEYS ====
    ;============================
    if %curskill = lumber
      {
        if %woodKeyID <> none
          {
            finditem ZLK C_ , #backpackid
            if #findcnt > 0
              {
                set #lobjectid %woodkeyID
                event macro 17
                while #contsize <> 505_295
                  wait 1
                set %x #contposx + 290
                set %y #contposy + 260
                click %x %y
                target
                for %i 1 #findcnt
                  {
                    set #findindex %i
                    set #ltargetid #findid
                    set #ltargetkind 1
                    event macro 22
                    target
                  }
                set %x #contposx + 290
                set %y #contposy + 260
                click %x %y r
                key esc
              }
          }
      }
    set #lpc 1000
    return
  }

sub setup
  {

    ;======================
    ;==== MINING SETUP ====
    ;======================
    if %curskill = mining
      {
        ;====== find shovel
        finditem TWF_QPF C_ , #backpackid
        if #findcnt > 0
          {
            set %shovelID #findid
          }
        else
          {
            event exmsg #charid 3 33 No shovel found! stopping!
            halt
          }
        ;====== find forge
        finditem SMF C_ , #backpackid
        if #findcnt > 0
          {
            set %forgeID #findid
          }
        else
          {
            event exmsg #charid 3 33 No forge found! stopping!
            halt
          }
        ;====== find keys
        set %keyID none
        set %stoneKeyID none
        finditem NUI C_ , #backpackid
        if #findcnt > 0
          {
            for %i 1 #findcnt
              {
                set #findindex %i
                event property #findid
                if metal in #property
                  {
                    set %keyID #findid
                  }
                if stone in #property
                  {
                    set %stonekeyID #findid
                  }
              }
          }
        if %keyID = none
          {
            event exmsg #charid 3 33 No metal keys found! stopping!
            halt
          }
        menu delete setup
        menu delete miningactive
        menu font bgcolor green
        menu text mining 810 250 Mining
        return
      }

    ;=============================
    ;==== LUMBERJACKING SETUP ====
    ;=============================
    if %curskill = lumber
      {
        ;====== find hatchet
        finditem %axes C_ , #backpackid
        if #findcnt > 0
          {
            gosub equipaxe
            set %hatchetid #findid
          }
        else
          {
            event macro 24 1
            wait 20
            finditem %axes C_ , #backpackid
            if #findcnt > 0
              {
                wait 60
                gosub equipaxe
                set %hatchetid #findid
              }
            else
              {
                event exmsg #charid 3 33 No hatchet found! stopping!
                halt
              }
          }
        ;====== find keys
        set %woodkeyID none
        finditem NUI C_ , #backpackid
        if #findcnt > 0
          {
            for %i 1 #findcnt
              {
                set #findindex %i
                event property #findid
                if wood in #property
                  {
                    set %woodkeyID #findid
                  }
              }
          }
        if %woodkeyID = none
          {
            event exmsg #charid 3 33 No wood keys found! stopping!
            halt
          }
        menu font bgcolor green
        menu delete setup
        menu delete lumberactive
        menu text lumber 816 250 Lumberjacking
        menu delete smelt
        menu font bgcolor green
        menu button equip 810 130 80 30 Re-equip
        return
      }
    return  
  }

;========================================================================
;* @name EquipAxe
;* @author snicker7
;* @ver 0.1 16Jan05
;* @purpose Equip the axe in your backpack.
;* @params none
;* @returns none
;* @notes eventually plan to standardize to EquipWeapon, passing weapon
;*	ID and lefthandedness/righthandedness of the weapon to equip it.
;* @example: gosub EquipAxe
;* @status done
;========================================================================
sub EquipAxe
  {
    namespace push
    namespace local S7EquipAxe
    finditem %axes C_ , #backpackid
    set #lhandid #findid
    set #rhandid yc
    event macro 24 1
    wait 20
    if #lhandid <> #findid || #rhandid <> YC
      {
        set #lhandid #findid
        wait 60
        event macro 24 1
      }
    namespace clear
    namespace pop
    return
  }

sub smallGrid
  {
    set #lpc 1000
    set %string %1
    str pos %string y
    set %ypos #strres + 1
    set %len %ypos - 3
    str mid %string 2 %len
    set %rawx #strres
    str mid %string %ypos 2 
    set %rawy #strres   
    for %i -16 16
      {
        for %j -16 16
          {
            set %x %i + %rawx * 5
            set %y %j + %rawy * 5
            gosub XYtoM %x %y
            if ( ( %mx <= 790 && %mX >= 0 ) && ( %mY <= 590 && %mY >= 0 ) )
              {
                set %tilex #charposx + %x
                set %tiley #charposy + %y
                tile get %tilex %tiley 1
                ;tile cnt %tilex %tiley 1
                ;event sysmessage x: %tilex y: %tiley name: #tilename type: #tiletype
                if %curskill = lumber
                  {
                    ;====== if not a tree then it's black small grid spot
                    tile cnt %tilex %tiley #cursKind
                    if #TILECNT < 2
                      {
                        menu font bgcolor black
                        goto smallgrid
                      }
                    tile Get %tilex %tiley 2 #cursKind
                    if #TILETYPE notin %treestile
                      {
                        if #TILECNT < 3
                          {
                            menu font bgcolor black
                            goto smallgrid
                          }
                        tile Get %tilex %tiley 3 #cursKind
                        if #TILETYPE notin %treestile
                          {
                            menu font bgcolor black
                            goto smallgrid
                          }
                      }
                    ;=====================================================
                    
                    menu font bgcolor red

                    set %temptreeinfo x , %tilex , y , %tiley , type , #tiletype
                    if %temptreeinfo in *pinetiles
                      {
                        menu font bgcolor $8c1000
                        menu font color white
                        set %menubutton smallgridx , %i , y , %j
                        menu button %menubutton %mX %mY 20 20 Pi
                        goto endloop
                      }
                    if %temptreeinfo in *ashtiles
                      {
                        menu font bgcolor $949494
                        menu font color white
                        set %menubutton smallgridx , %i , y , %j
                        menu button %menubutton %mX %mY 20 20 As
                        goto endloop
                      }
                    if %temptreeinfo in *mohoganytiles
                      {
                        menu font bgcolor $5aadad
                        menu font color white
                        set %menubutton smallgridx , %i , y , %j
                        menu button %menubutton %mX %mY 20 20 Mo
                        goto endloop
                      }
                    if %temptreeinfo in *yewtiles
                      {
                        menu font bgcolor $00a5ce
                        menu font color white
                        set %menubutton smallgridx , %i , y , %j
                        menu button %menubutton %mX %mY 20 20 Ye
                        goto endloop
                      }
                    if %temptreeinfo in *oaktiles
                      {
                        menu font bgcolor $948429
                        menu font color white
                        set %menubutton smallgridx , %i , y , %j
                        menu button %menubutton %mX %mY 20 20 Oa
                        goto endloop
                      }
                    if %temptreeinfo in *zircotetiles
                      {
                        menu font bgcolor $31bd08
                        menu font color white
                        set %menubutton smallgridx , %i , y , %j
                        menu button %menubutton %mX %mY 20 20 Zi
                        goto endloop
                      }
                    if %temptreeinfo in *ebonytiles
                      {
                        menu font bgcolor $004abd
                        menu font color white
                        set %menubutton smallgridx , %i , y , %j
                        menu button %menubutton %mX %mY 20 20 Eb
                        goto endloop
                      }
                    if %temptreeinfo in *bambootiles
                      {
                        menu font bgcolor $ce9439
                        menu font color white
                        set %menubutton smallgridx , %i , y , %j
                        menu button %menubutton %mX %mY 20 20 Ba
                        goto endloop
                      }
                    if %temptreeinfo in *purpletiles
                      {
                        menu font bgcolor $b5297b
                        menu font color white
                        set %menubutton smallgridx , %i , y , %j
                        menu button %menubutton %mX %mY 20 20 Pu
                        goto endloop
                      }
                    if %temptreeinfo in *redwoodtiles
                      {
                        menu font bgcolor $080000
                        menu font color white
                        set %menubutton smallgridx , %i , y , %j
                        menu button %menubutton %mX %mY 20 20 Re
                        goto endloop
                      }
                    if %temptreeinfo in *petrifiedtiles
                      {
                        menu font bgcolor $080000
                        menu font color white
                        set %menubutton smallgridx , %i , y , %j
                        menu button %menubutton %mX %mY 20 20 Pe
                        goto endloop
                      }
                    set %menubutton smallgridx , %i , y , %j
                    menu button %menubutton %mX %mY 12 12
                    goto endloop
                  }
                if %curskill = mining
                  {
                    set %tiletypefix x , #tiletype , x
                    if ( %tiletypefix in %miningtiletypes ) || ( cave_floor in #tilename )
                      {
                        set %tiletypefix none
                        menu font bgcolor red
                        set %menubutton smallgridx , %i , y , %j
                        menu button %menubutton %mX %mY 10 10
                        goto endloop
                      }
                    else
                      {
                        tile get %tilex %tiley 2
                        set %tiletypefix x , #tiletype , x
                        if ( %tiletypefix in %miningtiletypes ) || ( cave_floor in #tilename )
                          {
                            set %tiletypefix none
                            menu font bgcolor red
                            set %menubutton smallgridx , %i , y , %j
                            menu button %menubutton %mX %mY 10 10
                            goto endloop
                          }
                        else
                          {
                            set %tiletypefix none
                            menu font bgcolor black
                          }
                      }
                  }
                smallgrid:
                if ( %i <= 3 && %i >= -3 ) && ( %j <= 3 && %j >= -3 )
                  {
                    set %menubutton smallgridx , %i , y , %j
                    menu button %menubutton %mX %mY 10 10
                  }
                endloop:
              }
          }
      }
    return
  }

sub wipeSmallGrid
  {
    for %i -16 16
      {
        for %j -16 16
          {
            set %menubutton smallgridx , %i , y , %j
            menu delete %menubutton
          }
      }
    return
  }

sub rawScan
  {
    ;set %type %1
    gosub wipeRawGrid
    menu font bgcolor blue
    for %i -3 3
      {
        for %j -3 3
          {
            set %x %i * 5
            set %y %j * 5
            gosub XYtoM %x %y
            if ( ( %mx <= 790 && %mX >= 0 ) && ( %mY <= 590 && %mY >= 0 ) )
              {
                set %buttonname rawGridx , %i , y , %j
                menu button %buttonname %mX %mY 10 10
              }
          }
      }
    gosub smallgrid x0y0
    return
  }

sub XYtoM
  {
    set %mX 400 + %1 * %delta - %2 * %delta - 5
    set %mY 300 + %1 * %delta + %2 * %delta - 5
    return
  }

sub wipeRawGrid
  {
    for %i -3 3
      {
        for %j -3 3
          {
            set %buttonname rawgridx , %i , y , %j
            menu delete %buttonname
          }
      }
    return
  }

sub load
  {
    set *pinetiles
    set *ashtiles
    set *mohoganytiles
    set *yewtiles
    set *oaktiles
    set *zircotetiles
    set *ebonytiles
    set *bambootiles
    set *purpletiles
    set *redwoodtiles
    set *petrifiedtiles
    event sysmessage Loading
    call Tiles_database.txt
    event sysmessage Tile info from database loading successful.
    return
  }
Bugfix:

ver 1.01
- fixed coordinate problem when click to chop far tree

ver 1.02
- some messages fix
- menu fix
- pickaxe usage added
- mining would find and color in red ore spots
- fixed bug with abnormal reaction on clicking on tree while you choose spot to go when mining

ver 1.03
- smelt sub fix
- save lumberjack spot information in "Tiles_database.txt" file, function to load it and ability to share with other players

ver 1.04
- fixed stopping macro if the only available axe is already in hand (unequips first)
- fixed error with tile info saving when find new spot
Attachments
Tiles_database.zip
(495 Bytes) Downloaded 617 times
Last edited by DentonA on Tue Sep 06, 2011 1:55 am, edited 2 times in total.
DentonA
Passer by
Posts: 3
Joined: Sun Aug 14, 2011 7:06 pm

Re: Lumberjack & Mining HUD

Post by DentonA »

Get the last update of script!
ladulala
Apprentice Scribe
Posts: 12
Joined: Sat Feb 22, 2014 2:21 am

Re: Lumberjack & Mining HUD

Post by ladulala »

Great Script.
Adramalech
Expert Scribe
Posts: 30
Joined: Fri Jan 29, 2016 2:57 pm

Re: Lumberjack & Mining HUD

Post by Adramalech »

This macro causes my EasyUO to "Not respond"
deliverance
Passer by
Posts: 3
Joined: Sun Jan 24, 2016 11:31 pm

Re: Lumberjack & Mining HUD

Post by deliverance »

I'm getting same thing makes easy uo not respond
Adramalech
Expert Scribe
Posts: 30
Joined: Fri Jan 29, 2016 2:57 pm

Re: Lumberjack & Mining HUD

Post by Adramalech »

Just let it sit for a minute, it will pop up.
Locked