SRL Archive - Test corner

Problems finding colors in HD


Gu3st...

2010-02-13 08:43:46

I tried making a GameTab function for HD runescape so that we come one step closer to be able to use interception, but for some reason the client is all white when I try to find colors…

Running this script:
var
cCanvas : TCanvas;

begin
cCanvas := GetClientCanvas;
DisplayDebugImgWindow(764, 502);
SafeCopyCanvas(cCanvas, GetDebugCanvas, 0, 0, 764, 502, 0, 0, 764, 502);
end.

mastaraymond

2010-02-13 08:55:26

From: Zyt3x
I tried making a GameTab function for HD runescape so that we come one step closer to be able to use interception, but for some reason the client is all white when I try to find colors…

Running this script:
var
cCanvas : TCanvas;

begin
cCanvas := GetClientCanvas;
DisplayDebugImgWindow(764, 502);
SafeCopyCanvas(cCanvas, GetDebugCanvas, 0, 0, 764, 502, 0, 0, 764, 502);
end.

SCAR doesn't work with HD.. Well, you cannot target a HD window. It's hardware accelerated and thus windows doesn't render it..

Bad Boy JH

2010-02-13 09:00:08

The Script runs fine, I put in the script, selected Runescape and Hit CTRL+ALT+R and it took a pic of the client…BUT if I hit the button in Scar, then it would take a picture of whatever was directly on top of the runescape window…

mastaraymond

2010-02-13 09:04:55

Try using SMART, it might work better.

Gu3st...

2010-02-13 09:10:18

From: mastaraymond
Try using SMART, it might work better.
SMART started flickering a lot and RSReady did never result True. When the Debug Img Window popped up it was all black.. No result with SMART either :/

Sabzi

2010-02-13 11:25:36

Interestingly it works for me. I tried your script above(targeting both rs and then my whole screen(with dif dimensions)), taking bitmap with srl functions, rsready, loggedin, TabExists, GameTab. All worked well except the last as it returned false after switching to inventory.
Here my settings:

mastaraymond

2010-02-13 11:33:38

From: Sabzi
Interestingly it works for me. I tried your script above(targeting both rs and then my whole screen(with dif dimensions)), taking bitmap with srl functions, rsready, loggedin, TabExists, GameTab. All worked well except the last as it returned false after switching to inventory.
Here my settings:

Maybe it doesn't render using your video-card?

Sabzi

2010-02-13 11:40:55

From: mastaraymond
Maybe it doesn't render using your video-card?

I don't know much about these things.
I got a GeForce 9600 GT if it helps and as far as I know I haven't done anything to prevent it from rendering runescape.
It would be cool to achieve this on purpose so scar/simba would work with hd.

Gu3st...

2010-02-13 15:51:49

From: Sabzi
Interestingly it works for me. I tried your script above(targeting both rs and then my whole screen(with dif dimensions)), taking bitmap with srl functions, rsready, loggedin, TabExists, GameTab. All worked well except the last as it returned false after switching to inventory.
Here my settings:
Hmm.. Weird.. Try with these settings:
This is what's needed for interception to work

EDIT: We have the same graphics card, Sabzi :) Although I have GeForce 9600M GT, because I'm on a laptop

Sabzi

2010-02-13 16:02:33

From: Zyt3x
Hmm.. Weird.. Try with these settings:]
This is what's needed for interception to work

EDIT: We have the same graphics card, Sabzi :) Although I have GeForce 9600M GT, because I'm on a laptop


Still working fine for me :D. Seems like I will have a good time with interception + bit edited srl.
EDIT: I already tried fog on before because of interception. I have been following the threads since the beginning.

silentwolf

2010-02-14 09:02:31

Yep, I don't think this will be working in SCAR, without some pretty nasty hacks. I'm looking into making it work for Simba though.

EDIT: Sabzi, what OS are you running?

Gu3st...

2010-02-14 09:41:34

From: silentwolf
Yep, I don't think this will be working in SCAR, without some pretty nasty hacks. I'm looking into making it work for Simba though.
Then we'll make some pretty nasty hacks I think.. :/

Sabzi

2010-02-14 12:33:59

From: silentwolf
EDIT: Sabzi, what OS are you running?


Windows xp sp3.

silentwolf

2010-02-14 13:58:08

Yeah I have a feeling HD will work with SCAR on XP, but not anything newer. Works for me in XP btw.

silentwolf

2010-02-15 06:30:01

