PDA

View Full Version : HOW TO: OpenGL without SMART



Clarity
05-12-2016, 07:27 PM
Hi all, here's a quick step-by-step on using ogLib/OpenGL scripts without SMART. Since using SMART was assumed by ogLib and Oria is on the way, for now I'm not officially adding this into ogLib. You can do it simply with these few steps.

1. Place OpenGL32.dll inside C:\Users\<YourUsername>\jagexcache\jagexlauncher\bin\ - if your RS cache location is different, adapt accordingly.

https://i.gyazo.com/2c79e11f41c25516de22f410215be08c.png

2. Place this function into your script:


function getRuneScapeClient(): integer;
var
t: tSysProcArr;
i: integer;
begin
t := getProcesses();
for i := high(t) downto 0 do
begin
if (t[i].title = 'RuneScape') then
begin
exit(t[i].PID);
end;
end;
end;


Make sure you don't have any other folders or programs opened also titled 'RuneScape' or this function may not work.

3. Remove ogl.setup() from your script and replace it with something like:


var
w, h: integer;
{...}
GLXMapHooks(getRuneScapeClient());
ogl.getClientDimensions(w, h);
GLXViewPort(w, h, w, h);
activateClient();
{...}


Since you will be removing ogl.setup(), you will need to set OGL setting values yourself.

4. Select the RuneScape game as your target with the Simba crosshairs, NOT including the title bar.

Result:

https://i.gyazo.com/d2956a499f9b218c1688785d066242cc.png

Enjoy an extra layer of avoiding detection (perhaps)!

acow
05-12-2016, 08:15 PM
thanks for this. just a shame http://i.imgur.com/ElhlsLQ.png :(

Lucidity
05-12-2016, 08:26 PM
Nice tutorial :p now just one for nxt!

Le Jingle
05-13-2016, 04:42 AM
I admire tutorial, very easy to find this info (as opposed to search 'Brandon' profile posts).

also, OP -> @ogLib/Oria, might I suggest effort instead to further Brandon's work? In turn benefits your work too : )

keep on keepin on good work! :thumbsup:

Obscurity
05-13-2016, 05:24 PM
Relying on window title irks me... So this happened.

