Table Of Contents

Previous topic

Symbol

Next topic

Text

This Page

Timing

The Timing include contains a lot of timing related functions.

MsToTime

function MsToTime(MS, StrType: Integer): string;

Takes MS in milliseconds and outputs a string with hours, mins and seconds. Different styles can be created with different StrType values: Str Type:

  • Time_Formal: 2 Hours, 47 Minutes and 28 Seconds
  • Time_Short: 02h, 47m, 28s
  • Time_Abbrev: 2 hr, 47 min, 28 sec
  • Time_Bare: 02:47:28
  • Time_FStop: 12.04.40

Note

by Zephyrsfury, Nava2 and Rasta Magician.

Example:

TimeRunning

function TimeRunning: String;

Returns Time since the script was started (GetTimeRunning).

Note

by Rasta Magician.

Example:

MarkTime

procedure MarkTime(var TimeMarker: Integer);

Sets TimeMarker to current system time

Note

by Stupid3ooo

Example:

TimeFromMark

function TimeFromMark(TimeMarker: Integer): Integer;

Returns Milliseconds since MarkTime was set

Note

by Stupid3ooo

Example:

TheTime

function TheTime : string;

Returns current time as a string

Note

by RsN (fixed by Ron)

Example:

TheDate

function TheDate(DateFormat : Integer) : String;

TheDate will return the current date. DateFormats can be:

  • Date_Formal = April 2nd, 2007 Month Day, Year
  • Date_Month = 04/02/07 Month/Day/Year
  • Date_Day = 02-04-07 Day-Month-Year

Note

by Ron, Nava2 & Narcle

Example:

WaitOptionMultiEx

function WaitOptionMultiEx(S: TStringArray; TextType: string;
    Action: fnct_ActionOptions; Time: Integer): Boolean;

Waits for a TStringArray of options and selects one of them. Searches for TextType you input. ‘action’, ‘player’: The white text ‘item’: The orange text ‘npc’: The yellow text ‘object’: The cyan text ‘all’: Searches for all colors of text. Will default to ‘all’.

Note

by Infantry001

Example:

WaitOptionMulti

function WaitOptionMulti(S: TStringArray; Time: Integer): Boolean;

Waits for a TStringArray of options and selects one of them

Note

by Marpis, N1ke! & Rasta Magician

Example:

WaitOptionEx

function WaitOptionEx(S, TextType: String; Time: Integer): Boolean;

Waits for an Option and selects it. Searches for TextType.

Note

by Infantry001

Example:

WaitOption

function WaitOption(S: String; Time: Integer): Boolean;

Waits for an Option and selects it

Note

by N1ke!

Example:

WaitUpTextMulti

function WaitUpTextMulti(S: TStringArray; Time: integer): Boolean;

Waits for a TStringArray of UpText, returns true if found

Note

by Marpis & N1ke!

Example:

WaitUptext

function WaitUptext(S: String; Time: Integer): Boolean;

Waits for an UpText, returns true if found

Note

by Marpis edited by N1ke!

Example:

WaitInvCount

function WaitInvCount(Count, MaxTime: Integer; CountType: (MaxCT, MinCT, ExactCT)): boolean;

Waits for a maximum inv count. Returns true if InvCount <= Count

Note

by Rasta Magician

Example:

WaitInvMaxCount

function WaitInvMaxCount(Count, MaxTime: integer): boolean;

Waits for a maximum inv count. Returns true if InvCount <= Count

Note

by Rasta Magician.

Example:

WaitInvMinCount

function WaitInvMinCount(Count, MaxTime: integer): boolean;

Waits for a minimum inv count. Returns true if InvCount >= Count

Note

by Rasta Magician

Example:

WaitColor

function WaitColor(x, y, Color, Tol, MaxTime: integer): Boolean;

Waits for a color at (x, y) with tolerance Tol, returns true if found

Note

by Rasta Magician, fixed by TRiLeZ

Example:

WaitFindColor

function WaitFindColor(var x, y: integer; Color, Tol, x1, y1, x2, y2, MaxTime: integer): Boolean;

Waits for a color at (x, y) with tolerance Tol, returns true if found

Note

by Rasta Magician, fixed by TRiLeZ

Example:

WaitFindColors

function WaitFindColors(var x, y: integer; Color, Tol, x1, y1, x2, y2, MaxTime: integer): Boolean;

Waits for a color at (x, y) with tolerance Tol, returns true if found

Note

by IceFire908 based completely off WaitFindColor

Example:

WaitColorCount

function WaitColorCount(Color, x1, y1, x2, y2, Tol, MinCount, MaxCount, MaxTime: integer):boolean;

Waits Color count in box (x1, y1, x2, y2) with Tol

Note

by Rasta Magician

Example:

WaitColorGone

function WaitColorGone(Color, x, y, Tol, MaxTime: integer): Boolean;

Waits until a colour is gone at (x, y) with tolerance and a timeout. Results true if the colour disappeared at (x, y) within the time cap.

Note

by TRiLeZ

Example:

WaitColorGoneIn

function WaitColorGoneIn(Colour, x1, y1, x2, y2, Tol, MaxTime: integer): Boolean;

Waits until a colour is gone in an area with tolerance and a timeout. Results true if the colour disappeared in the area within the time cap.

Note

by TRiLeZ

Example:

WaitFunc

function WaitFunc(Func: Function: Boolean; WaitPerLoop, MaxTime: Integer): Boolean;

Waits for function Func to be true. WaitPerLoop is how often you want to call “Func” function. Example: “WaitFunc(@BankScreen, 10 + Random(15), 750);” will check if BankScreen is open every 10-25th millisecond, for a maximum of 750 milliseconds. Notice the ‘@’.

Note

by Rasta Magician, small edit by EvilChicken!

Example:

WaitNone

procedure WaitNone;

For use with while (this) do WaitNone

Note

by IceFire908

Example: