Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Easy UO Script: Mining at Mt. Kendall
#1

This is an Easy UO Script that is customized to work on Imagine Nation and won't work on other UO shards without editing.

You'll have to do some editing on this one, but this is a mining script for Mt. Kendall. It will mine, move to the forge when you're at your weight limit, smelt, then go back to mining. Once you're overweight with ingots, it will walk to the bank box outside, use it, then put all your ingots into a bag in the bank. Very useful, but it makes you a PK target and it tends to cut out sometimes:

Code:
; OzMining 1.0
;
; For mining at Mt. Kendall on IN:X shard.
;
; Features:
; - Moves around the mine randomly
; - Mines a tile clean of ore before moving on to next one
; - Smelting when overweight
; - Banking ore when you have certain amount of weight after smelting
;
; - Notifies you with a sound if your character is dead and stops the macro
;   ( might only work in windows xp.. )
;   ( replace sounds with some other ones if you use another OS. )
;
; Known bugs:
; - Macro gets "stuck" mining too fast sometimes
;
; ============= User variables and instructions ================================
; YOU WILL NEED TO CHANGE THE ID VALUES BELOW TO MATCH YOUR CHARACTERS CONTAINERS
; OR AUTOMATIC BANKING WON'T WORK CORRECTLY!

; You can find out ID of a container by having EUO running and opening a container.
; Right side of EUO window there should be "Container Info" as a folded menu and
; there #CONTID variable now holds the information. For example LHUGMMD

; Change this to the ID of container in your bank where you would like
; your ingots to be placed.
set %ingotContainer AXITEND

; Change this to whatever ID your bank container has.
set %bankcontainerID JWHLKMD

; ==============================================================================

set #LPC 10
set %forgePosX 2570
set %forgePosY 482
set %ingotTypes RMK_BVI
set %forgeTypes JBG_JJ_SMF
set %toolTypes QPF
set %status idle
set %bankID DMMRJMD
set %DebugMode #true

event sysmessage Starting OzMining 1.0

