SCAR Code:
program AssistRequestedTest;
{.include SRL/SRL.scar}
{-------------------------------------- Your function -------------------------}
{*******************************************************************************
Function : AssistRequested(Action: integer): Boolean;
By: Cazax / Edit by EvilChicken!
Description: Checks if someone is requesting assist. If Accept is true then
accepts the request. Results true if request found.
*******************************************************************************}
function AssistRequested(Accept: Boolean): boolean;
begin
if (Accept) then begin
case FindTextTpa(14822282, 5, MCX1, MCY1, MCX2, MCY2, 'assistance', UpChars, ClickLeft) of
True: begin
Writeln('Someone is requesting assist, accepted.');
Result := True;
end;
False: Result := False;
end;
end else begin
case FindTextTpa(14822282, 5, MCX1, MCY1, MCX2, MCY2, 'assistance', upchars, Nothing) of
True: begin
Writeln('Someone is requesting assist.');
Result := True;
end;
False: Result := False;
end;
end;
end;
{--------------------------------End of your function -------------------------}
begin
SetUpSRL;
ActivateClient;
Wait(RandomRange(500, 1000));
WriteLn('Is someone requesting assist: ' + BoolToStr(AssistRequested(True)));
end.
I improved your function slightly, it actually works now. The rest of the script is just so you can copy-paste it into SCAR and run it right away. I hope you don't mind I put in my name in the credits. ^_^