Believe it or not, I've never written a fully automated mining script.  I've only used others' and gave feedback about them, usually a compliment, thank you and possibly thoughts/suggestions.
Below is a snippet of what my question concerns, so here it goes.
Is it possible to dig the tile my char is standing on?  I've hit a few roadblocks with using the tile command and setting ltargetx/y, ltargettile.  I've been searching here and there for the past several hours and haven't come to an answer.
Sub MainLoop
  GoSub TM_RailInit
  set %dest 2
  While #clilogged = 1
  {
    ;pause
    set #lobjectid %CurrentShovel
    event macro 17 0
    set #LTargetKind 2
    click %xcoord %ycoord f ;d ;       #charposx #charposY  ;click
    wait 1s
    GoSub TM_AdvJournalScan mine VALID_ADVANCE You_destroyed full
    if #result = #true ; shovel broke or backpack full
      GoSub CheckResources
    if #weight > ( #maxweight - 5 )
      GoSub Smelt
    GoSub TM_AdvJournalScan mine VALID_ADVANCE no_metal can't_mine cannot_see
    if #result = #true
    {
      call %railsubs TM_DetermineCurrentWaypointIndex
      set #result #result + 1
      Call %railsubs TM_RunRail Private_Cave #result %dest FW
      wait 1s
      set %dest #result + 1
      if #result = 113
      {
        set %dest 2
        Call %railsubs TM_RunRail Private_Cave Present %dest FW
      }
    }
    GoSub TM_AdvJournalSync mine 100
  }
  GoSub Mount on
Return