The idea
So the idea, is to create a simba procedure that will auto target the correct client, so you don't have to use the cross-hairs in simba to do it.
What will simba have to do to code this idea:
1: Create a function that finds text with in a string and returns true or false, if the string has that string in it.
2: Search all the current running processes for the process with the correct title, width, and height.
3: Set the target to the above process and activate the client, aka bring it forward.
1: Creating a string.contains function
function string.contains(s: string): Boolean;
begin
if ((self <> '') and (s <> '')) then
result := (pos(s, self) > 0)
else
result := False;
end;
code explanation:
-We create a function string.contains ,where string is the string we are searching in, with the parameter of s, which is the string we are looking for, and set it to return a Boolean (true or false)
-Next, we begin and say if self, the string we are searching in, and s are not equal to blank
-Then the result are, if the position of s in self is greater then 0. Which means the string was found, the result is true.
-After that, we simply state if it wasn't found, the result is false, and end our function.
2: Searching for the Client
procedure AutoTarget(ClientName:string);
var
processes: TSysProcArr;
i: integer;
begin
processes := GetProcesses();
writeln('Scanning for ' , ClientName;
for i := 0 to high(processes) do
if (processes[i].title.contains(ClientName)) and (processes[i].width = 765) and (processes[i].height = 525) then
begin
end;
end;
code explanation:
-We create a procedure named AutoTarget with the parameter of ClientName as a string.
-Setup a couple of vars: processes as Tysyprocarr, and i as an integer.
-Then, we begin our procedure and set processes to our current running processes.
-Add some debug information, we write the line scanning for client name, in simba's debug box.
-After that, we say for i is equal to high(processes) search for the processes with: the title that contains client, width of 765 and height of 525.
On to the next section.
3: Setting target and activating the client.
procedure AutoTarget(ClientName:string);
var
processes: TSysProcArr;
i: integer;
begin
processes := GetProcesses();
writeln('Scanning for ' , ClientName;
for i := 0 to high(processes) do
if (processes[i].title.contains(ClientName)) and (processes[i].width = 765) and (processes[i].height = 525) then
begin
setTarget(processes[i]);
ActivateClient();
break;
end;
end;
code explanation:
-If simba finds the correct process then, setTarget to that process and use the srl procedure ActivateClient(), which brings the targeted client forward.
-Then break out of the current loop.
Now if we run the script, testing with runique, the results are: