SRL Archive - Help and Support

Let user drive while script reads screen?


bonsai

2014-08-25 17:02:05

Is it possible to set things up so the user drives the keyboard and mouse but a script can still query the screen and display (smartImage)?

Turpinator

2014-08-25 18:20:27

From: bonsai
Is it possible to set things up so the user drives the keyboard and mouse but a script can still query the screen and display (smartImage)?


on srl-6 with SMART you can. (ogl only afaik due to a drawing bug in dx, or something) (but this might be fixed, im not sure)

oorrr. if youre not using SMART, you can look into ETL (https://villavu.com/forum/showthread.php?t=106263) its pretty neat.


soo. if you wanted to create a script that were to track xp or monitor things or something so that you might be able to 'react' quicker or something, you could do it currently in srl-6 and smart (with ogl)

Brandon

2014-08-25 21:06:03

It will not be possible in safe-mode (aka OSRS) without target selection.. at all.

Why? https://github.com/BenLand100/SMART/blob/master/src/Client.java#L357

This reminds me though.. I need to fix that for OpenGL & Direct-X.. What you're asking is already possible and it currently works but I need to disable it for consistency with OSRS/Safe-mode. It's not "supposed" to be a "feature".

What you are asking for already works at this very moment and is possible in BOTH OpenGL & Direct-X.

bonsai

2014-08-25 23:14:24

Do I do this with targeting functions?

The disable button blocks the script, doesn't it?

riwu

2014-08-26 10:01:39

From: Brandon
It will not be possible in safe-mode (aka OSRS) without target selection.. at all.

Why? https://github.com/BenLand100/SMART/blob/master/src/Client.java#L357

I think it's a great feature, no reason to disable it…
i did some minor modification to Client.java: http://paste.villavu.com/compare/XkdutJnGG2xicJcGrKNI/a9lKYXvt8rXglGe5p8WB/
Now it could draw on OSR while SMART is disabled:


Am i doing this correctly?

Brandon

2014-08-26 11:41:35

From: bonsai
Do I do this with targeting functions?

The disable button blocks the script, doesn't it?


The disable button does nothing for OpenGL or Direct-X atm.. The reason is because it still captures. The only thing it does is stop both plugins from drawing on SMART's debug. It is "supposed" to stop feeding SMART/Simba pixels but it doesn't stop for the current releases.

@riwu; that will work. It still nullifies the event-nazi and so.. SMART's mouse and other functions will stop working. However, OP only asked for capturing to work so it is more than suitable for what they are trying to do..


While it is nice to have this as a "feature", it does defeat the purpose of the "enable" button really.. I'd love to leave it as a feature but I'd like to leave SMART working how Benland100 intended it to work. Will be leaving it how it is now but it MIGHT be changed to the intended state in future releases.

It's basically like using the official RS client with just drawing enabled. At least, that's what I thought OP wanted? (Btw.. this is also already possible with both plugins)

bonsai

2014-08-26 12:10:33

From: Brandon
The disable button does nothing for OpenGL or Direct-X atm.. The reason is because it still captures. The only thing it does is stop both plugins from drawing on SMART's debug. It is "supposed" to stop feeding SMART/Simba pixels but it doesn't stop for the current releases.

@riwu; that will work. It still nullifies the event-nazi and so.. SMART's mouse and other functions will stop working. However, OP only asked for capturing to work so it is more than suitable for what they are trying to do..


While it is nice to have this as a "feature", it does defeat the purpose of the "enable" button really.. I'd love to leave it as a feature but I'd like to leave SMART working how Benland100 intended it to work. Will be leaving it how it is now but it MIGHT be changed to the intended state in future releases.

It's basically like using the official RS client with just drawing enabled. At least, that's what I thought OP wanted? (Btw.. this is also already possible with both plugins)


I wanted to be able to capture and paint a HUD or overlay on the smart window while the user was playing the game.

With the button enabled, I can't control the mouse/keyboard. With it disabled, I can't paint. Correct?

I feel like I'm being dense about something here.

Turpinator

2014-08-26 13:12:57

currently, for rs3 in ogl/dx, the button enabled blocks your mouse/keyboard and paints. with the button disabled it allows keyboard/mouse and still paints. though, this painting while disabled was not the original intent.

i like it where mouse and paint are separate… then you can do overlays/etc.

bonsai

2014-08-26 16:55:19

Yeah, I don't know why I was so sure it didn't work. I thought that disable button broke everything.

Anyway, thanks for the patience. Now I can play runescape in black and white! :spot:

program bwRunescape;
{$DEFINE SMART}
{$include_once srl-6/srl.simba}
var
orig, copy, bw, bwcopy, w, h: integer;

begin
smartPlugins := ['d3d9.dll'];
smartEnableDrawing := true;
SetupSRL();
getclientdimensions(w, h);
while (true) do
begin
orig := bitmapfromclient(0, 0, w-1, h-1);
copy := copybitmap(orig);
bw := greyscalebitmap(copy);
smartImage.drawbitmap(bw, point(0, 0));
freebitmaps([orig, copy, bw]);
end;
end.

Enslaved

2014-08-28 20:03:00

From: bonsai
Yeah, I don't know why I was so sure it didn't work. I thought that disable button broke everything.

Anyway, thanks for the patience. Now I can play runescape in black and white! :spot:



Display options -> Saturation = 0 -> No lag

Turpinator

2014-08-28 22:16:20

From: bonsai
Yeah, I don't know why I was so sure it didn't work. I thought that disable button broke everything.

Anyway, thanks for the patience. Now I can play runescape in black and white! :spot:

program bwRunescape;
{$DEFINE SMART}
{$include_once srl-6/srl.simba}
var
orig, copy, bw, bwcopy, w, h: integer;

begin
smartPlugins := ['d3d9.dll'];
smartEnableDrawing := true;
SetupSRL();
getclientdimensions(w, h);
while (true) do
begin
orig := bitmapfromclient(0, 0, w-1, h-1);
copy := copybitmap(orig);
bw := greyscalebitmap(copy);
smartImage.drawbitmap(bw, point(0, 0));
freebitmaps([orig, copy, bw]);
end;
end.


neat. should add this line before the loop starts.
  SmartSetEnabled(__smartCurrentTarget, false);