# XPBar Menu Methods to interact with the XPBar Menu interface. ```{figure} ../../images/xpbar_menu_interface.png ``` - - - (TXPBarMenu)= ## TXPBarMenu type Main record to interact with the {ref}`XPBar Menu` interface. - - - ## XPBarMenu.IsOpen ```pascal function TXPBarMenu.IsOpen(): Boolean; ``` Returns true if the xpbar menu is open. Example: ```pascal WriteLn XPBarMenu.IsOpen(); ``` - - - ## XPBarMenu.WaitOpen ```pascal function TXPBarMenu.WaitOpen( time: Integer = TICK; interval: Integer = -1 ): Boolean; ``` Returns true if the xpbar menu opens within `time` milliseconds.. Example: ```pascal WriteLn XPBarMenu.WaitOpen(); ``` - - - ## XPBarMenu.Open ```pascal function TXPBarMenu.Open(): Boolean; ``` Attempts to open the XPBar menu and returns true on success. Example: ```pascal WriteLn XPBarMenu.Open(); ``` - - - ## XPBarMenu.Close ```pascal function TXPBarMenu.Close(escape: Boolean): Boolean; function TXPBarMenu.Close(escapeProbability: Single = 0): Boolean; overload; ``` Closes the XPBar menu, depending on `escape` or `escapeProbability the function will either click the button or press escape key. Example: ```pascal WriteLn XPBarMenu.Close(); ``` - - - ## XPBarMenu.Fix ```pascal function TXPBarMenu.Fix(attempts: Integer = 3): Boolean; ``` Attempts to fix the XPBar menu with the expected settings. Example: ```pascal WriteLn XPBarMenu.Fix(); ``` - - - ## XPBarMenu variable Global {ref}`TXPBarMenu` variable.