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.
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(strings: TStringArray; caseSensitive: Boolean; similarity: Single): Boolean;
Internal helper method used in MainScreen.IsUpText.
strings casing must be lower case if caseSensitive is False.
You probably won’t ever need to call this method directly.
MainScreen.IsUpText¶
function TRSMainScreen.IsUpText(strings: TStringArray; caseSensitive: Boolean = True; similarity: Single = 0.85; time: Integer = -1): Boolean;
function TRSMainScreen.IsUpText(text: String; caseSensitive: Boolean = True; similarity: Single = 0.85; time: 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.AnyVisible(tpa: TPointArray): Boolean;
function TRSMainScreen.AllVisible(tpa: TPointArray): Boolean;
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.Interact¶
function TRSMainScreen.Interact(strings: TStringArray): Boolean;
function TRSMainScreen.Interact(pt: TPoint; strings: TStringArray): Boolean; overload;
Attempts to interact with something on the mainscreen.
If the uptext matches strings wasplib will left click, otherwise it will use
ChooseOption.
Example:
WriteLn MainScreen.Interact('Pick-up');
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);