Infantry001
2009-07-02 17:34:05
I was surprised that these functions didn't make it into Timing.scar. I figured they would be pretty useful.
{*******************************************************************************
Function WaitOptionMultiEx(S: TStringArray; TextType: string; Time: Integer): Boolean;
By: Infantry001
Description: 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'.
*******************************************************************************}
Function WaitOptionMultiEx(S: TStringArray; TextType: string; Time: Integer): Boolean;
var
T: Integer;
begin
Result := false;
T := GetSystemTime + Time;
repeat
Result := ChooseOptionMultiEx(S, TextType, ClickLeft);
Wait(30+Random(10));
until(Result)or(GetSystemTime > T);
end;
{*******************************************************************************
Function WaitOptionEx(S, TextType: String; Time: Integer): Boolean;
By: Infantry001
Description: Waits for an Option and selects it. Searches for TextType.
*******************************************************************************}
Function WaitOptionEx(S, TextType: String; Time: Integer): Boolean;
begin
Result := WaitOptionMultiEx([S], TextType, Time);
end;