SRL Archive - Bugs

Smart's Window Targeting stuff doesn't work


LordJashin

2012-03-07 21:08:43

Problem Resolved, there should be 2 activate clients -_- confoozing




I'm sick of this, its like one day it works then the next it doesn't :duh:. SCAR however the FindWindow function there works flawlessly.

I tried this, and FindWindow in Simba but to no avail: Ofc I ran the Simba one first b4 disguising Firefox


Coh3n

2012-03-07 21:52:25

Well, you're using the functions differently. In SCAR you have 'Cat' and false, while in Simba you have 'Category' and true. Not sure if the parameters are even the same, or if it would make a difference, but it's somewhere to start. :p

Also, this doesn't have anything to do with SMART, or SRL. Moving this to Simba bugs.

LordJashin

2012-03-07 22:45:07

From: Coh3n
Well, you're using the functions differently. In SCAR you have 'Cat' and false, while in Simba you have 'Category' and true. Not sure if the parameters are even the same, or if it would make a difference, but it's somewhere to start. :p

Also, this doesn't have anything to do with SMART, or SRL. Moving this to Simba bugs.


Sorry I wasn't more clear. FindAndSetTarget is from the Smart.simba file. It doesn't make any difference, Firefox's window title wouldn't just be Cat lol, it was on SCAR's api categories page :p. Both are window title parts.

LordJashin

2012-03-11 16:15:03

MEGA BUMP

This needs to be fixed asap, I can't use Simba if I can't target a window that isn't Smart. Scar's functions work good, is there anyway I can use those, or include Simba, SRL, and Smart in Scar? lol.

masterBB

2012-03-11 16:25:12

program new;

procedure test;
var
T : TSysProcArr;
I : Integer;
begin
T := GetProcesses;
for I := High(T) downto 0 do
writeln(T[i].Title);
end;

begin
test;
end.

Is the program in that list?

LordJashin

2012-03-11 16:28:47

From: masterBB
Simba Code:
[LEFT]program new;

procedure test;
var
T : TSysProcArr;
I : Integer;
begin
T := GetProcesses;
for I := High(T) downto 0 do
writeln(T.Title);
end;

begin
test;
end.
[/LEFT]


Is the program in that list?


Yep

Smart's Window Targeting stuff doesn't work - SRL-Forums - Mozilla Firefox
Simba
Simba - Untitled*

Edit: Maybe I need to reinstall Simba? Is it working for you?

masterBB

2012-03-11 16:29:59

I meant the category thingy ;).

I will look into this. Will post my findings here.

LordJashin

2012-03-11 16:32:30

From: masterBB
I meant the category thingy ;).

I will look into this. Will post my findings here.


I tried FindAndSetTarget with 'Smart' ( part of the Firefox title ). Didn't work


program new;
{$DEFINE SMART}
{$i SRL/srl.simba}

procedure test;
var
T : TSysProcArr;
I : Integer;
begin
T := GetProcesses;
for I := High(T) downto 0 do
writeln(T[i].Title);
end;

begin
test;
FindAndSetTarget('SRL', True);
wait(500);
ActivateClient;
end.


Program Manager
Main
AMD:CCC-AEMCapturingWindow
SRL-Forums - Reply to Topic - Mozilla Firefox
Simba
Simba - Untitled*

LordJashin

2012-03-11 16:36:10

Alright now this is an SRL/SMART Problem.

The following code WORKS but the above post didn't.


program new;

function FindAndSetTarget(TitlePrefix: String; SetAsTarget: Boolean): Boolean;
var
T : TSysProcArr;
I : Integer;
begin
T := GetProcesses;
for I := High(T) downto 0 do
if Pos(TitlePrefix, T[I].Title) <> 0 then
begin
Result := True;
if SetAsTarget then SetTarget(T[I]);
Exit;
end;
end;

procedure test;
var
T : TSysProcArr;
I : Integer;
begin
T := GetProcesses;
for I := High(T) downto 0 do
writeln(T[i].Title);
end;

begin
test;
FindAndSetTarget('SRL', True);
wait(500);
ActivateClient;
wait(5000);
end.


[LEFT]
Edit: Forgot about this just remembered this is what I did way back when I first got into Simba
Edit 2: I wonder what the problem is in Smart.simba to cause this? Ill go look.
[/LEFT]

masterBB

2012-03-11 16:41:11

what happens when you remove this(smart.simba):
procedure ActivateClient;
begin
end;

LordJashin

2012-03-11 16:45:30

From: masterBB
what happens when you remove this(smart.simba):
Simba Code:
[LEFT]procedure ActivateClient;
begin
end;
[/LEFT]



Weird, when I remove that and run it. It switches to Firefox, BUT Simba is still in front. Like ontop of the firefox window, but it isn't selected. Firefox is selected.

While in my previous post, Simba minimized completely.

EDIT: NVM it works!

With that removed from Smart.simba

procedure ActivateClient;
begin
end;


program new;
{$DEFINE SMART}
{$i SRL/srl.simba}
begin

FindAndSetTarget('Smart', True);
wait(500);
ActivateClient;
wait(500);

end.

This now works. Woot bug fixed I guess.

Edit: Now someone needs to pull request or w/e to get this changed or just look at this thread.

masterBB

2012-03-11 16:59:24

I do not think it's a bug. Smart just overrides the normal activate client. I will look into it how to call the normal mmlcore one.

GetTClient.IOManager.ActivateClient;  

LordJashin

2012-03-11 17:05:29

