06-19-2011, 10:43 AM
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:
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