Anti-PK Mining MEGA script w/ Auto Recall (using charged rune book) and Auto Smelting by danstock._98439

/////// Anti-PK Mining MEGA script w/ Auto Recall (using charged rune book) and Auto Smelting ///// UO Outlands Razor script - Last updated May 23, 2024 (email any bug reports/tips to dan@danstockman.com) /// Created by DanStock - Pax Augustus of Terran // Auto MINING script with colour coded overhead messages for all scenarios. Clean UI with some RPG elements. // Auto SMELTING when next to any PLAYER-BUILT FORGE - and 10 second intervals to check for NATURAL FORGES (modify time under variable section). // Auto healing with BANDAGES as well as auto HEAL, REFRESH and CURE POTIONS as needed. // Auto trapped POUCH if PARALYZED. // Auto buff checks and activation for TRACKING and FOOD SATISFACTION. // Auto RECALL if RED player tracked/engaged (using charged runebook). // Auto TARGET & ATTACK greys if WAR MODE engaged - restarts auto-mining script once coast is clear! // Auto INGOT RECALL if more than 2000 total ingots in inventory (modify amount under variable section ). // Auto ORGANIZING and anti-theft with AGENT-11, AGENT-06, AGENT-04 and AGENT-03 (modify to your own preference). // Auto INVENTORY checks with overhead messages if anything is low or out of stock (modify under variable section). # Ideal skill template: # Mining (50-120) # Macing/Tactics/Anatomy/Camping (100) # Healing/Tracking (80) # Magic resist (40) # Required (or suggested *) inventory items: # Pickaxes # Escape runebook charged w/ recall scrolls # Trapped pouches # Weapon (war mace or quarter staff are my preference) # Bandages # Healing, Cure and Refresh potions (strength, agility and magic resist pots help too *) # Skinning knife * # Cheese (or fish steaks) * # Adventurers rope * # A blessed codex of Macing * # A blessed codex of Healing * # Harvest Aspect leather armour * # Organizer Agent-11 hotbag (for ingots - can be trapped pouch) # Organizer Agent-04 hotbag (for main inventory - I use a hidden stack of trapped pouches to deter theives and set this as the bottom one) # Organizer Agent-03 hotbag * (optional - for gold, grid loot, etc.) # Organizer Agent-06 hotbag * (optional for unloading loot & ingots at home/inn room) // To further clean things up, I suggest using some filters for repeated system/overhead messages. ### System messages to filter in Razor: ### // "What do you want to use this item on?" // "You do not see any harvestable resources nearby." // "You do not see any nearby forges" // "You smelt the ore" // "You dig some" // "You loosen some" // "Mining skillgain" // "No one matching that" // "Organize Agent" // "queued" // "Macro" // "Achievement" // "Your food satisfaction" // "You have worn out your tool" # Please also add the following COOLDOWNS (case sensitive) in UO client under Options -> Cooldowns: // Healing Potion // Cure Potion // Refresh Potion // Magic Shield * # TIPS: // Auto healing with bandages/potions script is running at all times. Modify potion set points under variable section. /// Will swap to WEAPON, target nearest grey and attack if WAR MODE is manually engaged - good for dealing with basic wilderness MOBs. //// Auto tracking skill check and activation. Will automatically select proper settings for RED ALERT trigger. ///// RED ALERT trigger also applies auto bandages, modifies potion set points and will POP trapped pouches if paralized while trying to escape - makes you very hard to kill 1 vs. 1! ////// Set Organizer-11 for ingots (can be a trapped pouch for added protection - but, if so, disable pouch opening under variable section). /////// Organizer-04 for main items (pots, bandages, weapons, tools, etc.) and optional Organizer-03 for gold, loot, etc. //////// Set Orgnanizer-06 as a secure storage container in your house or inn room for unloading ingots, loot, etc. ///////// Set Escape runebook first time using script. Change 'gumpresponse' input for specific rune targets below (default input 2 will target the first rune in the book). ////////// Make sure AUTO UNEQUIP AND REQUIP WEAPON to drink potions is selected in Razor client (if using 2 handed weapon). /////////// Setup hotkeys for running this script and another for stopping all scripts and that should be all you need! //////////// The only thing that stops the script are periodic Captcha checks. Otherwise, you just move around on auto pilot (and simply enable WAR MODE if you need to attack something). ///////////// I also setup a hotkey for ROPE, which I find useful for evading PKs or MOBs. ######################################## // Mining Variables // ######################################## ## NEW PLAYERS: If starting a new character/account, disable auto recall until you have a blessed/charged runebook (worth ~60-70k gp) in your inventory. ## Use the script to harvest 5,000+ iron ore, turn it into a commodity and sell it on Discord or through a player vendor to fund initial build items. ## Use the newbie dungeon on Shelter Island to build skills to 80 (tactics, anatomy, macing, healing, tracking and camping), then macro on a battle trainer to 100. Quick and cheap to level up! ## Enable auto attack, bandage healing, auto potions, etc. once your build/budget allows. ## This script will allow for growth via the user variables below until eventually the full script is used. ## Script is very effective against Red PKs with either successful auto recall or auto bandages/pots keeping you alive long enough to evade or fight back! ######################################################## ### Set values below as 1 to enable or 0 to disable. ### ######################################################## @setvar! EnableRedAlertRecall 1 @setvar! EnableAutoAttackGreyMOB 1 @setvar! EnableParalyzePouch 1 # This doesn't fit in my miner build, but including it for others. # Enable this variable to auto cast Magic Reflect (off by default) - Add Cooldown for "Magic Shield" in UO options: @setvar! EnableMagicReflection 0 # This will enable my "Cheese timer". You can disable (or just not carry cheese). # I use this just to track my progress. Not necessary, but I find it helps! @setvar! EnableCheeseTimer 1 # This will trigger a warning if no skinning knife in inventory: @setvar! EnableAutoCarving 1 # Set auto recall to Home or Inn or Inn (alt): @setvar! InnRecall 1 // or @setvar! HomeRecall 0 // or @setvar! AltInnRecall 0 # Alt will enter an Inn room that you don't own (for second accounts or someone else's room) # Set time between natural forge checks (default is every 5 seconds): @setvar! EnableAutoSmeltNaturalForge 1 @setvar! AutoForgeTimer 5000 # Set total ingot amount to trigger auto recall (default is 2000): @setvar! EnableIngotAutoRecall 1 @setvar! IngotRecallAmount 2000 # Prevent script opening ingot bag (Agent Organizer-11) if it is a trapped pouch: @setvar! EnableIngotBag 1 @setvar! OpenIngotBag 1 # Will notify via system message when tool is getting close to breaking (last 5 uses): @setvar! ToolCountdown 1 # Will recycle tool before it breaks (if tinker tools in inventory): @setvar! RecycleTool 1 # Set weight (in stones) for overhead weight warnings and limit - or disable weight warnings all together: @setvar! EnableWeightWarningMessage 1 @setvar! GreenWarningWeight 550 @setvar! YellowWarningWeight 570 @setvar! RedWeightLimit 590 # Set HP values for heal, cure and refresh potion activation: @setvar! EnableHealPotion 1 @setvar! HealPotHP 45 @setvar! EnableCurePotion 1 @setvar! CurePotHP 75 @setvar! EnableRefreshPotion 1 @setvar! RefreshPotSP 90 ## Disable ALL overhead inventory warnings: @setvar! AllInventoryMessage 1 ## Or disable overhead inventory warnings individually: @setvar! RopeInventoryMessage 1 @setvar! YellowInventoryMessage 1 @setvar! OrangeInventoryMessage 1 @setvar! RedInventoryMessage 1 @setvar! WhiteInventoryMessage 1 @setvar! BlueInventoryMessage 1 @setvar! BlackInventoryMessage 1 ////// ANYTIME YOU NEED TO RESET OR CHANGE PERMANENT VARIABLES (ie. ESCAPE RUNEBOOK & INGOT BAG): ////// # Run script once with this ALLVARIABLERESET set to 1 to clear ALL variables. # Then reset ALLVARIABLERESET to 0 and restart script to prompt for new targets! @setvar! ALLVARIABLERESET 0 clearsysmsg hotkey 'Cancel Current Target' if ALLVARIABLERESET = 1 unsetvar mining_runebook unsetvar ingotbag overhead "All permanent variables reset!" 0 wait 1000 overhead "Restart script to prompt for new targets..." 0 wait 1000 overhead "Make sure to set ALLVARIABLERESET back to 0" 84 wait 1500 overhead "[ STOPPING SCRIPT! ]" 37 stop endif if skill "Mining" > 49.9 ############################################# ######### Mining Script starts here ######### ############################################# // Set bag for ore storage location (same container should also be set as Agent Organizer-11 in Razor app). # Can be a trapped pouch for further protection from thieves, but script will open the bag when storing ingots unless you set variable "OpenIngotBag" to 0 above. # To reset or change, follow instructions at beginning of script! if not varexist ingotbag and EnableIngotBag = 1 wait 1000 overhead "Please select your ingot storage bag..." 0 wait 1000 setvar ingotbag wait 2500 replay endif // Set Escape runebook for Auto Recall using pre-charged recall scrolls. # To reset or change, follow instructions at beginning of script! if not varexist mining_runebook and EnableRedAlertRecall = 1 wait 1000 overhead "Please select your escape runebook..." 0 wait 1000 setvar mining_runebook wait 2500 replay endif // Auto open trapped pouch if paralyzed. if paralyzed and EnableParalyzePouch = 1 overhead "[ !!POP!! ]" 149 say "[pouch" wait 100 endif ############################## ##### AUTO RECALL SCRIPT ##### ############################## // RED ALERT trigger check. if not listexists "mining_alert" createlist "mining_alert" endif if insysmsg "Now tracking" or insysmsg "Distance to destination" and EnableRedAlertRecall = 1 pushlist "mining_alert" "red_alert_recall" wait 100 endif // Auto recall, heal and pouch pop script included. // Will trigger when closest hostile player is tracked outside of house/ship. if inlist "mining_alert" "red_alert_recall" and EnableRedAlertRecall = 1 overhead "[ RED ALERT!! ]" 37 wait 500 overhead "Looks like trouble coming!" 2086 if paralyzed overhead "[ !!POP!! ]" 149 say "[pouch" endif if skill 'Healing' > 50 and not bandaging and hits < maxhits hotkey "Bandage self" overhead '*applying bandages...*' 88 wait 200 endif if hits < 70 and not cooldown "Healing Potion" if findtype "Yellow Potion" backpack as healpot overhead '*drinking heal potion...*' 253 dclick healpot wait 200 cooldown "Healing Potion" 10500 else overhead '*Out of heal pots!*' 337 endif endif if poisoned and not cooldown "Cure Potion" if findtype "Orange Potion" backpack as curepot overhead '*drinking cure potion...*' 44 dclick curepot cooldown "Cure Potion" 10500 wait 200 else overhead "Out of cure pots!" 337 endif endif if stam < 100 and not cooldown "Refresh Potion" if findtype "Red Potion" backpack as refreshpot overhead '*drinking refresh potion...*' 34 dclick refreshpot cooldown "Refresh Potion" 10500 wait 200 else overhead 'Out of refresh pots!' 337 endif endif while not targetexists dclick mining_runebook waitforgump 1551740969 gumpresponse 2 wait 500 // Will try up to 5 mores times if spell is disrupted. for 5 wait 500 if insysmsg 'Your concentration is disturbed' overhead 'Shit! Trying that again...' 337 while not targetexists dclick mining_runebook waitforgump 1551740969 gumpresponse 2 wait 500 clearsysmsg endif endfor poplist "mining_alert" "red_alert_recall" wait 2500 if skill "Mace Fighting" > 50 and not findtype "quarter staff|war mace|maul|war axe|mace|hammer pick|club" hand and findtype "quarter staff|war mace|maul|war axe|mace|hammer pick|club" backpack as weapon dclick weapon wait 100 endif if skill "Swordsmanship" > 50 and not findtype "double axe|two handed axe|battle axe|halberd|katana|bardiche|cutlass|broadsword|scimitar|viking sword|longsword" hand and findtype "double axe|two handed axe|battle axe|halberd|katana|bardiche|cutlass|broadsword|scimitar|viking sword|longsword" backpack as weapon dclick weapon wait 100 endif if HomeRecall = 1 // This closes my house door behind me after it auto opens. // Modify to suit your own needs or remove. ############################################ wait 750 dclick 0x50F70A17 overhead "*door slams!*" 0 0x50F70A17 wait 1000 ############################################ endif if InnRecall = 1 // Set InnRecall variable above if recalling into an inn. // This will bring you right into your room. wait 2000 say "Innkeeper, I need a room!" waitforgump 2393832411 gumpresponse 4 wait 3000 endif if AltInnRecall = 1 // Set AltInnRecall variable above if recalling into an inn room not owned by the character. // This will bring you right into your room. wait 2000 say "Innkeeper, I need a room!" waitforgump 2393832411 gumpresponse 5 wait 2000 gumpresponse 100 wait 2000 endif overhead "Home Sweet Home!" 2086 wait 2000 useskill "Hiding" wait 100 if OpenIngotBag = 1 dclick ingotbag wait 250 endif for 10 if findtype "iron ore" backpack as ore if findtype "forge" ground -1 -1 2 as forge or findtype 0x0FB1 ground -1 -1 2 as forge overhead "*smelting ore...*" 2114 forge dclick ore overhead "*forging ingots...*" 2117 wait 1000 hotkey 'Organizer Agent-11' wait 250 endif endif endfor if findtype "cut up leather|iron ingot%s|board%s|feather%s|seed of renewal|shaft%s|blank scroll%s%|gold coin" backpack overhead "*storing ingots...*" 37 hotkey "Organizer Agent-06" wait 3000 if findtype "cut up leather|iron ingot%s|board%s|feather%s|seed of renewal|shaft%s|blank scroll%s%|gold coin" backpack hotkey "Organizer Agent-06" wait 3000 endif if findtype "cut up leather|iron ingot%s|board%s|feather%s|seed of renewal|shaft%s|blank scroll%s%|gold coin" backpack hotkey "Organizer Agent-06" wait 1000 endif endif hotkey "Organizer Agent-04" overhead "[ STOPPING SCRIPT! ]" 37 stop endif // Always auto apply bandages and drink potions if damaged or poisoned, etc. if skill 'Healing' > 50 if not bandaging and hits < maxhits overhead '*applying bandages...*' 88 hotkey "Bandage Self" endif if counttype 'clean bandage%s%' < 10 overhead "[ RESTOCK BANDAGES! ]" 88 endif endif if EnableCurePotion = 1 if poisoned and not cooldown "Cure Potion" and hits < CurePotHP if findtype "Orange Potion" backpack as curepot overhead '*drinking cure potion...*' 44 dclick curepot cooldown "Cure Potion" 10500 wait 200 else overhead "Out of cure pots!" 337 endif endif endif if EnableHealPotion = 1 if hits < HealPotHP and not cooldown "Healing Potion" if findtype "Yellow Potion" backpack as healpot overhead '*drinking heal potion...*' 253 dclick healpot cooldown "Healing Potion" 10500 wait 200 else overhead 'Out of heal pots!' 337 endif endif endif if EnableRefreshPotion = 1 if stam < RefreshPotSP and not cooldown "Refresh Potion" if findtype "Red Potion" backpack as refreshpot overhead '*drinking refresh potion...*' 34 dclick refreshpot cooldown "Refresh Potion" 10500 wait 200 else overhead 'Out of refresh pots!' 337 endif endif endif // Auto buff check and activation for Magic Reflect (if Magery > 50) // Not used on my mining build, but might help others. Enable in variable section above (off by default)! if skill 'Magery' > 50 and not findbuff 'Magic Reflection' and not cooldown "Magic Shield" and EnableMagicReflection = 1 overhead 'I should protect myself...' 2086 cast 'Magic Reflection' waitfortarget 1500 hotkey 'Target Self' wait 1000 if insysmsg "That spell will not adhere" cooldown "Magic Shield" 30000 endif wait 1500 replay endif // Auto carve any corpses if skinning knife found in inventory (modify under variable section). // No room for forensic evaluation on this template, but still worth skinning for a little leather and feathers... if findtype 'Elven SpellBlade' backpack and EnableAutoCarving = 1 if findtype "corpse" ground -1 -1 2 as body wait 500 dclicktype "Elven Spellblade" waitfortarget 2000 target 'self' wait 250 overhead "*skinning corpse...*" 337 wait 500 @ignore body endif endif if not findtype 'Elven SpellBlade' self and EnableAutoCarving = 1 overhead "[ NO SKINNING KNIFE! ]" 339 endif // Weapon, rope and potion inventory checks. Overhead message if anything is out of stock. // Adjust variables at beginning of script to enable or disable specific messages. if skill "Mace Fighting" > 50 and not findtype "quarter staff|war mace|maul|war axe|mace|hammer pick|club" backpack if not findtype "quarter staff|war mace|maul|war axe|mace|hammer pick|club" hand overhead "[ NO WEAPON! ]" 339 endif endif if skill "Swordsmanship" > 50 and not findtype "double axe|two handed axe|battle axe|halberd|katana|bardiche|cutlass|broadsword|scimitar|viking sword|longsword" backpack if not findtype "double axe|two handed axe|battle axe|halberd|katana|bardiche|cutlass|broadsword|scimitar|viking sword|longsword" hand overhead "[ NO WEAPON! ]" 339 endif endif if AllInventoryMessage = 1 if counttype "rope" backpack = 0 and RopeInventoryMessage = 1 overhead "[ RESTOCK ROPE! ]" 2799 endif if counttype "Yellow Potion" backpack = 0 and YellowInventoryMessage = 1 overhead "[ RESTOCK HEAL POTIONS! ]" 253 endif if counttype "Orange Potion" backpack = 0 and OrangeInventoryMessage = 1 overhead "[ RESTOCK CURE POTIONS! ]" 44 endif if counttype "Red Potion" backpack = 0 and RedInventoryMessage = 1 overhead "[ RESTOCK REFRESH POTIONS! ]" 37 endif if counttype "White Potion" backpack = 0 and WhiteInventoryMessage = 1 overhead "[ RESTOCK STRENGTH POTIONS! ]" 956 endif if counttype "Blue Potion" backpack = 0 and BlueInventoryMessage = 1 overhead "[ RESTOCK AGILITY POTIONS! ]" 93 endif if counttype "Black Potion" backpack = 0 and BlackInventoryMessage = 1 overhead "[ RESTOCK MAGIC RESIST POTIONS! ]" 0 endif endif // Auto recall initiated if more than 2000 ingots in inventory (by default). if counttype "iron ingot%s" > IngotRecallAmount and EnableIngotAutoRecall = 1 overhead "I'd hate to lose all this hard work..." 2086 wait 2500 overhead "I'm going to go unload before it's too late!" 2086 wait 1000 while not targetexists dclick mining_runebook waitforgump 1551740969 gumpresponse 2 wait 500 // Will try up to 5 mores times if spell is disrupted. for 5 wait 500 if insysmsg 'Your concentration is disturbed' overhead 'Shit! Trying again...' 2086 while not targetexists dclick mining_runebook waitforgump 1551740969 gumpresponse 2 wait 500 endif endfor wait 2500 if skill "Mace Fighting" > 50 and not findtype "quarter staff|war mace|maul|war axe|mace|hammer pick|club" hand and findtype "quarter staff|war mace|maul|war axe|mace|hammer pick|club" backpack as weapon dclick weapon wait 100 endif if skill "Swordsmanship" > 50 and not findtype "double axe|two handed axe|battle axe|halberd|katana|bardiche|cutlass|broadsword|scimitar|viking sword|longsword" hand and findtype "double axe|two handed axe|battle axe|halberd|katana|bardiche|cutlass|broadsword|scimitar|viking sword|longsword" backpack as weapon dclick weapon wait 100 endif if HomeRecall = 1 // This closes my house door behind me after it auto opens. // Modify to suit your own needs or remove. ############################################ wait 750 dclick 0x50F70A17 overhead "*door slams!*" 0 0x50F70A17 wait 1000 ############################################ endif if InnRecall = 1 // Set InnRecall variable above if recalling into an inn. // This will bring you right into your room. wait 2000 say "Innkeeper, I need a room!" waitforgump 2393832411 gumpresponse 4 wait 3000 endif if AltInnRecall = 1 // Set AltInnRecall variable above if recalling into an inn room not owned by the character. // This will bring you right into your room. wait 2000 say "Innkeeper, I need a room!" waitforgump 2393832411 gumpresponse 5 wait 2000 gumpresponse 100 wait 2000 endif overhead "Home Sweet Home!" 2086 wait 2000 useskill "Hiding" wait 100 if OpenIngotBag = 1 dclick ingotbag wait 250 endif for 10 if findtype "iron ore" backpack as ore if findtype "forge" ground -1 -1 2 as forge or findtype 0x0FB1 ground -1 -1 2 as forge overhead "*smelting ore...*" 2114 forge dclick ore overhead "*forging ingots...*" 2117 wait 1000 hotkey 'Organizer Agent-11' wait 250 endif endif endfor if findtype "cut up leather|iron ingot%s|board%s|feather%s|seed of renewal|shaft%s|blank scroll%s%|gold coin" backpack overhead "*storing ingots...*" 37 hotkey "Organizer Agent-06" wait 3000 if findtype "cut up leather|iron ingot%s|board%s|feather%s|seed of renewal|shaft%s|blank scroll%s%|gold coin" backpack hotkey "Organizer Agent-06" wait 3000 endif if findtype "cut up leather|iron ingot%s|board%s|feather%s|seed of renewal|shaft%s|blank scroll%s%|gold coin" backpack hotkey "Organizer Agent-06" wait 1000 endif endif hotkey "Organizer Agent-04" stop overhead "[ STOPPING SCRIPT! ]" 37 endif // Auto tracking skill buff check and activation. if skill 'Tracking' > 50 and not findbuff 'tracking' and EnableRedAlertRecall = 1 overhead 'I should keep an eye out for trouble...' 2086 wait 1500 while not gumpexists 4267467659 useskill 'tracking' wait 250 endwhile if gumpexists 4267467659 while not insysmsg "You will now hunt all hostile players." gumpresponse 8 4267467659 waitforgump 4267467659 5000 endwhile gumpresponse 6 4267467659 wait 500 clearsysmsg endif gumpclose 4267467659 overhead "[ AUTO RECALL ACTIVATED! ]" 37 wait 100 endif // Food satisfaction check. Will eat cheese/fish if any found in backpack while no food buff is active. ### I just use this as a one-hour timer to track my harvesting progress. ### if insysmsg "Your food satisfaction effect" and EnableCheeseTimer = 1 overhead "*stomach growls*" 0 wait 2500 clearsysmsg replay endif if not findbuff 'food satisfaction' and findtype "wedge%s% of cheese|fish steak%s%" self and EnableCheeseTimer = 1 wait 1500 overhead "Hold on, I shouldn't do this on an empty stomach..." 2086 wait 500 if findtype "wedge%s% of cheese|fish steak%s%" backpack as Food overhead "*eating food*" 0 dclick Food wait 1500 overhead "Ok, I'm ready to get to work!" 2086 wait 1500 endif endif // Auto equip pickaxe if broken or missing. // Will prompt and stop script if no pickaxes in inventory. if not findtype 'pickaxe' self overhead "I can't work with no pickaxes!" 2086 wait 2500 overhead '[ STOPPING SCRIPT... ]' 37 stop endif if not findtype 'pickaxe' hand and findtype 'pickaxe' backpack dclicktype 'pickaxe' backpack wait 1500 endif // Will notify via system message when tool is about to break (5 uses and less). if findtype 'pickaxe' hand as MyAxe and ToolCountdown = 1 getlabel MyAxe AxeLabel if '(5 uses' in AxeLabel or '(4 uses' in AxeLabel or '(3 uses' in AxeLabel or '(2 uses' in AxeLabel or '(1 use' in AxeLabel sysmsg "Your tool is about to break..." 153 wait 100 endif endif // Will recycle tool before it breaks (if tool kit in inventory). if findtype 'tool kit' self as ToolKit and RecycleTool = 1 if findtype 'pickaxe|hatchet' hand as MyAxe getlabel MyAxe AxeLabel if '(1 use' in AxeLabel overhead "[ RECYCLING TOOL! ]" 153 clearhands both wait 1000 if not gumpexists 949095101 dclick ToolKit waitforgump 949095101 2000 endif for 5 gumpresponse 3 949095101 wait 1000 if insysmsg "Target an individual item" wait 500 target MyAxe wait 1000 gumpclose 949095101 wait 1000 overhead "Every little bit counts!" 2086 hotkey 'Organizer Agent-01' wait 500 replay else gumpresponse 2 wait 500 endfor endif endif endif endif if not findtype 'tool kit' self and RecycleTool = 1 overhead "[ NO TOOL KIT! ]" 339 endif ########################### ##### WAR MODE TOGGLE ##### ########################### // Will equip weapon on warmode toggle and target nearest grey MOB. // If the closest target is a red player, auto recall will trigger. // If the closest target is a grey MOB, it will be attacked until no nearby targets remain. Script will then go back to mining. // Auto recall triggers also if no weapons available on warmode toggle with close red or grey targets. if warmode and EnableAutoAttackGreyMOB = 1 overhead "It's time to fight!" 2086 if skill "Mace Fighting" > 50 and not findtype "quarter staff|war mace|maul|war axe|mace|hammer pick|club" hand and findtype "quarter staff|war mace|maul|war axe|mace|hammer pick|club" backpack as weapon dclick weapon wait 100 endif if skill "Swordsmanship" > 50 and not findtype "double axe|two handed axe|battle axe|halberd|katana|bardiche|cutlass|broadsword|scimitar|viking sword|longsword" hand and findtype "double axe|two handed axe|battle axe|halberd|katana|bardiche|cutlass|broadsword|scimitar|viking sword|longsword" backpack as weapon dclick weapon wait 100 endif hotkey 'Target Random Murderer Player' wait 500 if insysmsg "No one matching that was found" for 1000 hotkey 'Target Closest Grey Monster' wait 500 if findtype 'Elven SpellBlade' backpack and EnableAutoCarving = 1 if findtype "corpse" ground -1 -1 2 as body wait 500 dclicktype "Elven Spellblade" waitfortarget 2000 target 'self' wait 250 overhead "*skinning corpse...*" 337 wait 500 @ignore body endif endif if skill "Mace Fighting" > 50 and not findtype "quarter staff|war mace|maul|war axe|mace|hammer pick|club" hand and findtype "quarter staff|war mace|maul|war axe|mace|hammer pick|club" backpack as weapon dclick weapon wait 100 endif if skill "Swordsmanship" > 50 and not findtype "double axe|two handed axe|battle axe|halberd|katana|bardiche|cutlass|broadsword|scimitar|viking sword|longsword" hand and findtype "double axe|two handed axe|battle axe|halberd|katana|bardiche|cutlass|broadsword|scimitar|viking sword|longsword" backpack as weapon dclick weapon wait 100 endif if insysmsg "No one matching that was found" hotkey 'Cancel Current Target' wait 500 overhead "Is there no one else??" 2086 wait 2000 overhead "Alright then, back to work..." 2086 if findtype 'Elven SpellBlade' backpack and EnableAutoCarving = 1 if findtype "corpse" ground -1 -1 2 as body wait 500 dclicktype "Elven Spellblade" waitfortarget 2000 target 'self' wait 250 overhead "*skinning corpse...*" 337 wait 500 @ignore body endif endif hotkey 'Toggle Peace Only' wait 100 hotkey 'Clear Target Queue' clearsysmsg wait 1500 replay endif hotkey 'Attack Last Target' overhead "▼ TARGET ▼ " 253 lasttarget wait 250 if skill 'Healing' > 50 if not bandaging and hits < maxhits overhead '*applying bandages...*' 88 hotkey "Bandage Self" endif if counttype 'clean bandage%s%' < 10 overhead "[ RESTOCK BANDAGES! ]" 88 endif endif if EnableCurePotion = 1 if poisoned and not cooldown "Cure Potion" and hits < CurePotHP if findtype "Orange Potion" backpack as curepot overhead '*drinking cure potion...*' 44 dclick curepot cooldown "Cure Potion" 10500 wait 200 else overhead "Out of cure pots!" 337 endif endif endif if EnableHealPotion = 1 if hits < HealPotHP and not cooldown "Healing Potion" if findtype "Yellow Potion" backpack as healpot overhead '*drinking heal potion...*' 253 dclick healpot cooldown "Healing Potion" 10500 wait 200 else overhead 'Out of heal pots!' 337 endif endif endif if EnableRefreshPotion = 1 if stam < RefreshPotSP and not cooldown "Refresh Potion" if findtype "Red Potion" backpack as refreshpot overhead '*drinking refresh potion...*' 34 dclick refreshpot cooldown "Refresh Potion" 10500 wait 200 else overhead 'Out of refresh pots!' 337 endif endif endif if paralyzed and EnableParalyzePouch = 1 overhead "[ !!POP!! ]" 149 say "[pouch" wait 100 endif wait 500 endfor overhead "[ RED ALERT!! ]" 37 hotkey 'Cancel Current Target' wait 100 while not targetexists dclick mining_runebook waitforgump 1551740969 gumpresponse 2 wait 500 for 5 if insysmsg 'Your concentration is disturbed' overhead 'Shit! Trying again...' 337 while not targetexists dclick mining_runebook waitforgump 1551740969 gumpresponse 2 wait 500 endif endfor wait 2500 if skill "Mace Fighting" > 50 and not findtype "quarter staff|war mace|maul|war axe|mace|hammer pick|club" hand and findtype "quarter staff|war mace|maul|war axe|mace|hammer pick|club" backpack as weapon dclick weapon wait 100 endif if skill "Swordsmanship" > 50 and not findtype "double axe|two handed axe|battle axe|halberd|katana|bardiche|cutlass|broadsword|scimitar|viking sword|longsword" hand and findtype "double axe|two handed axe|battle axe|halberd|katana|bardiche|cutlass|broadsword|scimitar|viking sword|longsword" backpack as weapon dclick weapon wait 100 endif if HomeRecall = 1 // This closes my house door behind me after it auto opens. // Modify to suit your own needs or remove. ############################################ wait 750 dclick 0x50F70A17 overhead "*door slams!*" 0 0x50F70A17 wait 1000 ############################################ endif if InnRecall = 1 // Set InnRecall variable above if recalling into an inn. // This will bring you right into your room. wait 2000 say "Innkeeper, I need a room!" waitforgump 2393832411 gumpresponse 4 wait 3000 endif if AltInnRecall = 1 // Set AltInnRecall variable above if recalling into an inn room not owned by the character. // This will bring you right into your room. wait 2000 say "Innkeeper, I need a room!" waitforgump 2393832411 gumpresponse 5 wait 2000 gumpresponse 100 wait 2000 endif overhead "Home Sweet Home!" 2086 wait 2000 useskill "Hiding" wait 100 if OpenIngotBag = 1 dclick ingotbag wait 250 endif for 10 if findtype "iron ore" backpack as ore if findtype "forge" ground -1 -1 2 as forge or findtype 0x0FB1 ground -1 -1 2 as forge overhead "*smelting ore...*" 2114 forge dclick ore overhead "*forging ingots...*" 2117 wait 1000 hotkey 'Organizer Agent-11' wait 250 endif endif endfor if findtype "cut up leather|iron ingot%s|board%s|feather%s|seed of renewal|shaft%s|blank scroll%s%|gold coin" backpack overhead "*storing ingots...*" 37 hotkey "Organizer Agent-06" wait 3000 if findtype "cut up leather|iron ingot%s|board%s|feather%s|seed of renewal|shaft%s|blank scroll%s%|gold coin" backpack hotkey "Organizer Agent-06" wait 3000 endif if findtype "cut up leather|iron ingot%s|board%s|feather%s|seed of renewal|shaft%s|blank scroll%s%|gold coin" backpack hotkey "Organizer Agent-06" wait 1000 endif endif hotkey "Organizer Agent-04" overhead "[ STOPPING SCRIPT! ]" 37 stop endif if skill "Mace Fighting" > 50 and not findtype "quarter staff|war mace|maul|war axe|mace|hammer pick|club" self or if skill "Swordsmanship" > 50 and not findtype "double axe|two handed axe|battle axe|halberd|katana|bardiche|cutlass|broadsword|scimitar|viking sword|longsword" self overhead "I can't fight without a weapon!" 2086 wait 1500 overhead "I'd better RUN!!" 37 hotkey 'Toggle Peace Only' hotkey 'Cancel Current Target' wait 100 while not targetexists dclick mining_runebook waitforgump 1551740969 gumpresponse 2 wait 500 for 5 if insysmsg 'Your concentration is disturbed' overhead 'Shit! Trying that again...' 2086 while not targetexists dclick mining_runebook waitforgump 1551740969 gumpresponse 2 wait 500 clearsysmsg endif endfor wait 2500 if HomeRecall = 1 // This closes my house door behind me after it auto opens. // Modify to suit your own needs or remove. ############################################ wait 750 dclick 0x50F70A17 overhead "*door slams!*" 0 0x50F70A17 wait 1000 ############################################ endif if InnRecall = 1 // Set InnRecall variable above if recalling into an inn. // This will bring you right into your room. wait 2000 say "Innkeeper, I need a room!" waitforgump 2393832411 gumpresponse 4 wait 3000 endif if AltInnRecall = 1 // Set AltInnRecall variable above if recalling into an inn room not owned by the character. // This will bring you right into your room. wait 2000 say "Innkeeper, I need a room!" waitforgump 2393832411 gumpresponse 5 wait 2000 gumpresponse 100 wait 2000 endif overhead "Home Sweet Home!" 2086 wait 2000 useskill "Hiding" wait 100 if OpenIngotBag = 1 dclick ingotbag wait 250 endif for 10 if findtype "iron ore" backpack as ore if findtype "forge" ground -1 -1 2 as forge or findtype 0x0FB1 ground -1 -1 2 as forge overhead "*smelting ore...*" 2114 forge dclick ore overhead "*forging ingots...*" 2117 wait 1000 hotkey 'Organizer Agent-11' wait 250 endif endif endfor if findtype "cut up leather|iron ingot%s|board%s|feather%s|seed of renewal|shaft%s|blank scroll%s%|gold coin" backpack overhead "*storing ingots...*" 37 hotkey "Organizer Agent-06" wait 3000 if findtype "cut up leather|iron ingot%s|board%s|feather%s|seed of renewal|shaft%s|blank scroll%s%|gold coin" backpack hotkey "Organizer Agent-06" wait 3000 endif if findtype "cut up leather|iron ingot%s|board%s|feather%s|seed of renewal|shaft%s|blank scroll%s%|gold coin" backpack hotkey "Organizer Agent-06" wait 1000 endif endif hotkey "Organizer Agent-04" overhead "[ STOPPING SCRIPT! ]" 37 stop endif endif ##################################################### ########## START AUTO MINER/SMELTER SCRIPT ########## ##################################################### // Auto forge ore to ingots at any forge. Just stand nearby! // Checks for natural forge every 10 seconds when carrying ore (time be modified in variable section). // Player-built forges will auto-detect whenever close and carrying ore. if EnableAutoSmeltNaturalForge = 1 and findtype "iron ore" backpack as ore @setvar! ForgeFound 0 if not timerexists AutoSmeltNaturalForgeTimer settimer AutoSmeltNaturalForgeTimer AutoForgeTimer endif if timer AutoSmeltNaturalForgeTimer >= AutoForgeTimer dclick ore wait 750 if insysmsg "You do not see any nearby forges" settimer AutoSmeltNaturalForgeTimer 0 else @setvar! ForgeFound 1 endif endif for 10 if findtype "forge" ground -1 -1 2 as forge or findtype 0x0FB1 ground -1 -1 2 as forge or ForgeFound = 1 and findtype "iron ore" backpack as ore overhead "*smelting ore...*" 2114 forge dclick ore overhead "*forging ingots...*" 2117 wait 1000 hotkey 'Organizer Agent-11' wait 500 endif endfor endif // Notification via overhead message when pack is getting too heavy. // Script stops mining if weight exceeds 588. Adjust these numbers to suit your own stats. if EnableWeightWarningMessage = 1 if weight > GreenWarningWeight and weight < YellowWarningWeight overhead "[ WEIGHT WARNING! ]" 1267 endif if weight > YellowWarningWeight and weight < RedWeightLimit overhead "[ TIME TO FORGE! ]" 149 endif if weight > RedWeightLimit overhead "[ WEIGHT LIMIT REACHED!!! ]" 37 wait 2000 overhead "Find a forge in order to continue..." 0 wait 2500 replay endif endif hotkey 'Use item in hand' waitfortarget 500 hotkey 'Target Self' // Increase this wait time if lag is causing error message // ############ wait 600 ############ if insysmsg "Achievement: Miner" overhead '*mining ore...*' 2128 endif wait 100 if insysmsg "Now tracking" or insysmsg "Distance to destination" pushlist "mining_alert" "red_alert_recall" replay elseif insysmsg 'world is saving' overhead '[ WORLD SAVING... ]' 253 wait 1000 for 5 if insysmsg 'world save complete' overhead '[ SAVE COMPLETE! ]' 253 wait 1000 endif endfor clearsysmsg replay elseif insysmsg 'Harvesting is not allowed' overhead 'You need to leave town...' 84 clearsysmsg wait 5000 replay elseif insysmsg 'You have worn out your tool' overhead "My pickaxe broke!" 2086 clearsysmsg wait 500 replay elseif insysmsg 'You do not see any' or insysmsg 'You cannot produce any' overhead "[ KEEP MOVING... ]" 69 if insysmsg "Now tracking" or insysmsg "Distance to destination" and EnableRedAlertRecall = 1 pushlist "mining_alert" "red_alert_recall" replay endif if paralyzed and EnableParalyzePouch = 1 overhead "[ !!POP!! ]" 149 say "[pouch" wait 100 endif // This just shuts my door behind me whenever I open it with the script running: if insysmsg "As the owner" wait 500 overhead "*door slams!*" 0 0x50F70A17 dclick 0x50F70A17 wait 1000 endif if findtype 'iron ore|iron ingots' backpack hotkey 'Organizer Agent-03' wait 100 hotkey 'Organizer Agent-11' endif hotkey 'Organizer Agent-04' wait 400 replay elseif insysmsg "travel" overhead "I'm tired from travelling." 2086 wait 3000 overhead "Just give me a minute to recover..." 2086 wait 12000 clearsysmsg replay elseif insysmsg "You loosen some rocks" overhead '*fail*' 337 wait 300 clearsysmsg replay else if insysmsg "Mining skillgain" and skill 'Mining' >= 100 sysmsg "There is something special about these stones..." 84 endif if insysmsg "Now tracking" or insysmsg "Distance to destination" pushlist "mining_alert" "red_alert_recall" clearsysmsg replay elseif insysmsg 'world is saving' overhead '[ WORLD SAVING... ]' 253 wait 1000 for 5 if insysmsg 'world save complete' overhead '[ SAVE COMPLETE! ]' 253 wait 1000 endif endfor clearsysmsg replay elseif insysmsg 'Harvesting is not allowed' overhead 'You need to leave town...' 84 wait 5000 clearsysmsg replay elseif insysmsg 'You have worn out your tool' overhead "My pickaxe broke!" 2086 clearsysmsg replay elseif insysmsg 'You do not see any' or insysmsg 'You cannot produce any' overhead "[ KEEP MOVING... ]" 69 if insysmsg "Now tracking" or insysmsg "Distance to destination" and EnableRedAlertRecall = 1 pushlist "mining_alert" "red_alert_recall" replay endif if paralyzed and EnableParalyzePouch = 1 overhead "[ !!POP!! ]" 149 say "[pouch" wait 100 endif // This just shuts my door behind me whenever I open it with the script running: if insysmsg "As the owner" wait 500 overhead "*door slams!*" 0 0x50F70A17 dclick 0x50F70A17 wait 1000 endif if findtype 'iron ore|iron ingots' backpack hotkey 'Organizer Agent-03' wait 100 hotkey 'Organizer Agent-11' endif hotkey 'Organizer Agent-04' wait 400 replay elseif insysmsg "travel" overhead "I'm tired from travelling." 2086 wait 3000 overhead "Just give me a minute to recover..." 2086 wait 12000 clearsysmsg replay elseif insysmsg "You loosen some rocks" overhead '*fail*' 337 replay elseif insysmsg "You dig some iron ore and put it in your backpack." overhead '*you harvest iron ore*' 1900 replay elseif insysmsg "You dig some dull copper ore and put it in your backpack." overhead '*you harvest dull copper ore*' 2419 replay elseif insysmsg "You dig some shadow iron ore and put it in your backpack." overhead '*you harvest shadow iron ore*' 2406 replay elseif insysmsg "You dig some copper ore and put it in your backpack." overhead '*you harvest copper ore*' 2413 replay elseif insysmsg "You dig some bronze ore and put it in your backpack." overhead '*you harvest bronze ore*' 2418 replay elseif insysmsg "You dig some golden ore and put it in your backpack." overhead '*you harvest gold ore!*' 2213 replay elseif insysmsg "You dig some agapite ore and put it in your backpack." overhead '*you harvest agapite ore!*' 2425 replay elseif insysmsg "You dig some verite ore and put it in your backpack." overhead '*you harvest verite ore!!*' 2207 replay elseif insysmsg "You dig some valorite ore and put it in your backpack." overhead '*you harvest valorite ore!!*' 2219 replay elseif insysmsg "You dig some avarite ore and put it in your backpack." overhead '*you harvest avarite ore!!!*' 1763 replay elseif insysmsg "You must wait" overhead 'You must wait...' 337 clearsysmsg replay endif sysmsg "If this error message appears frequently: INCREASE WAIT TIME VALUE ON LINE 1223 OF SCRIPT!" 149 wait 100 replay endif endif ##################################################### ########## END AUTO MINER/SMELTER SCRIPT ########## ##################################################### wait 1000 overhead "Train skill to 50.0 at NPC and then restart script!" 0 wait 3000 overhead '[ STOPPING SCRIPT... ]' 37 stop // Always a work in progress. /// Contact me with any questions, suggestions or tips! # ENJOY and HAPPY HARVESTING!! # //////// REACH OUT AND LET ME KNOW IF THERE'S ANY ISSUES: DAN@DANSTOCKMAN.COM //////// ##############################################################################################################################################################