From: masterBB
I do not think it's a bug. Smart just overrides the normal activate client. I will look into it how to call the normal mmlcore one.

Simba Code:
[LEFT]GetTClient.IOManager.ActivateClient;
[/LEFT]



Alright problem solved. There should really be 2 activate clients. One for Smart, one for Simba. Maybe ActivateSmart; and ActivateClient; or ActivateClientSmart; ?

Edit: Also it works without the semi colon. Just ActivateClient and GetTClient.IOManager.ActivateClient

masterBB

2012-03-11 18:04:42

From: LordJashin
Alright problem solved. There should really be 2 activate clients. One for Smart, one for Simba. Maybe ActivateSmart; and ActivateClient; or ActivateClientSmart; ?

Edit: Also it works without the semi colon. Just ActivateClient and GetTClient.IOManager.ActivateClient


For some reason benland didn't want us to be able to take the focus from smart. So he overrides it with an empty procedure. I don't know what need there was for overriding it, but it probably had one. There is no ActivateSmart procedure.

Also always place a semicolon, that is important. Standards are important. Though I'm aware that it doesn't lead to unexpected behavior in most cases.

LordJashin

2012-03-11 18:15:23

From: masterBB
For some reason benland didn't want us to be able to take the focus from smart. So he overrides it with an empty procedure. I don't know what need there was for overriding it, but it probably had one. There is no ActivateSmart procedure.

Also always place a semicolon, that is important. Standards are important. Though I'm aware that it doesn't lead to unexpected behavior in most cases.


Benland, that nubadub, put that procedure in the SetupSRL; thingy if you want to stop people from overriding focus from Smart. trololol.

Is there anyway to get a client's handle? I couldn't find any way to do that.

masterBB

2012-03-11 18:23:58

From: LordJashin
Benland, that nubadub, put that procedure in the SetupSRL; thingy if you want to stop people from overriding focus from Smart. trololol.

Is there anyway to get a client's handle? I couldn't find any way to do that.


It isn't put in SetupSRL as SRL doesn't mean you use SMART.

I'm embarrassed, I don't know nor could I find it. :redface: I'm afraid there isn't a way to get the client's handle. It's a private var.

It's GetNativeWindow, but for some reason it isn't exported. Will look into it.

LordJashin

2012-03-11 18:39:44

From: masterBB
It isn't put in SetupSRL as SRL doesn't mean you use SMART.

I'm embarrassed, I don't know nor could I find it. :redface: I'm afraid there isn't a way to get the client's handle. It's a private var.

It's GetNativeWindow, but for some reason it isn't exported. Will look into it.


Just mean make it happen if Smart loads. Yeah Scar has this functionality. I really want it cuz you can fool around with canvas, and all these other things.

BenLand100

2012-03-11 21:38:23

From: LordJashin
Benland, that nubadub, put that procedure in the SetupSRL; thingy if you want to stop people from overriding focus from Smart. trololol.

Is there anyway to get a client's handle? I couldn't find any way to do that.

1) That override is a holdover from the SCAR days when sending an ActivateClient to SMART would have really messed with things (essentially, it still could. i.e. if you're using SMART you should never have to "activate"). Unless you use SMART, i.e. include it's include, it won't be overridden.
2) None of this is a bug at all, it's just you expecting features that were never intended to be there
3) There's no cross platform way to do this "getting the canvas" thing, the internals (which I wrote) in Simba are written in a cross platform way. If you want to "fool around with the canvas" you have two options. a) use native calls to the windows libs b) use scar which is windows only

LordJashin

2012-03-11 22:01:58

From: BenLand100
1) That override is a holdover from the SCAR days when sending an ActivateClient to SMART would have really messed with things (essentially, it still could. i.e. if you're using SMART you should never have to "activate"). Unless you use SMART, i.e. include it's include, it won't be overridden.
2) None of this is a bug at all, it's just you expecting features that were never intended to be there
3) There's no cross platform way to do this "getting the canvas" thing, the internals (which I wrote) in Simba are written in a cross platform way. If you want to "fool around with the canvas" you have two options. a) use native calls to the windows libs b) use scar which is windows only


So how do you get the handle of a window? With Canvas's it was fun in Scar to draw on top of clients :D. I don't know if that "leaks" or not though, that's what I want to "fool around with".
Well the FindWindow feature in Simba is the same as the one in Scar, except there's no handle returned, and that combined with ActivateClient on SCAR targets the client. Because of that I assumed ActivateClient on here would do the same thing. But instead it only is for SMART, and the iomanager one is for clients.

BenLand100

2012-03-12 23:59:18

As I said, feature does not exist. Stop pming me to respond in your threads.

LordJashin

2012-03-13 11:54:29

From: BenLand100
As I said, feature does not exist. Stop pming me to respond in your threads.


So is there a way to set the client to something else without problems? Like another game, and use findcolor etc on it.


program Rawr;
{$DEFINE SMART}
{$i SRL/srl.simba}

var
x, y, w, h: Integer;

begin
FindAndSetTarget('SRL', True);
GetTClient.IOManager.ActivateClient;
wait(500);
GetTClient.IOManager.GetDimensions(w, h);
if GetTClient.MFinder.FindColor(x, y, 332940, 0, 0, w - 1, h - 1) then
GetTClient.IOManager.MoveMouse(x, y);
wait(50000);
{
So this stuff is for any client but if i take out the class calls those would
be for smart only? I want to set the target to another game open it and find
things. This works to find the simba color in the text editor on SRL in Google chrome

:D
}
end.