SRL Archive - RS3 Help

Target new window help


primaz

2019-12-20 11:02:24

Hello guys.

Im pretty new to scripting and i need your help.

I am working on a script that need to reload the nxtclient sometimes but i can't figure out how to find and target the new loaded nxtclient.



The code below doesn't seems to work for some reason, found it in docs.





function FindAndSetTarget(TitlePrefix: String; SetAsTarget: Boolean): Boolean;
var
T: TSysProcArr;
I: Integer;
begin
T:= GetProcesses();
for I := 0 to high(T) do
if ExecRegExpr('^' + TitlePrefix, T.Title) then
begin
Result := True;
if SetAsTarget then
begin
SetTarget(T);
ActivateClient;
end;
end;
end;




Found a thread about this a while ago but can't find it.

I know how to close and load client but not target it…. please help.



In the hope of success, primaz








EDIT: Ok I got it, the code was working, just needed to rebot everything, dunno how to change to resolved tho.