Sazeracs Dungeon Loot Drop (1-Tile) [TESTING - NOT SHIPPED] by mrdies
# Sazeracs Dungeon Loot Drop (v1.0)
# Script by: Sazerac (Discord: mrdies)
# Special Thanks: Chinga (Discord: phisn)
#
# This script stores dungeon loot from your ActiveLootBag while using nearby storage systems when available.
# It first sends loot into supported world storage objects such as a Vault, Recycler, Storage Shelf,
# Tomes, Resource Stockpile, and Magic Item Vault. It then moves remaining special items from your
# backpack into assigned containers for Seeds, Valuables, and Black Market Goods.
#
# Change the ForceDropOffSetup variable to 1 if you want to reselect your ActiveLootBag. [Default: 0]
# Change the ForceStorageSetup variable to 1 if you want to reselect your Seed, Valuable,
# and Black Goods storage containers. [Default: 0]
@setvar ForceDropOffSetup 0
@setvar ForceStorageSetup 0
# If you have problems with first-time setup, delete and retarget your saved variables.
# Primary saved variables used by this script include:
# ActiveLootBag, SeedStorage, ValuableStorage, and BlackGoodsStorage.
# Tome and storage object aliases (such as YourOreTome or YourStockpile) are found during runtime.
#
# You should only need to run setup once, unless you die (resupply), move, or replace one of your assigned containers.
# For this script to work reliably, all referenced storage objects must be within 2 tiles of the player.
# For the script to recognize Tomes, they must be locked down on the ground, not inside containers.
#
# Notes:
# - This script works best with ALL Prev TOMES & CONTAINERS (But many items will still store if your in-item-storage settings are properly tuned.)
# - The script checks for the ActiveLootBag and prompts you to reselect it if it cannot be found.
# - Storage Shelf interactions are repeated multiple times to unload from the selected loot bag.
# - Valuables, Seeds, and Black Market Goods are moved from your backpack into their assigned containers.
# - This script prioritizes Tomes and other supported storage targets when they are present nearby.
#
# Instructions:
# - In an Inn Room or House, ensure all Chests & Prev Storage Containers / Tomes are locked down or secure within two tiles of the player.
# - After a Dungeon Run, run this script and follow the prompts during runtime.
# - It will ask you to set storage containers only for items not captured and stored by Prev Storage Containers / Tomes.
# - Should there still be items left behind, feel free to let me know :)
if not varexist 'ActiveLootBag' or ForceDropOffSetup = 1
overhead 'Please select the bag where you will be storing your loot.'
@setvar ActiveLootBag
endif
if not find 'ActiveLootBag'
overhead 'Previous loot bag undetected. Please select a new one.'
@setvar ActiveLootBag
endif
if not varexist 'SeedStorage' or ForceStorageSetup = 1;
overhead 'Please select the container where you will store Seeds.'
@setvar SeedStorage
endif
if not find 'SeedStorage' ground
overhead 'Previous Seed Storage undetected. Please select a new one.'
@setvar SeedStorage
endif
if not varexist 'ValuableStorage' or ForceStorageSetup = 1;
overhead 'Please select the container where you will store Valuables.'
@setvar ValuableStorage
endif
if not find 'ValuableStorage' ground
overhead 'Previous Valuable Storage undetected. Please select a new one.'
@setvar ValuableStorage
endif
if not varexist 'BlackGoodsStorage' or ForceStorageSetup = 1;
overhead 'Please select the container where you will store Black Goods.'
@setvar BlackGoodsStorage
endif
if not find 'BlackGoodsStorage' ground
overhead 'Previous Black Goods Storage undetected. Please select a new one.'
@setvar BlackGoodsStorage
endif
if varexist ActiveLootBag
overhead 'Lootbag Found.'
wait 150
if findtype 'bank deposit safe' ground as 'YourVault'
overhead 'Vault Found.' 50
menu 'YourVault' 0
endif
wait 150
if findtype 'magic item recycler' ground as 'YourRecycler'
overhead 'Recycler Found.' 50
menu 'YourRecycler' 1
endif
wait 150
if findtype 'storage shelf' ground as 'YourShelf'
overhead 'Storage Shelf Found.' 50
menu 'YourShelf' 0
wft
target 'ActiveLootBag'
waitforgump 3232825965
gumpclose
wait 150
menu 'YourShelf' 0
wft
target 'ActiveLootBag'
waitforgump 3232825965
gumpclose
wait 150
menu 'YourShelf' 0
wft
target 'ActiveLootBag'
waitforgump 3232825965
gumpclose
wait 150
menu 'YourShelf' 0
wft
target 'ActiveLootBag'
waitforgump 3232825965
gumpclose
endif
wait 150
if findtype 29104 ground 2618 -1 2 as 'YourAspectTome'
overhead 'Tomes Found.' 50
menu 'YourAspectTome' 0
endif
if findtype 29104 ground 1495 -1 2 as 'YourClothTome'
overhead 'Cloth Tome Found.' 50
menu 'YourClothTome' 0
endif
if findtype 29104 ground 1494 -1 2 as 'YourDyeTome'
overhead 'Dye Tome Found.' 50
menu 'YourDyeTome' 0
endif
if findtype 29104 ground 2799 -1 2 as 'YourLumberTome'
overhead 'Lumber Tome Found.' 50
menu 'YourLumberTome' 0
endif
if findtype 29104 ground 2796 -1 2 as 'YourOreTome'
overhead 'Ore Tome Found.' 50
menu 'YourOreTome' 0
endif
if findtype 29104 ground 2651 -1 2 as 'YourSkinningTome'
overhead 'Skinning Tome Found.' 50
menu 'YourSkinningTome' 0
endif
if findtype 29104 ground 2722 -1 2 as 'YourFishingTome'
overhead 'Fishing Tome Found.' 50
menu 'YourFishingTome' 0
endif
if findtype 29104 ground 2990 -1 2 as 'YourTreasureTome'
overhead 'Treasure Tome Found.' 50
menu 'YourTreasureTome' 0
endif
if findtype 29104 ground 2991 -1 2 as 'YourLinkTome'
overhead 'Mastery Chain Link Tome Found.' 50
menu 'YourLinkTome' 0
endif
if findtype 29104 ground 2877 -1 2 as 'YourShipTome'
overhead 'Ship Upgrade Tome Found.' 50
menu 'YourShipTome' 0
endif
if findtype 29104 ground 2141 -1 2 as 'YourCardTome'
overhead 'Collectible Card Tome Found.' 50
menu 'YourCardTome' 0
endif
if findtype 29104 ground 2227 -1 2 as 'YourSpellTome'
overhead 'Spell Scroll Tome Found.' 50
menu 'YourSpellTome' 0
endif
if findtype 29104 ground 2963 -1 2 as 'YourSkillTome'
overhead 'Skill Scroll Tome Found.' 50
menu 'YourSkillTome' 0
endif
if findtype 29104 ground 2085 -1 2 as 'YourArcaneRuneTome'
overhead 'Arcane Rune Tome Found.' 50
menu 'YourArcaneRuneTome' 0
endif
wait 150
if findtype 'resource container' ground as 'YourStockpile'
overhead 'Resource Stockpile Found.' 50
menu 'YourStockpile' 0
wft
target 'ActiveLootBag'
endif
wait 150
if findtype 'sm magic item vault' ground as 'YourMagicItemVault'
overhead 'Magic Item Vault Found.' 50
menu 'YourMagicItemVault' 0
wft
target 'ActiveLootBag'
endif
while findtype 'gem|carpet|void orb|chroma core|chroma distil|research materials|colonial marks|bag of gems|card|soul jar|candy corn|red envelope|hunting permit|spell hue deed|redline bottle|3712|3648|3650|3708|3648|2475|3649|29833|29832|8454|8455|27612|2463|2508|7710|5192|19199|29086|29077|17083|15178|19822|58326' backpack as YourValuables
overhead 'Storing Other Valuables.'
@drop backpack
lift YourValuables 60000
wait 250
drop ValuableStorage -1 -1 0
wait 500
endwhile
while findtype 'black market goods' backpack as YourBlackGoods
overhead 'Storing Black Market Goods.'
@drop backpack
lift YourBlackGoods 60000
wait 250
drop BlackGoodsStorage -1 -1 0
wait 500
endwhile
while findtype 'seed of renewal' backpack as YourSeeds
overhead 'Storing Seeds.'
@drop backpack
lift YourSeeds 60000
wait 250
drop SeedStorage -1 -1 0
wait 500
endwhile
overhead 'All loot has been stored.'
endif








