# SilverScreen Methods to interact with the silver‑smelting **Silver Screen** interface. ```{figure} ../../images/silverscreen_interface.png ``` ```{note} Credits to Flight and Skunkworks ``` - - - ## ERSSilverItem enum ```pascal ERSSilverItem = enum(OPAL_RING..TOPAZ_BRACELET); ``` Enum representing the silver jewelry that can be crafted. - - - ## TRSSilverScreen type Main record to interact with the {ref}`SilverScreen` interface. - - - ## SilverScreen.SetupInterface ```pascal procedure TRSSilverScreen.SetupInterface(); ``` Internal method used to setup the {ref}`TRSSilverScreen` coordinates. This is automatically called for you on the {ref}`SilverScreen variable`. - - - ## SilverScreen.IsOpen ```pascal function TRSSilverScreen.IsOpen(): Boolean; ``` Returns true if the SilverScreen interface is open. Example: ```pascal WriteLn SilverScreen.IsOpen(); ``` - - - ## SilverScreen.WaitOpen ```pascal function TRSSilverScreen.WaitOpen(time, interval: Int32): Boolean; ``` Returns true if the SilverScreen interface opens within `time` milliseconds. Example: ```pascal WriteLn SilverScreen.WaitOpen(5000); ``` - - - ## SilverScreen.Close ```pascal function TRSSilverScreen.Close(PressEscape: Boolean): Boolean; ``` 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 TRSSilverScreen.SetQuantity(Amount: Int32): Boolean; ``` Sets the quantity to craft. Pass -1 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(-1); // All ``` - - - ## SilverScreen.CanCraftItem ```pascal function TRSSilverScreen.CanCraftItem(Item: TRSItem; out Box: TBox): Boolean; ``` Checks if the specified item can be crafted. Returns true if the item is found and craftable, and outputs the click box for the item. Example: ```pascal var box: TBox; if SilverScreen.CanCraftItem('Opal ring', box) then WriteLn 'Can craft opal ring'; ``` - - - ## SilverScreen.IsItemHighlighted ```pascal function TRSSilverScreen.IsItemHighlighted(Item: TRSItem): Boolean; ``` Returns true if the specified item is currently highlighted/selected in the interface. You probably won't need to work with this directly Example: ```pascal if SilverScreen.IsItemHighlighted('Opal ring') then Keyboard.KeyPress(EKeyCode.SPACE); ``` - - - ## SilverScreen.CraftItem ```pascal function TRSSilverScreen.CraftItem(Item: TRSItem; Quantity: Int32; UseSpaceBar: Boolean): Boolean; ``` Crafts the specified item with the given quantity. If `UseSpaceBar` 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}`TRSSilverScreen` variable.