while #charghost <> YES
{
  if ( #WEIGHT > #MAXWEIGHT )
      gosub GoSmelt
  if %status = no_more_ore
  {
     set %status idle
     goto MoveToNextSpot
  }
  if ( #WEIGHT > #MAXWEIGHT )
     gosub GoSmelt
  set %jrnl #jindex
  gosub MineThisSpot
  gosub ProcessResults
}
; Player dead: stopping macro after making some racket..
sound Windows XP critical stop.wav
wait 2s
sound Windows XP critical stop.wav
wait 2s
sound Windows XP critical stop.wav
wait 2s
halt

sub MineThisSpot
  set #LPC 10
  if ( %status <> idle )
      return
  finditem %tooltypes C
  if #FINDCNT > 0
  {
    set #lObjectId #findId
    event macro 17 0
    tile Init
    Tile Get #CharPosX #CharPosY 2
    set #lTargetTile #tileType
    set #lTargetX #charPosX
    set #lTargetY #charPosY
    set #lTargetZ #charPosZ
    set #lTargetKind 3
    target 20s
    event Macro 22 0

    set %status mining
  }
return

sub ProcessResults
  while %status = mining
  {
    if #jindex > %jrnl
    {
      set %jrnl %jrnl + 1
      scanjournal %jrnl
      if you_dig_some in #journal
        set %status idle
      if you_loosen_some_rocks in #journal
        set %status idle
      if World_save_complete in #journal
        set %status idle
      if You_have_moved_too_far in #journal
        set %status idle
      if Someone_has_gotten in #journal
        set %status idle
      if Can't_mine_that in #journal
        set %status idle
      if target_cannot_be_seen in #journal
      {
        set %status no_more_ore
        gosub MoveToNextSpot
      }
      if there_is_no_metal_here_to_mine in #journal
      {
        set %status no_more_ore
        gosub MoveToNextSpot
      }
      if you_can't_mine_that in #journal
      {
        set %status no_more_ore
        gosub MoveToNextSpot
      }
      if world_save_complete. in #journal
      {
        set %status no_more_ore
        gosub MoveToNextSpot
      }
      if that_is_too_far_away in #journal
      {
        set %status no_more_ore
        gosub MoveToNextSpot
      }
      if for_validating_your_presence in #journal
      {
        set %status no_more_ore
        gosub MoveToNextSpot
      }
    }
  }
return

sub MoveToNextSpot
  set #LPC 1
  if ( %DegugMode )
      event sysmessage ++ Trying to find a new location to mine...

FindNextSpot:
  set %GotoX #charposX
  set %GotoY #charposY
  set %oldX #charposX
  set %oldY #charposY

  set %randomInc #random % 5
  ; negative or positive?
  set %nDirection #random % 2
  if %nDirection = 1
     set %randomInc %randomInc * -1
  set %GotoX %GotoX + %randomInc

  ; Random amount of tiles to a direction
  set %randomInc #random % 5
  ; negative or positive?
  set %nDirection #random % 2
  if %nDirection = 1
     set %randomInc %randomInc * -1
  set %GotoY %GotoY + %randomInc

  if ( %DegugMode )
      event sysmessage -- Initializing tile info...
  tile Init
  tile Get %GotoX %GotoY 2
  if ( %DegugMode )
      event sysmessage #tilename / #tiletype
  if ( #tilename = cave_floor )
  {
      if ( %DegugMode )
          event sysmessage Found cave location...
      event pathFind %GotoX %GotoY
      wait 10
      if ( #charposX = %oldX && #charposY = %oldY )
         goto FindNextSpot
  }
  if ( #charposX <> %oldX && #charposY <> %oldY )
      if ( #charposX = %GotoX && #charposY = %GotoY )
          set %status idle
  else
      goto FindNextSpot
  set #LPC 10
return

sub GoSmelt
  set #LPC 1
SmeltOre:
  set %oldX #charposX
  set %oldY #charposY

  event pathFind %forgePosX %forgePosY
  wait 1s
  if ( #charposX = %oldX && #charposY = %oldY )
      goto SmeltOre
CheckForMoreOre:
  finditem  DWJ C
  if #FINDCNT > 0
  {
      set #lObjectId #findId
      event macro 17 0
      goto CheckForMoreOre
  }
  wait 1s
  if ( #weight > #maxweight - 50 )
      gosub BankOre
GoBack:
  event pathFind %oldX %oldY
  wait 1s
  if ( #charposX = %forgePosX && #charposY = %forgePosY )
      goto GoBack
return

sub BankOre
  if ( %DegugMode )
      event sysmessage ++ Going to bank ingots...
BankingStep1:
  event pathFind 2561 492
  wait 1s
  if ( #CHARPOSX <> 2561 && #CHARPOSX <> 492 )
      goto BankingStep1
BankingStep2:
  event pathFind 2559 504
  wait 1s
  if ( #CHARPOSX <> 2559 && #CHARPOSX <> 504 )
      goto BankingStep2
BankingStep3:
  event pathFind 2564 513 15
  wait 1s
  if ( #CHARPOSX <> 2564 && #CHARPOSX <> 513 )
      goto BankingStep3
Openbank:
  set #LOBJECTID %bankID
  event macro 17 0
  wait 10
  if ( #CONTID <> %bankcontainerID )
      goto Openbank
BankMore:
  finditem %ingotTypes C
  if #FINDCNT > 0
  {
      Exevent Drag #findid #findstack
        wait 10
        Exevent Dropc %ingotContainer
        wait 10
        goto BankMore
  }
  wait 1s
  event sysmessage ++ Going back...
GoingBackStep1:
  event pathFind 2559 504 0
  wait 2s
  if ( #CHARPOSX <> 2559 && #CHARPOSX <> 504 )
      goto GoingBackStep1
GoingBackStep2:
  event pathFind 2561 492
  wait 2s
  if ( #CHARPOSX <> 2561 && #CHARPOSX <> 492 )
      goto BankingStep2
GoingBackStep3:
  event pathFind %forgePosX %forgePosY
  wait 2s
  if ( #CHARPOSX <> %forgePosX && #CHARPOSX <> %forgePosY )
      goto GoingBackStep3
  set #LPC 10
return


Messages In This Thread
Easy UO Script: Mining at Mt. Kendall - by Taran - 06-19-2011, 10:43 AM
Easy UO Script: Mining at Mt. Kendall - by Morwen - 06-27-2011, 12:39 AM
Easy UO Script: Mining at Mt. Kendall - by Taran - 06-27-2011, 05:08 PM
Easy UO Script: Mining at Mt. Kendall - by Morwen - 06-27-2011, 11:07 PM
Easy UO Script: Mining at Mt. Kendall - by BlackBeard - 07-06-2011, 05:15 PM
Easy UO Script: Mining at Mt. Kendall - by Eru - 07-06-2011, 05:23 PM
Easy UO Script: Mining at Mt. Kendall - by Taran - 07-06-2011, 08:02 PM
Easy UO Script: Mining at Mt. Kendall - by Cana - 07-06-2011, 10:10 PM
Easy UO Script: Mining at Mt. Kendall - by Morwen - 07-07-2011, 01:20 AM
Easy UO Script: Mining at Mt. Kendall - by Morwen - 07-07-2011, 02:05 AM
Easy UO Script: Mining at Mt. Kendall - by Eru - 07-07-2011, 02:20 AM
Easy UO Script: Mining at Mt. Kendall - by Morwen - 07-07-2011, 01:42 PM
Easy UO Script: Mining at Mt. Kendall - by Venos - 07-07-2011, 05:20 PM
Easy UO Script: Mining at Mt. Kendall - by zenith - 07-20-2011, 02:48 AM
Easy UO Script: Mining at Mt. Kendall - by Venos - 07-20-2011, 10:35 AM
Easy UO Script: Mining at Mt. Kendall - by Morwen - 08-02-2011, 09:39 PM
Easy UO Script: Mining at Mt. Kendall - by Morwen - 08-02-2011, 10:39 PM
Easy UO Script: Mining at Mt. Kendall - by Morwen - 08-03-2011, 01:06 AM
Easy UO Script: Mining at Mt. Kendall - by Taran - 08-03-2011, 12:11 PM
Easy UO Script: Mining at Mt. Kendall - by JointCh1L - 08-29-2011, 12:07 PM
Easy UO Script: Mining at Mt. Kendall - by Lamby - 08-29-2011, 08:07 PM
Easy UO Script: Mining at Mt. Kendall - by Morwen - 08-29-2011, 08:54 PM
Easy UO Script: Mining at Mt. Kendall - by Lamby - 08-29-2011, 10:21 PM
Easy UO Script: Mining at Mt. Kendall - by Morwen - 08-29-2011, 11:04 PM
Easy UO Script: Mining at Mt. Kendall - by Lamby - 08-30-2011, 01:28 AM
Easy UO Script: Mining at Mt. Kendall - by Morwen - 08-30-2011, 01:41 AM
Easy UO Script: Mining at Mt. Kendall - by Christina Thorn - 08-30-2011, 01:51 AM
Easy UO Script: Mining at Mt. Kendall - by Lamby - 08-30-2011, 01:40 PM
Easy UO Script: Mining at Mt. Kendall - by Morwen - 08-30-2011, 02:22 PM
Easy UO Script: Mining at Mt. Kendall - by Morwen - 08-30-2011, 02:25 PM
Easy UO Script: Mining at Mt. Kendall - by Lamby - 08-30-2011, 02:48 PM
Easy UO Script: Mining at Mt. Kendall - by Morwen - 08-30-2011, 03:29 PM
Easy UO Script: Mining at Mt. Kendall - by Lamby - 08-30-2011, 04:07 PM
Easy UO Script: Mining at Mt. Kendall - by Morwen - 08-30-2011, 04:53 PM
Easy UO Script: Mining at Mt. Kendall - by Lamby - 08-30-2011, 05:00 PM
Easy UO Script: Mining at Mt. Kendall - by Morwen - 08-30-2011, 05:27 PM
Easy UO Script: Mining at Mt. Kendall - by Morwen - 08-30-2011, 05:50 PM
Easy UO Script: Mining at Mt. Kendall - by Lamby - 08-30-2011, 05:51 PM
Easy UO Script: Mining at Mt. Kendall - by Morwen - 08-30-2011, 05:57 PM
Easy UO Script: Mining at Mt. Kendall - by Makaveli - 09-01-2011, 05:53 PM
Easy UO Script: Mining at Mt. Kendall - by Morwen - 09-01-2011, 07:47 PM
Easy UO Script: Mining at Mt. Kendall - by Ilithyia - 09-09-2011, 04:05 PM
Easy UO Script: Mining at Mt. Kendall - by Alexstrasza - 10-18-2011, 06:10 PM
Easy UO Script: Mining at Mt. Kendall - by Atlas - 10-18-2011, 07:04 PM
Easy UO Script: Mining at Mt. Kendall - by Morwen - 10-19-2011, 11:48 PM
Easy UO Script: Mining at Mt. Kendall - by Ilithyia - 10-20-2011, 02:39 AM
Easy UO Script: Mining at Mt. Kendall - by Morwen - 10-20-2011, 03:14 PM
Easy UO Script: Mining at Mt. Kendall - by Ilithyia - 10-22-2011, 07:38 PM
Easy UO Script: Mining at Mt. Kendall - by Morwen - 10-23-2011, 11:20 PM
Easy UO Script: Mining at Mt. Kendall - by Taran - 10-28-2011, 10:56 PM
Easy UO Script: Mining at Mt. Kendall - by Morwen - 10-29-2011, 11:00 AM
Easy UO Script: Mining at Mt. Kendall - by Lamby - 10-31-2011, 09:30 PM
Easy UO Script: Mining at Mt. Kendall - by Morwen - 10-31-2011, 10:59 PM
Easy UO Script: Mining at Mt. Kendall - by Ilithyia - 11-14-2011, 04:19 PM
Easy UO Script: Mining at Mt. Kendall - by Lamby - 11-14-2011, 04:35 PM
Easy UO Script: Mining at Mt. Kendall - by Morwen - 11-14-2011, 07:34 PM
Easy UO Script: Mining at Mt. Kendall - by Ilithyia - 11-15-2011, 02:50 AM
Easy UO Script: Mining at Mt. Kendall - by Craditz - 11-19-2011, 01:49 AM
Easy UO Script: Mining at Mt. Kendall - by Emerald - 11-19-2011, 05:35 AM
Easy UO Script: Mining at Mt. Kendall - by Azzo - 02-11-2012, 01:46 PM
Easy UO Script: Mining at Mt. Kendall - by Azzo - 02-13-2012, 12:50 PM
Easy UO Script: Mining at Mt. Kendall - by Azzo - 02-13-2012, 03:25 PM
Easy UO Script: Mining at Mt. Kendall - by pedrodilara - 02-16-2012, 04:32 PM
Easy UO Script: Mining at Mt. Kendall - by Elcid - 02-17-2012, 12:55 AM
Easy UO Script: Mining at Mt. Kendall - by Brandon - 02-18-2012, 01:42 AM
Easy UO Script: Mining at Mt. Kendall - by Eadred - 02-21-2012, 11:18 AM
Easy UO Script: Mining at Mt. Kendall - by igor - 03-16-2012, 05:19 PM
Easy UO Script: Mining at Mt. Kendall - by Syralia - 03-22-2012, 12:33 AM

Forum Jump:


Users browsing this thread: 6 Guest(s)