# Make The "Make" menu is the {ref}`Chat` box menu that pops up when you attempt to craft certain items in OldSchool RuneScape. ```{figure} ../../images/make_interface.png ``` - - - ## TRSMakeQuantityButton type Helper record used to cache make menu buttons. - - - ## TRSMakeItem Helper record used to cache make menu items. - - - ## TRSMake Main record used to interact with the {ref}`Make` menu. - - - ## Make.SetupInterface ```pascal procedure TRSMake.SetupInterface(); ``` Internal method used to setup the {ref}`TRSMake` coordinates. This is automatically called for you on the {ref}`Make variable`. - - - ## Make.IsOpen ```pascal function TRSMake.IsOpen(): Boolean; ``` Returns True/False if the {ref}`Make` if open. Example: ```pascal WriteLn Make.IsOpen(); ``` - - - ## Make.WaitOpen ```pascal function TRSMake.WaitOpen(time: Integer = 600; interval: Integer = -1): Boolean; ``` Returns True if the {ref}`Make` opens within `time` milliseconds. Example: ```pascal WriteLn Make.WaitOpen(); ``` - - - ## Make.GetItemBoxes ```pascal function TRSMake.GetItemBoxes(): TBoxArray; ``` Returns the available item buttons as a TBoxArray. Example: ```pascal ShowOnTarget(Make.GetItemBoxes()); ``` ```{figure} ../../images/make_items.png ``` - - - ## Make.GetQuantityBoxes ```pascal function TRSMake.GetQuantityBoxes(): TBoxArray; ``` Finds quantity button boundaries and returns them as a TBoxArray. You have 2 ways of getting the quantity boxes, a static one: ```pascal ShowOnTarget(Make.QuantityButtons); ``` ```{figure} ../../images/make_static_quantity_boxes.png The make static boxes. ``` And a dynamic one: ```pascal ShowOnTarget(Make.GetQuantityBoxes()); ``` ```{figure} ../../images/make_quantity_boxes.png The make "dynamic" boxes. ``` There are use cases for both, internally, `Make.GetQuantityBoxes` is usually used. - - - ## Make.GetQuantityButtons() ```pascal function TRSMake.GetQuantityButtons(): array of TRSMakeQuantityButton; ``` Returns the visible quantity buttons as a array of TRSMakeQuantityButton. Example: ```pascal WriteLn Make.GetQuantityButtons(); ``` - - - ## Make.FindQuantityButtons ```pascal function TRSMake.FindQuantityButtons(): array of TRSMakeQuantityButton; ``` Attempts to find and return all quantity buttons in the Make interface. This is a safe wrapper around `GetQuantityButtons()` that first verifies the Make interface is open before attempting to locate the buttons. Returns an empty array if the Make interface is not currently open. Example: ```pascal var buttons: array of TRSMakeQuantityButton; i: Integer; begin buttons := Make.FindQuantityButtons(); for i := 0 to High(buttons) do WriteLn('Button ', i, ' bounds: ', buttons[i].Button.Bounds); end; ``` - - - ### Make.GetCurrentQuantityButton ```pascal function TRSMake.GetCurrentQuantityButton(): Integer; ``` Get the current active make quantity button. Example: ```pascal current := Make.GetCurrentQuantityButton(); WritLn current; ShowOnTarget(current.Button.Bounds); ``` - - - ### Make.GetCurrentQuantity ```pascal function TRSMake.GetCurrentQuantity(): Integer; ``` Get the current active make quantity as an integer. If All button is current then returns -1. Example: ```pascal current := Make.GetCurrentQuantityButton(); WritLn current; ShowOnTarget(current.Button.Bounds); ``` - - - ## Make.HasHint ```pascal function TRSMake.HasHint(): Boolean; ``` Returns true if a hint tooltip is visible. Example: ```pascal if Make.HasHint() then ShowOnTarget(Make.GetHintBox()); ``` - - - ## Make.WaitHint ```pascal function TRSMake.WaitHint(time: Integer = 600; interval: Integer = -1): Boolean; ``` Returns true if a hint tooltip is visible within `time` milliseconds. Example: ```pascal if Make.WaitHint() then ShowOnTarget(Make.GetHintBox()); ``` - - - ## Make.GetHintBox ```pascal function TRSMake.GetHintBox(): TBox; ``` Returns the hint tooltip bounds. Example: ```pascal ShowOnTarget(Make.GetHintBox()); ``` ```{figure} ../../images/make_hint.png ``` - - - ## Make.ReadHint ```pascal function TRSMake.ReadHint(): String; ``` Returns the hint tooltip text. Example: ```pascal WriteLn Make.ReadHint(); ``` - - - ## Make.CloseHint ```pascal function TRSMake.CloseHint(): Boolean; ``` Attempts to close a hint tooltip. Example: ```pascal WriteLn Make.CloseHint(); ``` - - - ## Make.QuantityButtons The quantity buttons are dynamic there can be anywhere from 1 to 6 available. You have their coordinates available at anytime through the `TRSMake.QuantityButtons` variable: ```pascal ShowOnTarget(Make.QuantityButtons); ``` ```{figure} ../../images/make_quantities.png The make interface quantity buttons. ``` Despite them being always available you should only interact with the ones that are visible which you can do easily through the next methods. - - - ### Make.FindQuantityButton ```pascal function TRSMake.FindQuantityButton(amount: Integer): TRSMakeQuantityButton; ``` Finds and returns the TRSMakeQuantityButton matching the specified `amount`. For standard quantities (1, 5, 10, All), returns the corresponding button directly. For custom amounts, prioritizes a button already set to that value, otherwise returns the "Other" (X) button which will prompt for manual entry. Returns an empty record if no matching button is found or the Make interface is not open. Note: Automatically closes any tooltip that may be covering the quantity buttons. Example: ```pascal var btn: TRSMakeQuantityButton; begin btn := Make.FindQuantityButton(5); if btn <> [] then WriteLn('Found button: ', btn); end; ``` - - - ### Make.IsQuantitySelected ```pascal function TRSMake.IsQuantitySelected(idx: Integer): Boolean; ``` Checks if the specified `idx` quantity button is currently selected. Example: ```pascal WriteLn Make.IsQuantitySelected(Make.QUANTITY_ALL); ``` - - - ### Make.SetQuantity ```pascal function TRSMake.SetQuantity(amount: Integer): Boolean; ``` Attempts to set a quantity. Example: ```pascal WriteLn Make.SetQuantity(Make.QUANTITY_ALL); ``` - - - ## Make._SelectHelper ```pascal function TRSMake._SelectHelper(index: Integer; boxes: TBoxArray; keyboardProbability: Single): Boolean; ``` Internal helper method that handles selecting an item with or without the keyboard. You probably will never need to use this directly. - - - ## Make.Select ```pascal function TRSMake.Select(index, quantity: Integer; keyboardProbability: Single = -1): Boolean; function TRSMake.Select(item: String; quantity: Integer; keyboardProbability: Single = -1): Boolean; overload; ``` Select a `index` or an `item` of the available item buttons available. If you are selecting an `item` you need to use the tooltip text. Example: ```pascal WriteLn Make.Select('Maple longbow', QUANTITY_ALL); ``` - - - ## Make variable Global {ref}`TRSMake` variable.