# Map Objects This file is responsible for interacting with map objects. - - - ## TRSMapObject.Find ```pascal function TRSMapObject.Find(cuboidArray: TCuboidArray): T2DPointArray; ``` Internal TRSMapObject method responsible for filtering a TCuboidArray by what's visible in the mainscren. This is meant to filter TRSMapObject.GetCuboidArray() so targets that are outside of the mainscreen are filtered out. You will probably never need to use this directly. - - - ## TRSMapObject.Visible ```pascal function TRSMapObject.Visible(cuboidArray: TCuboidArray): Boolean; ``` Internal TRSMapObject method that returns true or false if we have TCuboids visible on the mainscreen. You probably don't need to use this directly. - - - ## TRSMapObject._UpTextCheck ```pascal function TRSMapObject._UpTextCheck(out shouldExit: Boolean): Boolean; ``` Internal TRSMapObject helper method that is used by all hovering methods. You probably don't need to use this directly. - - - ## TRSMapObject._WalkUpTextCheck ```pascal function TRSMapObject._WalkUpTextCheck(out shouldExit: Boolean): Boolean; ``` Internal TRSMapObject helper method that is used by all walking hover methods. You probably don't need to use this directly. - - - ## TRSMapObject._ClickHelper ```pascal function TRSMapObject._ClickHelper(leftClick: Boolean): Boolean; ``` Internal TRSMapObject helper method that is used by other clicking methods. You probably don't need to use this directly. This is what's responsible for deciding if we click a target we are hovering or not. - - - ## TRSMapObject._SelectHelper ```pascal function TRSMapObject._SelectHelper(action: TStringArray): Boolean; ``` Internal TRSMapObject helper method that is used by other select methods. You probably don't need to use this directly. This is what is responsible for deciding if we just left click a target we are hovering or right click it and choose an option. - - - ## TRSObjectV2.Find ```pascal function TRSObjectV2.FindEx(out cuboids: TCuboidArray; out atpa: T2DPointArray): Boolean; function TRSObjectV2.Find(out atpa: T2DPointArray): Boolean; function TRSObjectV2.FindFromPosition(me: TPoint; out atpa: T2DPointArray): Boolean; ``` TRSObjectV2 method used to find a {ref}`TRSObjectV2`. If found returns true, if not returns false. The "extended" method in particular is mostly meant for debugging and is the one used when you call `Debug(TRSMapObject)`. Example: ```pascal WriteLn RSObjects.GEBank.Find(atpa); //Be in ge and with a walker setup there. Debug(atpa); ``` - - - ## TRSObjectV2.Draw ```pascal procedure TRSMapObject.Draw(out bitmap: TMufasaBitmap); ``` Helper method to debug TRSMapObjects used in `Debug(TRSMapObject)`. - - - ## TRSObjectV2.Find ```pascal function TRSObjectV2.FindEx(out cuboids: TCuboidArray; out atpa: T2DPointArray): Boolean; function TRSObjectV2.Find(out atpa: T2DPointArray): Boolean; function TRSObjectV2.FindFromPosition(me: TPoint; out atpa: T2DPointArray): Boolean; ``` TRSObjectV2 method used to find a {ref}`TRSObjectV2`. If found returns true, if not returns false. The "extended" method in particular is mostly meant for debugging and is the one used when you call `Debug(TRSMapObject)`. Example: ```pascal WriteLn RSObjects.GEBank.Find(atpa); //Be in ge and with a walker setup there. Debug(atpa); ``` - - - ## TRSObjectV2.Draw ```pascal procedure TRSMapObject.Draw(out bitmap: TMufasaBitmap); ``` Helper method to debug TRSMapObjects used in `Debug(TRSMapObject)`. - - - ## TRSMapObject.IsVisible ```pascal function TRSMapObject.IsVisible(): Boolean; ``` TRSMapObject method used to find a {ref}`TRSMapObject`. If found returns true, if not returns false. Example: ```pascal WriteLn RSObjects.GEBank.IsVisible(); //Be in ge and with a walker setup there. ``` - - - ## TRSMapObject._UpdateTarget ```pascal procedure TRSMapObject._UpdateTarget(sender: PMouse; var x, y: Double; var done: Boolean); ``` Internal helper method of TMouseMovingEventEx type used to update the target position while the mouse is moving. You should probably not touch this if you don't understand it. - - - ## TRSMapObject._HoverHelper ```pascal function TRSMapObject._HoverHelper(attempts: Int32; trackTarget: Boolean): Boolean; ``` Internal helper method used to hover a TRSMapObject target. You should not use this directly. - - - ## TRSMapObject._WalkHoverHelper ```pascal function TRSMapObject._WalkHoverHelper(attempts: Int32; trackTarget: Boolean): Boolean; ``` Internal helper method used to walk and hover a TRSMapObject target. You should not use this directly. This is responsible for deciding wether we should walk to a TRSMapObject target or not before attempting to hover it. - - - ## TRSMapObject.PreHoverHelper ```pascal function TRSMapObject.PreHoverHelper(attempts: Int32): Boolean; ``` Internal helper method used to pre-hover a TRSMapObject target. You should not use this directly. - - - ## TRSMapObject.Hover ```pascal function TRSMapObject.Hover(attempts: Int32 = 2; trackTarget: Boolean = TRSMapObject.TrackTarget): Boolean; ``` Method used to hover a TRSMapObject target if it's found on the mainscreen. It can update the target position while the mouse moves with **trackTarget**. Example: ```pascal RSW.WebWalk(WaspWeb.LOCATION_VARROCK); RSObjects.GEBank.Hover(); //Be in GE with a walker setup there. ``` - - - ## TRSMapObject.WalkHover ```pascal function TRSMapObject.WalkHover(attempts: Int32 = 2; trackTarget: Boolean = TRSMapObject.TrackTarget): Boolean; ``` Method used to walk and hover a TRSMapObject target if it's found on the mainscreen after walking. It can update the target position while the mouse moves with **trackTarget**. Example: ```pascal //Be in varrock with a varrock map loaded. RSW.WebWalk(WaspWeb.LOCATION_VARROCK); RSObjects.GEBank.WalkHover(); ``` - - - ## TRSMapObject.Click ```pascal function TRSMapObject.Click(leftClick: Boolean = True; attempts: Int32 = 2): Boolean; ``` Method used to click a TRSMapObject target if it's found on the mainscreen. Example: ```pascal //Be in ge with a ge map loaded. WriteLn RSObjects.GEBank.Click(); ``` - - - ## TRSMapObject.SelectOption ```pascal function TRSMapObject.SelectOption(action: TStringArray; attempts: Int32 = 2): Boolean; ``` Method used to select an option on a TRSMapObject target if it's found on the mainscreen. Example: ```pascal //Be in ge with a ge map loaded. WriteLn RSObjects.GEBank.SelectOption(['Collect']); ``` - - - ## TRSMapObject.WalkClick ```pascal function TRSMapObject.WalkClick(leftClick: Boolean = True; attempts: Int32 = 2): Boolean; ``` Method used to walk and click a TRSMapObject target if it's found on the mainscreen. Example: ```pascal //Be in ge with a ge map loaded, preferably far away so it has to walk. WriteLn RSObjects.GEBank.WalkClick(); ``` - - - ## TRSMapObject.WalkSelectOption ```pascal function TRSMapObject.WalkSelectOption(action: TStringArray; attempts: Int32 = 2): Boolean; ``` Method used to walk and select an option on a TRSMapObject target if it's found on the mainscreen. Example: ```pascal //Be in ge with a ge map loaded, preferably far away so it has to walk. WriteLn RSObjects.GEBank.WalkSelectOption(['Collect']); ``` - - - ## Debug ```pascal procedure Debug(obj: TRSObjectV2); overload; procedure Debug(npc: TRSNPCV2); overload; ``` Debugs a TRSMapObject used with the help of it's `.Draw()` method. Example: ```pascal {$I SRL-T/osr.simba} begin Map.SetupChunkEx([49,52,49,52]); Debug(Objects.Get('clay rocks')); //be in varrock west mine. end. ```