OK, try applying these settings to SCAR and see if HD works:
http://www.howtogeek.com/howto/windows-vista/easily-disable-vistas-aero-before-running-an-application-such-as-a-video-game/

If so, I will add a little function in the OGL plugin which will fix this for vista and win7 :)

Edit: I can confirm this works on my roommate's win7 computer… I ran your exact debug script and it didn't work before I changed the option and worked afterwards. Can people test on their computers too? Anyway, it seems like I have a temporary solution for you Zyt3x, so please keep developing :)

Gu3st...

2010-02-15 08:37:42

From: silentwolf
Can people test on their computers too? Anyway, it seems like I have a temporary solution for you Zyt3x, so please keep developing :)
Yeah that worked! :)
That was an easy fix for the problem, I'll continue making functions for HD now :)

EDIT:
function GetCurrentTab : Integer;
var
tP : TPoint;
C : Integer;
begin
if (not LoggedIn) then exit;

for Result := 1 to 16 do
begin
tP.X := 535 + (Result - 1) mod 8 * 30;
tP.Y := 169 + (Result - 1) div 8 * 298;
C := GetColor(tP.X, tP.Y);
if (C = 3841510) or (C = 3775974) then
Break;
end;
result := result + 20;
end;
Works for both Safe Mode and HD :)

EDIT2: So I made a script to click on objects with IDs, but it seems like it wont find certain models without the numbers showing (num5).. After I've clicked the 5 it works again…

silentwolf

2010-02-15 10:00:51

OK, I will take a look into that. Now I know that HD colour finding will work, I'm less reluctant to continue development :)

Gu3st...

2010-02-15 13:34:13

Some objects doesn't change ID when the animation changes, those I saw was the columns in the pinball random. They stayed the same with or without the 'rings' around them.
And whenever I get a random, the client changes my gametab to friends and then SCAR will paint it red (I have no idea why) Look at this picture:
I clicked num5 and the red disappeared..
And why do it paint "Interception 1.0b Current stride: 16" on the minimap? Isn't it only supposed to paint that in the upleft corner?

silentwolf

2010-02-15 14:32:20

Yup, there are loads of bugs at the moment, mainly due to laziness. Drawing text directly in OGL is not a good idea and I'll probably find a better way of doing stuff in future. ID's aren't supposed to change on anmiation, but I am thinking about implementing some sort of animation id too. But this is actually harder than it may seem.

Gu3st...

2010-02-15 14:38:22

From: silentwolf
Yup, there are loads of bugs at the moment, mainly due to laziness. Drawing text directly in OGL is not a good idea and I'll probably find a better way of doing stuff in future. ID's aren't supposed to change on anmiation, but I am thinking about implementing some sort of animation id too. But this is actually harder than it may seem.
Oh, Okay :P
Hey could you learn me how to do this stuff? I really want to learn it!

Dynamite

2010-02-15 14:40:33

From: Zyt3x
Oh, Okay :P
Hey could you learn me how to do this stuff? I really want to learn it!


+1, but I would rather him "teach" me :p

silentwolf

2010-02-15 14:46:41

Learn C: http://www.cprogramming.com/tutorial/c/lesson1.html
(Don't bother with any C++).

Learn how OpenGL works: http://nehe.gamedev.net/lesson.asp?index=01

Use openGL intercept (google it) to log all openGL calls made by runescape. Figure out how RS works from these logs. Use crusader's wrapper to intercept calls made from runescape to openGL and use knowledge gained from logs to figure out where stuff is.

This tutorial explains nicely how VBOs work, which RS extensively uses: http://www.songho.ca/opengl/gl_vbo.html

This forum has quite a bit of useful information about game hacking: http://forum.gamedeception.net, e.g. I used some code from an aimbot on there for WorldToScreen conversions.

It's actually quite complex and without any knowledge of C will take you quite some time to learn. This is not something you could learn to do in a few days I'm afraid :(

RAM

2010-02-15 20:12:31

Thanks for providing links to resources, this will help alot of people to be learned….teached..and taught (<3 Zyt3x)

Gu3st...

2010-02-16 07:05:46

From: silentwolf
Learn C: http://www.cprogramming.com/tutorial/c/lesson1.html
(Don't bother with any C++).

Learn how OpenGL works: http://nehe.gamedev.net/lesson.asp?index=01…..
I got so excited yesterday so I forgot to thank you :p
Thank you silentwolf :)