SRL Archive - Research & Development Lounge

Req Assist functions!


Cazax

2008-03-18 17:25:59

ill be editing this post for more functions.

function 1:

{*******************************************************************************
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;

will be posting more functions.

Santa_Clause

2008-03-19 06:09:50

if FindTextTpa(14822282, 5, MCX1, MCY1, MCX2, MCY2, upchars, Action(DoAction)) then

Is this missing a parameter?

Cazax

2008-03-19 16:40:14

From: Santa_Clause
if FindTextTpa(14822282, 5, MCX1, MCY1, MCX2, MCY2, upchars, Action(DoAction)) then

Is this missing a parameter?


Yes, didnt notice that :D

EvilChicken!

2008-03-19 19:29:11

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. ^_^

Cazax

2008-03-19 20:32:30

From: EvilChicken!
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. ^_^


added now it looks better thanks.