# SilverScreen Methods to interact with the silver‑smelting **Silver Screen** interface. ```{figure} ../../images/silverscreen_interface.png ``` ```{note} Credits to Flight and Skunkworks ``` - - - ## ESilverItem enum ```pascal ESilverItem = enum(OPAL_RING, OPAL_NECKLACE.., TIARA, DEMONIC_SIGIL); ``` Enum representing the silver jewelry that can be crafted. - - - ## TSilverScreen type Main record to interact with the {ref}`SilverScreen` interface. - - - ## SilverScreen.SetupInterface ```pascal procedure TSilverScreen.SetupInterface(); ``` Internal method used to setup the {ref}`TSilverScreen` coordinates. This is automatically called for you on the {ref}`SilverScreen variable`. - - - ## SilverScreen.IsOpen ```pascal function TSilverScreen.IsOpen(): Boolean; ``` Returns true if the SilverScreen interface is open. Example: ```pascal WriteLn SilverScreen.IsOpen(); ``` - - - ## SilverScreen.WaitOpen ```pascal function TSilverScreen.WaitOpen(time, interval: Integer): Boolean; ``` Returns true if the SilverScreen interface opens within `time` milliseconds. Example: ```pascal WriteLn SilverScreen.WaitOpen(5000); ``` - - - ## SilverScreen.Close ```pascal function TSilverScreen.Close(PressEscape: Boolean): Boolean; function TSilverScreen.Close( escapeProbability: Single = -1 ): Boolean; overload; ``` Attempts to close the {ref}`SilverScreen` interface. If `pressEscape` is true, the escape key is pressed to close, otherwise the close button is clicked. Example: ```pascal WriteLn SilverScreen.Close(True); ``` - - - ## SilverScreen.SetQuantity ```pascal function TSilverScreen.SetQuantity(amount: Integer): Boolean; ``` Sets the quantity to craft. Pass 0 or any negative value for "All". If a preset button (1, 5, 10, All) matches the amount, it will be clicked. Otherwise, the "X" button is used to enter a custom amount. Example: ```pascal SilverScreen.SetQuantity(10); SilverScreen.SetQuantity(0); // All SilverScreen.SetQuantity(-1); // All SilverScreen.SetQuantity(QUANTITY_ALL); // All ``` - - - ## SilverScreen.CanCraft ```pascal function TSilverScreen.CanCraft(silver: ESilverItem): Boolean; ``` Checks if the specified `silver` can be crafted. Example: ```pascal WriteLn SilverScreen.CanCraft(ESilverItem.OPAL_RING); ``` - - - ## SilverScreen.IsHighlighted ```pascal function TSilverScreen.IsHighlighted(silver: ESilverItem): Boolean; ``` Returns true if the specified `silver` is currently highlighted/selected in the interface. You probably won't need to work with this directly. Example: ```pascal if SilverScreen.IsHighlighted(ESilverItem.OPAL_RING) then Keyboard.KeyPress(EKeyCode.SPACE); ``` - - - ## SilverScreen.CraftItem ```pascal function TSilverScreen.CraftItem( silver: ESilverItem; amount: Integer; useSpace: Boolean ): Boolean; function TSilverScreen.CraftItem( item: Tilver; amount: Integer = QUANTITY_ALL; spaceProbability: Single = -1 ): Boolean; overload; ``` Crafts the specified item with the given `amount`. If `useSpace` is true and the item is already highlighted, spacebar will be pressed instead of clicking. Example: ```pascal SilverScreen.CraftItem('Opal ring', 10, True); ``` - - - ## SilverScreen variable Global {ref}`TSilverScreen` variable.