
Originally Posted by
Main
or
Simba Code:
find text between 'only', 'more'
something like that (search text between).
EDIT:
Simba Code:
function Between(s1, s2, str: string): string;
I used something like this
Simba Code:
procedure TokensUpdate;
var
i: Integer;
TokensBox: TBox;
TokensBoxTPA: TPointArray;
TokensGainedString: String;
NumbersCheck: Array of String;
begin
TokensGainedString := GetChatBoxText(8, clBlack);
NumbersCheck := ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0'];
for i:=0 to 10 do
begin
if Pos(NumbersCheck[i], TokensGainedString) > 0 then
begin
TokensGained := StrToInt(GetNumbers(TokensGainedString));
Tokens := (Tokens + TokensGained);
TokensBox := IntToBox(289, 456, 350, 470);
TPAFromBoxWrap(TokensBox, TokensBoxTPA);
SMART_DrawDotsEx(False, TokensBoxTPA, RGBtoColor(194, 178, 146));
SMART_DrawText(290, 457, UpChars, ''+IntToStr(Tokens)+'', clWhite);
Exit;
end;
end;
end;
if the line contains numbers then use GetNumbers.. way more efficient than looping through everything.