Both ideas came from Narcle's scripts... ANYWAYS
Here is the code I use:
SCAR Code:
//Waits until the required uptext appears. Max of 500 Original Credits to munk.
function MultiUTWait(Texts: TStringArray): Boolean;
var
iTime: Integer;
begin
iTime := GetTimeRunning + 500;
Result := StrInArr(GetUpText, Texts);
while (iTime > GetTimeRunning) and not (Result) do
begin
Wait(RandomRange(10, 50));
Result := StrInArr(RS_GetUpText, Texts);
end;
end;
// See MultiUTWait
function UTWait(Text: String): Boolean;
begin
Result := MultiUTWait([Text]);
end;
So, it waits a max of 500ms for the correct uptext to appear. Otherwise, it will return false.
This allows for lag w/ computers!
Comments?
Also, I attached the string array functions of Narcle's. They should be added...
SCAR Code:
//Narcle
function StrInArr(str : string; arrS : TStringArray) : Boolean;
var
I, L, H: Integer;
begin
Result := True;
Str := LowerCase(Str);
L := Low(arrS); H := High(arrS);
for I := L to H do
if Pos(Str, LowerCase(arrS[I])) > 0 then
Exit;
Result := False;
end;
//Narcle
function ArrInStr(arrS : TStringArray; str : string) : Boolean;
var
I, L, H: Integer;
begin
Result := True;
Str := LowerCase(Str);
L := Low(arrS); H := High(arrS);
for I := L to H do
if Pos(LowerCase(arrS[I]), Str) > 0 then
Exit;
Result := False;
end;
//Narcle
function CombineStrArray(Ar1, Ar2: TStringArray): TStringArray;
var
Temp: TStringArray;
L, H, i: integer;
begin
SetArrayLength(Temp, Length(Ar1) + Length(Ar2));
L := Low(Ar1);
H := High(Ar1);
For i := L to H do
Temp[i] := Ar1[i];
L := H + 1;
H := High(Temp);
for i := L to H do
Temp[i] := Ar2[i-L];
Result := Temp;
end;