""" ================================================================== SCRIPT: Tome Domination AUTHOR: Evilrage WEBSITE: unchainedscripts.com ================================================================== DESCRIPTION: Sweeps your Vault Bag, Loot Bag, and Backpack, depositing all relevant items into your specific house tomes. ================================================================== """ import Misc import Target import Gumps import Items import Player import time # ========================================================== # USER CONFIGURATION: YOUR PERSONAL TOME SERIAL IDs # You must use the >Info tool in Razor Enhanced to find the # Serial ID of the tomes locked down in your house. # Format: (Serial_ID, Gump_Button_To_Add_Items) # ========================================================== TOME_CONFIG = [ (0x427A1999, 10), # Example: Aspect Tome (0x44578FB7, 10), # Example: Skill Scroll Tome (0x427EF907, 100), # Example: Treasure Map Tome (0x427D8F50, 3000), (0x400C309B, 1), (0x410D5A6A, 1), (0x427A27F7, 10), (0x45720606, 10) ] 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, ">>> SWEEPING ALL BAGS INTO TOMES <<<") # Prompt for the bags to sweep bags_to_sweep = [] Misc.SendMessage("Target your Vault Bag (Press ESC to skip)...", 89) vault = Target.PromptTarget("Vault Bag") if vault > 0: bags_to_sweep.append(vault) Misc.SendMessage("Target your Loot Bag (Press ESC to skip)...", 63) loot = Target.PromptTarget("Loot Bag") if loot > 0: bags_to_sweep.append(loot) # Always sweep the main backpack bags_to_sweep.append(Player.Backpack.Serial) for serial, btn in TOME_CONFIG: for bag in bags_to_sweep: Target.Cancel() Misc.Pause(50) # Open the tome Items.UseItem(serial) if WaitForAnyGump(2000): curr = Gumps.CurrentGump() # Click the "Add" button for that specific tome Gumps.SendAction(curr, btn) # Target the bag to sweep if Target.WaitForTarget(2000, False): Target.TargetExecute(bag) Misc.Pause(800) if Target.HasTarget(): Target.Cancel() Misc.Pause(100) # Clean up the UI while Gumps.CurrentGump() != 0: Gumps.CloseGump(Gumps.CurrentGump()) Misc.Pause(50) Player.HeadMessage(66, "Tome Restock Complete.") if __name__ == "__main__": main()