""" ================================================================== SCRIPT: Auto-Shelf Restock AUTHOR: Evilrage WEBSITE: unchainedscripts.com ================================================================== DESCRIPTION: Automatically interacts with your Storage Shelf and Enchantment Shelf to deposit items and pull your saved loadout. ================================================================== """ import Misc import Target import Gumps import Items import Player import time # ========================================================== # USER CONFIGURATION: Update these IDs if your shelves differ # ========================================================== STORAGE_SHELF_ID = 44993 ENCHANT_SHELF_ID = 48347 def WaitForAnyGump(timeout_ms): end = time.time() + (timeout_ms / 1000.0) while time.time() < end: if Gumps.CurrentGump() != 0: return True Misc.Pause(100) return False def main(): Player.HeadMessage(55, ">>> INITIATING SHELF RESTOCK <<<") # --- 1. STORAGE SHELF RESTOCK --- shelf = Items.FindByID(STORAGE_SHELF_ID, -1, -1, True) if shelf: Player.HeadMessage(63, "Using Storage Shelf...") Items.UseItem(shelf) if WaitForAnyGump(3000): curr = Gumps.CurrentGump() # Button 1790: Heal/Cure/Restock Gumps.SendAction(curr, 1790) Misc.Pause(1000) if Target.WaitForTarget(1000, False): Target.Self() Misc.Pause(1000) if WaitForAnyGump(2000): curr = Gumps.CurrentGump() # Button 4477: Close Gumps.SendAction(curr, 4477) Misc.Pause(1000) Gumps.CloseGump(curr) else: Player.HeadMessage(33, "No Storage Shelf Found Nearby.") # --- 2. ENCHANTMENT SHELF DEPOSIT --- enchant = Items.FindByID(ENCHANT_SHELF_ID, -1, -1, True) if enchant: Player.HeadMessage(63, "Using Enchant Storage...") Items.UseItem(enchant) if WaitForAnyGump(3000): curr = Gumps.CurrentGump() # Button 73: Add All Gumps.SendAction(curr, 73) Misc.Pause(1000) Gumps.CloseGump(curr) Player.HeadMessage(66, "Restock Complete.") if __name__ == "__main__": main()