UOGamers Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

  • To obtain new Razor updates, please reinstall Razor from our new website.

Mining/Lumberjack code fragment demonstrating range reduction

I noticed in the mining macro it seemed to have a requirement for position. Well for cave mining that can be done differently using the targettile 'Current' as in were your standing. I then went ahead and adapted that to start at range 2, then range 1, then range current. I freely admit I have no clue as to what Range really does, in terms of does it do multi checks as in a circle or does it do a check directly in front of the character. This is the command type I am not clear on "targettilerelative 'self' 2", it would be nice to know for sure what it is doing rather than assume it is performing multiple checks. Any way this does work for mountain mining except I did find cases were you couldnt do anything and I just didnt pursue how to resolve it. I assume this works just fine for Luberjacking and may provide access to more trees (Delucia) etc.

Any way here it is. (Note this is the code I use to locate a spot, the working part is identical to the macro part.

Code:
unsetalias 'Shovel'
if not findtype 0xf39 0 'Backpack' 1 0
  replygump 0xe13358f7 6
  pause 500
  replygump 0x6abce12 14
  pause 500
  if not findtype 0xf39 0 'Backpack' 1 0
    sysmsg 'Shovel not found'
    stop
  endif
endif
setalias 'Shovel' 'found'
clearignorelist
unsetalias 'DoMore'
setalias 'DoMore' 'self'
while findalias 'DoMore'
  clearjournal
  pause 100
  useobject 'Shovel'
  pause 100
  if @findalias 'Range2'
    targettilerelative 'self' 2
    pause 100
    waitingfortarget 5000
    pause 500
    if @injournal 'Target cannot be seen.'
      @unsetalias 'Range2'
      @setalias 'Range1' 'self'
    elseif @injournal "You can't mine that."
      @unsetalias 'Range2'
      @setalias 'Range1' 'self'
    elseif @injournal "You can't mine there."
      @unsetalias 'Range2'
      @setalias 'Range1' 'self'
    elseif @injournal 'There is no metal here'
      clearjournal
      @unsetalias 'Range2'
      @setalias 'Range1' 'self'
      sysmsg 'Switch to Range1'
    endif
  elseif @findalias 'Range1'
    targettilerelative 'self' 1
    pause 100
    waitingfortarget 5000
    pause 500
    if @injournal 'Target cannot be seen.'
      @unsetalias 'Range2'
      @unsetalias 'Range1'
      @setalias 'RangeCurrent' 'self'
    elseif @injournal "You can't mine that."
      @unsetalias 'Range2'
      @unsetalias 'Range1'
      @setalias 'RangeCurrent' 'self'
    elseif @injournal "You can't mine there."
      @unsetalias 'Range2'
      @unsetalias 'Range1'
      @setalias 'RangeCurrent' 'self'
    elseif @injournal 'There is no metal here'
      clearjournal
      @unsetalias 'Range2'
      @unsetalias 'Range1'
      @setalias 'RangeCurrent' 'self'
      sysmsg 'Switch to RangeCurrent'
    endif
  elseif @findalias 'RangeCurrent'
    targettile 'current'
    pause 100
    waitingfortarget 5000
    pause 500
    if @injournal 'Target cannot be seen.'
      sysmsg 'Bad Spot: Target cannot be seen.'
      stop
    elseif @injournal "You can't mine that."
      sysmsg "Bad Spot: You can't mine that."
      stop
    elseif @injournal "You can't mine there."
      sysmsg "Bad Spot: You can't mine there."
      stop
    endif
  endif
  if @injournal 'There is no metal here'
    pause 100
    sysmsg 'The Vein is Done'
    pause 100
    unsetalias 'DoMore'
  endif
  if weight > 500 or not findalias 'DoMore'
// Insert your code to offload the ore/gems
  endif
endwhile
 
Last edited:
Top