# 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. - - - ## TLamp Main record to interact with the {ref}`Lamp` interface. - - - ## Lamp.SetupInterface ```pascal procedure TLamp.SetupInterface(); ``` Initializes Lamp variables. ```{note} This is automatically called on the **Lamp** variable. ``` - - - ## Lamp.IsOpen ```pascal function TLamp.IsOpen(): Boolean; ``` Returns true if the {ref}`Lamp` interface is open. Example: ```pascal WriteLn Lamp.IsOpen(); ``` - - - ## Lamp.WaitOpen ```pascal function TLamp.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 TLamp.Open(item: TItem = '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 TLamp.Close(escape: Boolean): Boolean; function TLamp.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 TLamp.GetSelected(): ESkill; ``` Returns the selected skill if there's any. `ESkill.TOTAL` is returned if no skill is selected. Example: ```pascal {$I WaspLib/main.simba} var selected: ESkill; begin selected := Lamp.GetSelected(); WriteLn selected; ShowOnTarget(Lamp.Slots[selected]); end. ``` ```{figure} ../../images/lamp_selected.png ``` - - - ## Lamp.Enable ```pascal function TLamp.Enable(skill: ESkill): Boolean; ``` Enabled a skill in the lamp interface. Example: ```pascal {$I WaspLib/main.simba} begin Lamp.Enable(ESkill.HERBLORE); end. ``` ```{figure} ../../images/lamp_enable.gif ``` - - - ## Lamp.Confirm ```pascal function TLamp.Confirm(): Boolean; ``` Clicks the confirm button in the lamp interface. Example: ```pascal {$I WaspLib/main.simba} begin Lamp.Select(ESkill.HERBLORE); end. ``` ```{figure} ../../images/lamp_select.gif ``` - - - ## Lamp.Select ```pascal function TLamp.Select(skill: ESkill): Boolean; ``` Selects a skill in the lamp interface and clicks confirm. Example: ```pascal {$I WaspLib/main.simba} begin Lamp.Select(ESkill.HERBLORE); end. ``` ```{figure} ../../images/lamp_select.gif ``` - - - ## Lamp variable Global {ref}`TLamp` variable.