The Timing include contains a lot of timing related functions.
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:
function TimeRunning: String;
Returns Time since the script was started (GetTimeRunning).
Note
by Rasta Magician.
Example:
procedure MarkTime(var TimeMarker: Integer);
Sets TimeMarker to current system time
Note
by Stupid3ooo
Example:
function TimeFromMark(TimeMarker: Integer): Integer;
Returns Milliseconds since MarkTime was set
Note
by Stupid3ooo
Example:
function TheTime : string;
Returns current time as a string
Note
by RsN (fixed by Ron)
Example:
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:
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:
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:
function WaitOptionEx(S, TextType: String; Time: Integer): Boolean;
Waits for an Option and selects it. Searches for TextType.
Note
by Infantry001
Example:
function WaitOption(S: String; Time: Integer): Boolean;
Waits for an Option and selects it
Note
by N1ke!
Example:
function WaitUpTextMulti(S: TStringArray; Time: integer): Boolean;
Waits for a TStringArray of UpText, returns true if found
Note
by Marpis & N1ke!
Example:
function WaitUptext(S: String; Time: Integer): Boolean;
Waits for an UpText, returns true if found
Note
by Marpis edited by N1ke!
Example:
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:
function WaitInvMaxCount(Count, MaxTime: integer): boolean;
Waits for a maximum inv count. Returns true if InvCount <= Count
Note
by Rasta Magician.
Example:
function WaitInvMinCount(Count, MaxTime: integer): boolean;
Waits for a minimum inv count. Returns true if InvCount >= Count
Note
by Rasta Magician
Example:
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:
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:
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:
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:
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:
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:
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: