Misc

Misc functions and methods that don’t really fit in a single place at the moment


RSColors

RSColors.ITEM_SHADOW
RSColors.ITEM_SHADOW_GRAY
RSColors.ITEM_BORDER
RSColors.INTERFACE_BORDER
RSColors.ITEM_BORDER_WHITE
RSColors.STACK_YELLOW
RSColors.STACK_WHITE
RSColors.STACK_GREEN
RSColors.STACK_COLORS
RSColors.TEXT_WHITE
RSColors.TEXT_ORANGE
RSColors.TEXT_GREY
RSColors.TEXT_GREEN
RSColors.TEXT_YELLOW
RSColors.TEXT_RED
RSColors.TEXT_LIGHT_YELLOW

Record holding a collection of constant colors used throughout the game.


Level2XP

function Level2XP(level: Integer): Integer;

Converts a level to the xp required for that level.

Example:

  WriteLn Level2XP(70);

XP2Level

function XP2Level(xp: Integer): Integer;

Converts XP to the respective level.

Example:

  WriteLn XP2Level(100000);

TColor.Random

function TColor.Random(min: Byte = $80): TColor; static;

Returns a random TColor with a min value of brightness. min is a Byte so it goes from $00 (0) to $FF (255).

Example:

WriteLn TColor.Random();

TColorArray.GetRarest

function TColorArray.GetRarest(): TColor;

Returns a the rarest TColor in the TColorArray.

Example:

WriteLn arr.GetRarest();

TStringArray.AnyContains

function TStringArray.AnyContains(value: String; caseSensitive: Boolean = True): Boolean;

Returns True/False if any String in the TStringArray contains value.


Activity

Global Activity variable.

You can use this to handle the activity in your script.

The idea behind “Activity” is that it’s a timer, by default that runs for 5 minutes. Everytime your script is considered “active” the timer is reset back to the start.

If Activity.IsFinished ever returns True that means your script is inactive or you are not restarting Activity properly.

By default, WaspLib will restart Activity for your when XPBar.EarnedXP or XPBar.WaitXP return True.

For more custom ways of using this kind of activity tracker you need to implement it but you could for example, in a fishing script, restart Activity whenever you get a fish with:

Activity.Restart();

Using Activity to shutdown your script or correct course is up to you. A simple way to shutdown your script would be to add this to your main loop:

if Activity.IsFinished then
  raise 'Script shutdown due to no activity detected for 5 minutes.';