MainScreen

Methods to interact with the mainscreen.


TRSMainScreen

Main record to handle the mainscreen and methods relating to it.


MainScreen.SetupInterface

procedure TRSMainScreen.SetupInterface();

Internal setup method responsible for setting up the TRSMainScreen interface coordinates.

This is called automatically for you on the MainScreen variable.


MainScreen.AddMask

procedure TRSMainScreen.AddMask(tpa: TPointArray);
procedure TRSMainScreen.AddMask(box: TBox); overload;
procedure TRSMainScreen.AddMask(circle: TCircle); overload;

Helper methods to help building the TRSMainScreen.Mask. TRSMainScreen.Mask is a helper variable used by MainScreen.IsVisible and MainScreen.Filter to reduce computation it would require without a mask. This is only useful for resizable modes.


UpText

UpText refers to the text that shows up on the top left corner of the mainscreen describing what action you will perform if you click.

The game uptext is one of the few texts that has a lot of randomization to combat bots and therefore you shouldn’t rely on being able to read it 100% accurately because many times you won’t.

To debug uptext when uptext methods are used add the following compiler directive to your script before you include WaspLib:

{$DEFINE WL_DEBUG_UPTEXT}

MainScreen.UpText

property TRSMainScreen.UpText: String;

Returns the UpText on the mainscreen.

Example:

WriteLn MainScreen.UpText;

MainScreen.IsUpText

function TRSMainScreen.IsUpText(text: String; caseSensitive: Boolean = True; similarity: Single = 0.85; timeout: Integer = -1): Boolean
function TRSMainScreen.IsUpText(strings: TStringArray; caseSensitive: Boolean = True; similarity: Single = 0.85; timeout: Integer = -1): Boolean; overload;;

Compares text or strings with the UpText on the mainscreen. Returns True if the match above the threshold similarity.

UpText is delayed by at least one frame, so this only returns true if the uptext doesn’t change within 50ms. It also wait 25ms between each loop. By default it can wait anywhere from 85ms to 250ms total.

If you cannot afford this delay on your script set a your own timeout.

Example:

if MainScreen.IsUpText('Walk here') then
  Mouse.Click(EMouseButton.LEFT);

Server Messages

“Server Messages” refers to the text that shows up on the top left corner of the mainscreen inside of a black box. These can only be seen when there’s a message. An easy way to see this is to simply attempt to switch worlds.


MainScreen.ServerMessage

property TRSMainScreen.ServerMessage: String;

Returns the Server Messages if it’s visible.

Example:

WriteLn MainScreen.GetServerMessage;

MainScreen.IsServerMessage

function TRSMainScreen.IsServerMessage(text: String; caseSensitive: Boolean = True; similarity: Single = 0.85): Boolean;

Compares text with the Server Messages visible if any. Returns True if the match above the threshold similarity.

Example:

if MainScreen.IsServerMessage('Loading...') then
  Sleep(2000, 4000);

MainScreen.SetHighestPitch

procedure TRSMainScreen.SetHighestPitch();

Attempts to set the camera pitch to the highest possible.

Example:

if not MainScreen.HighestPitch then
  MainScreen.SetHighestPitch();

MainScreen.IsVisible

function TRSMainScreen.IsVisible(pt: TPoint): Boolean;
function TRSMainScreen.IsVisible(tpa: TPointArray): Boolean; overload;

Returns True if a point pt is visible on the mainscreen. This also checks for open interfaces to check if the point is not behind them.

Example:

WriteLn MainScreen.IsVisible([100,100]);

MainScreen.Filter

function TRSMainScreen.Filter(tpa: TPointArray): TPointArray;

Filters a TPA returning only the points visible on the mainscreens. This also checks for open interfaces to check if the points are not behind them.


MainScreen.RedClicked

function TRSMainScreen.RedClicked(): Boolean;

Returns True if a the red cross from clicking an entity is visible on the mainscreen.

Example:

WriteLn MainScreen.RedClicked();

MainScreen.WaitRedClick

function TRSMainScreen.WaitRedClick(time: Integer = 250): Boolean;

Returns True if a the red cross from clicking an entity is visible on the mainscreen within time milliseconds.

Example:

WriteLn MainScreen.WaitRedClick();

MainScreen.YellowClicked

function TRSMainScreen.YellowClicked(): Boolean;

Returns True if a the yellow cross from click to “walk here” is visible on the mainscreen.

Example:

WriteLn MainScreen.YellowClicked();

MainScreen.WaitYellowClick

function TRSMainScreen.WaitYellowClick(time: Integer = 250): Boolean;

Returns True if a the yellow cross from clicking to “walk here” is visible on the mainscreen within time milliseconds.

Example:

WriteLn MainScreen.WaitYellowClick();

MainScreen variable

Global TRSMainScreen variable.


Biometrics.YellowClick

function TBiometrics.YellowClick(button: EMouseButton; clicks: UInt32 = 3): Boolean;

Basically the same as Biometrics.Click but returns true if we yellow clicked.

Example:

Biometrics.YellowClick(EMouseButton.LEFT);

Biometrics.RedClick

function TBiometrics.RedClick(button: EMouseButton; clicks: UInt32 = 3): Boolean;

Basically the same as Biometrics.Click but returns true if we red clicked.

Example:

Biometrics.RedClick(EMouseButton.LEFT);