# Lamp The `Lamp` interface is the interface that opens when you click an XP Lamp: ```{figure} ../../images/lamp.png ``` In these you can select a skill to gain a small amount of experience. - - - ## TRSLamp Main record to interact with the {ref}`Lamp` interface. - - - ## Lamp.SetupInterface ```pascal procedure TRSLamp.SetupInterface(); ``` Initializes Lamp variables. ```{note} This is automatically called on the **Lamp** variable. ``` - - - ## Lamp.IsOpen ```pascal function TRSLamp.IsOpen(): Boolean; ``` Returns true if the {ref}`Lamp` interface is open. Example: ```pascal WriteLn Lamp.IsOpen(); ``` - - - ## Lamp.WaitOpen ```pascal function TRSLamp.WaitOpen(time: Integer; interval: Integer = -1): Boolean; ``` Returns true if the {ref}`Lamp` is open within `time` milliseconds. ## Example: ```pascal WriteLn Lamp.WaitOpen(); ``` - - - ## Lamp.Open ```pascal function TRSLamp.Open(item: TRSItem = 'Lamp'): Boolean; ``` Attempts to open the {ref}`Lamp` interface. By default it attempts to open the interface on the "Lamp" item, if you want a different one, e.g. "Antique lamp", you need to specify that. ## Example: ```pascal WriteLn Lamp.Open(); ``` - - - ## Lamp.Close ```pascal function TRSLamp.Close(escape: Boolean): Boolean; function TRSLamp.Close(escapeProbability: Single = 0): Boolean; overload; ``` Closes the Lamp interface. Depending on `escape` or `escapeProbability the function will either click the button or press escape key. Example: ```pascal WriteLn Lamp.Close(); ``` - - - ## Lamp.GetSelected ```pascal function TRSLamp.GetSelected(): ERSSkill; ``` Returns the selected skill if there's any. `ERSSkill.TOTAL` is returned if no skill is selected. Example: ```pascal {$I WaspLib/osrs.simba} var selected: ERSSkill; begin selected := Lamp.GetSelected(); WriteLn selected; ShowOnTarget(Lamp.Slots[selected]); end. ``` ```{figure} ../../images/lamp_selected.png ``` - - - ## Lamp.Enable ```pascal function TRSLamp.Enable(skill: ERSSkill): Boolean; ``` Enabled a skill in the lamp interface. Example: ```pascal {$I WaspLib/osrs.simba} begin Lamp.Enable(ERSSkill.HERBLORE); end. ``` ```{figure} ../../images/lamp_enable.gif ``` - - - ## Lamp.Confirm ```pascal function TRSLamp.Confirm(): Boolean; ``` Clicks the confirm button in the lamp interface. Example: ```pascal {$I WaspLib/osrs.simba} begin Lamp.Select(ERSSkill.HERBLORE); end. ``` ```{figure} ../../images/lamp_select.gif ``` - - - ## Lamp.Select ```pascal function TRSLamp.Select(skill: ERSSkill): Boolean; ``` Selects a skill in the lamp interface and clicks confirm. Example: ```pascal {$I WaspLib/osrs.simba} begin Lamp.Select(ERSSkill.HERBLORE); end. ``` ```{figure} ../../images/lamp_select.gif ``` - - - ## Lamp variable Global {ref}`TRSLamp` variable.