02-20-2012, 09:59 AM
A gift for you slimey bichez.
Copy and paste this into EasyUO for an updated version of the popular OzMining for Imagine Nation.
Follow all of the instructions! I left plenty of comments in there to make things easier to understand (hopefully)
For those of you who want to take the time...this will make editing the script for mining elsewhere much easier. Simply edit the relevant variables and values and it should work :p
DOWNLOAD EasyUO: http://download.easyuo.com/cheffe/euox196.zip - if this link isn't proper, someone let me know and ill edit. I took it from old thread
If you're lazy and don't want to do that, PM me and I'll do it for you...for the right price
Also PM me if there are any bugs or the script isn't running properly.
Copy and paste this into EasyUO for an updated version of the popular OzMining for Imagine Nation.
Follow all of the instructions! I left plenty of comments in there to make things easier to understand (hopefully)
Code:
; OzMining 1.0
; This is OzMining 1.1 Edited by Atlas
;
; For mining on the Imagine Nation 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. )
; -Removed this because it doesn't work on windows vista/7...copy/paste from old version if you want it back =p
;
; - Upates in 1.1
; *Patched up the infinite looping of failed mining [constantly loosening rocks] with a time-limit catch.
; *Added convenient global variables/constants to top for easy editing.
; *Enabled smelting of 'smaller stacks' (i.e. ores in stacks of 1, 2, and 3)
; *Allows exclusion of unwanted ores.
; *Found major error where all #CHARPOSY's were X's...hopefully fixed
; *Cleaned up certain bits...and made some more messy =]
; *Commented like a mother****er!
;
; Known bugs:
; - Macro gets "stuck" mining too fast sometimes -patched up, but not 100% fixed
; - Sometimes gets suck on "Can't Get There" [more rare]
;
; ============= 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.
; on the right side of EUO window, expand "Container Info"
; #CONTID variable 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 MHDDDND
; Change this to whatever ID your bank container has.
set %bankcontainerID ITESOMD
; Edit these integers according to how often you wish to bank/smelt your ore.
; If you set the value closer to your max weight (so lower values), it will bank/smelt more often
; Set it to ZER0 for default. Typically the bankweight var should be slightly MORE than smeltweight
set %bankweight 80
set %smeltweight 50
;Change these to whatever ores you wish to skip after digging once.
;The script will see when you dig the ore once, and move on to the next spot.
;If you don't want it to avoid ores, simply set the "you_dig_some_[ore]" to some short string of characters.
;Example: "gjrkgj" or "you_dig_some_Atlas" ... CANNOT be blank or a common phrase.
set %Ore1 you_dig_some_Atlas
set %Ore2 you_dig_some_Atlas
set %Ore3 you_dig_some_Shadow
set %Ore4 you_dig_some_Rose
set %Ore5 you_dig_some_Verite
set %Ore6 you_dig_some_Gold
set %Ore7 you_dig_some_Ice
set %Ore8 you_dig_some_Amethyst
; Change these X and Y locations (using .where) to change your desired pathfinding points when banking.
; Change the Z if there's a third number using .where (if the ground inclines/declines)
set %pfPosX0 2562
set %pfPosY0 491
set %pfPosZ0 0
set %pfPosX1 2558
set %pfPosY1 506
set %pfPosZ1 0
set %pfPosX2 2562
set %pfPosY2 513
set %pfPosZ2 15
; Change the "forgePosX/Y" below (using .where) to change your desired pathfinding locations to the forge
; (Should already be correct for Mt. Kendall)
; ================================================================================================
set #LPC 10
set %forgePosX 2574
set %forgePosY 490
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.1
while #charghost <> YES
{
if ( #WEIGHT > #MAXWEIGHT - %smeltweight ) ;smeltweight value here
gosub GoSmelt
if %status = no_more_ore
{
set %status idle
goto MoveToNextSpot
}
if ( #WEIGHT > 400 )
gosub GoSmelt
set %jrnl #jindex
gosub MineThisSpot
gosub ProcessResults
}
sub MineThisSpot ;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 10s
event Macro 22 0
set %status mining
}
return
sub ProcessResults
set %theTime #TIME ;sub ProcessResults
while %status = mining
{
set %jrnl #jindex
scanjournal %jrnl
if you_dig_some in #journal || You_have_moved_too_far in #journal || Someone_has_gotten in #journal
{
set %status idle
set %theTime #TIME
}
if you_loosen_some_rocks in #journal ;This is where it loops infinitely sometimes
set %status idle
if there_is_no_metal_here_to_mine in #journal || you_can't_mine_that in #journal || target_cannot_be_seen in #journal
{
set %status no_more_ore
gosub MoveToNextSpot
}
;===================================== Exempt-ore-type vars here =====================================
if %Ore1 in #journal || %Ore2 in #journal || %Ore3 in #journal || %Ore4 in #journal || %Ore5 in #journal || %Ore6 in #journal || %Ore7 in #journal || %Ore8 in #journal
{
set %status no_more_ore
gosub MoveToNextSpot
set %theTime #TIME
}
;=====================================================================================================
;if for_validating_your_presence in #journal ;Commented out - not needed for Imagine Nation
;{
; set %status no_more_ore
; gosub MoveToNextSpot
;}
if #TIME > ( %theTime + 14 ) ;This is a catch to prevent infinite looping
{ ;It keeps track of time. As soon as 14 seconds have passed, it moves on to a different spot after 10 second pause
set %status no_more_ore
wait 10s
gosub MoveToNextSpot
}
}
return
sub MoveToNextSpot ;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 ;sub GoSmelt
set #LPC 1
SmeltOre:
set %oldX #charposX
set %oldY #charposY
event pathFind %forgePosX %forgePosY
wait 2s
if ( #charposX = %oldX && #charposY = %oldY )
goto SmeltOre
CheckForMoreOre:
finditem DWJ C ;Check stacks of 4+ and smelt
if #FINDCNT > 0
{
set #lObjectId #findId
event macro 17 0
goto CheckForMoreOre
}
finditem GWJ ;Check stacks of 3 and smelt
if #FINDCNT > 0
{
set #lObjectId #findId
event macro 17 0
goto CheckForMoreOre
}
finditem EWJ ;Check stacks of 2 and smelt
if #FINDCNT > 0
{
set #lObjectId #findId
event macro 17 0
goto CheckForMoreOre
}
finditem TVJ ;Check for 1 ore and smelt
if #FINDCNT > 0
{
set #lObjectId #findId
event macro 17 0
goto CheckForMoreOre
}
wait 1s
if ( #weight > #maxweight - %bankweight ) ;BANK WEIGHT VALUE HERE
gosub BankOre
GoBack:
event pathFind %oldX %oldY
wait 2s
if ( #charposX = %forgePosX && #charposY = %forgePosY )
goto FindNextSpot
return
sub BankOre ;sub BankOre
if ( %DegugMode )
event sysmessage ++ Going to bank ingots...
BankingStep0:
event pathFind %pfPosX0 %pfPosY0 %pfPosZ0 ;Should coincide with pathfinding varibles/coordinates at the top
wait 1s
if ( #CHARPOSX <> %pfPosX0 && #CHARPOSY <> %pfPosY0 )
goto BankingStep0
if Can't_get_there in #journal
gosub MoveToNextSpot
BankingStep1:
event pathFind %pfPosX1 %pfPosY1 %pfPosZ1
wait 1s
if ( #CHARPOSX <> %pfPosX1 && #CHARPOSY <> %pfPosY1 )
goto BankingStep1
if Can't_get_there in #journal
gosub MoveToNextSpot
BankingStep2:
event pathFind %pfPosX2 %pfPosY2 %pfPosZ2
wait 1s
if ( #CHARPOSX <> %pfPosX2 && #CHARPOSY <> %pfPosY2 )
goto BankingStep2
if Can't_get_there in #journal
gosub MoveToNextSpot
Openbank:
set #LOBJECTID %bankID
event macro 17 0
wait 10
if ( #CONTID <> %bankcontainerID )
{
goto Openbank
event sysmessage Your bank CONTID (bankcontainerID) is incorrect. ; -Atlas
}
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 %pfPosX1 %pfPosY1 %pfPosZ1
wait 1s
if ( #CHARPOSX <> %pfPosX1 && #CHARPOSY <> %pfPosY1 )
goto GoingBackStep1
GoingBackStep2:
event pathFind %pfPosX0 %pfPosY0 %pfPosZ0
wait 1s
if ( #CHARPOSX <> %pfPosX0 && #CHARPOSY <> %pfPosY0 )
goto GoingBackStep2
GoingBackStep3:
event pathFind %forgePosX %forgePosY
wait 1s
if ( #CHARPOSX <> %forgePosX && #CHARPOSY <> %forgePosY )
goto GoingBackStep3
set #LPC 10
return
For those of you who want to take the time...this will make editing the script for mining elsewhere much easier. Simply edit the relevant variables and values and it should work :p
DOWNLOAD EasyUO: http://download.easyuo.com/cheffe/euox196.zip - if this link isn't proper, someone let me know and ill edit. I took it from old thread
If you're lazy and don't want to do that, PM me and I'll do it for you...for the right price
Also PM me if there are any bugs or the script isn't running properly.