function GetProccessID(ImageName : string) : TIntegerArray;
const Validation := [
'[\\/:\*\?"<>\|]', { Forbidden characters }
'^(nul|prn|con|lpt[0-9]|com[0-9])(\.|$)', { Forbidden names }
'^\.' { Cannot start with dot }
];
var
Index,
Results : Integer;
Output : TStringArray;
Process : TProcess;
begin
for Index to High(Validation) do
if ExecRegExpr(Validation[Index], ImageName) then
Exit();
Process.Init(nil);
try
Process.SetCommandLine('TASKLIST /FI "IMAGENAME EQ ' + ImageName + '.EXE" /FO LIST');
Process.SetOptions([poUsePipes, poNoConsole]);
Process.Execute();
Output := Explode(#13#10, Trim(Process.GetOutput().ReadAnsiString()));
finally
Process.Free();
end;
SetLength(Result, Length(Output));
for Index := 0 to High(Output) do
if ExecRegExpr('PID:\s*(\d+)', Output[Index]) then
begin
Result[Results] := StrToIntDef(ReplaceRegExpr('PID:\s*(\d+)', Output[Index], '$1', True), -1);
Results += 1;
end;
SetLength(Result, Results);
end;

function TInputPipeStream.ReadAnsiString() : string; override;
var
Buffer : string;
Count : Integer;
Index : Integer;
begin
repeat
SetLength(Buffer, 1024);
Count := Self.Read(Buffer[1], 1024);
if Count <> 0 then
begin
SetLength(Buffer, Count);
Result := Result + Buffer;
end;
until Count = 0;
end;

(*
Credit to Andrew D. for validation
http://stackoverflow.com/questions/11100821#answer-11101624
*)



Example use...
function GetRuneScapeClient(): Integer;
var Processes: TIntegerArray;
begin
Processes := GetProcessID('JagexLauncher');
if Length(Processes) then
Exit(Processes[0]);
end;


Or, since we're assuming they have ogLib...
GLXMapHooks(GetProcessID('JagexLauncher').First()) ;

MasterXehanort
03-08-2017, 08:41 AM
Trying to pair openGL with the NXT client right now. Using:

function getRuneScapeClient(): integer;
var
t: tSysProcArr;
i: integer;
begin
t := getProcesses();
for i := high(t) downto 0 do
begin
if (t[i].title = 'RuneScape') then
begin
exit(t[i].PID);
end;
end;
end;

{...}

begin
clearDebug();
GLXMapHooks(getRuneScapeClient());
ogl.getClientDimensions(w, h);
GLXViewPort(w, h, w, h);
activateClient();
//ogl.setup([800, 600], [0, 0, 576, 388]);
repeat
//mainLoop();
writeLn(intToStr(w)); //DEBUG
writeLn(intToStr(h)); //DEBUG
until false;
end.



I've moved the .dll file to the Jagex cache file. Though I keep getting values of 0 for w and h. I manually open the client and pair it to Simba with the green crosshairs. Any help would be greatly appreciated. Thank You @Clarity and @Obscurity & @Clarity.

Lucidity
03-08-2017, 10:04 AM
Trying to pair openGL with the NXT client right now. Using:

function getRuneScapeClient(): integer;
var
t: tSysProcArr;
i: integer;
begin
t := getProcesses();
for i := high(t) downto 0 do
begin
if (t[i].title = 'RuneScape') then
begin
exit(t[i].PID);
end;
end;
end;

{...}

begin
clearDebug();
GLXMapHooks(getRuneScapeClient());
ogl.getClientDimensions(w, h);
GLXViewPort(w, h, w, h);
activateClient();
//ogl.setup([800, 600], [0, 0, 576, 388]);
repeat
//mainLoop();
writeLn(intToStr(w)); //DEBUG
writeLn(intToStr(h)); //DEBUG
until false;
end.



I've moved the .dll file to the Jagex cache file. Though I keep getting values of 0 for w and h. I manually open the client and pair it to Simba with the green crosshairs. Any help would be greatly appreciated. Thank You @Clarity and @Obscurity & @Clarity.

This is because there's a new DLL for nxt on opengl and obscurity hasn't released it. Probably won't ever.

MasterXehanort
03-08-2017, 02:26 PM
@Lucidity A single tear drop just fell from my eye. Thank you for the heads up. I was looking into Oria, but wasn't sure if that was what I was looking for.

the bank
03-11-2017, 11:08 PM
This is because there's a new DLL for nxt on opengl and obscurity hasn't released it. Probably won't ever.

I believe Brandon; was working on something as well.

MasterXehanort
04-15-2017, 02:52 AM
Hey everyone, so I've downloaded the old official java client to run my OGL scripts with. I've moved the .dll files to my Jagex Cache successfully, and select the RuneScape client without the title. When I run the script, everything compiles and the model numbers line up perfectly on the mainscreen with the actual models. However, the main loop does not execute. When in SMART, the script runs perfectly fine. Trying to debug the width and height of the client properly returns 800 and 600 respectively. I'm thinking I messed up something in the GLXViewPort function.


var
w, h, zero: integer;

{. . .
SCRIPT
. . .}

begin
clearDebug();
//ogl.setup([800, 600], [0, 0, 576, 388]);

zero := 0;
GLXMapHooks(getRuneScapeClient()); //Get the process ID for the RuneScape Client
getClientDimensions(w, h); //Get the client dimensions
writeLn(intToStr(w)); //Debug to output client width
writeLn(intToStr(h)); //Debug to output client height
GLXViewPort(zero, zero, zero+576, zero+388); //Setup the viewport to match the values in original ogl.setup
activateClient();

ogl.setDebugMode('models');
//ogl.setDebugMode('none');
//ogl.setDebugMode('textures');
//ogl.setDebugMode('fonts');

setModels();

repeat
mainLoop;
until false;
end.