SRL Archive - Jr. Member General Help and Discussion

Can't get into opengl mode


The Killer

2013-09-06 18:07:42

I'v tried changing paths and deleting cache but I can't use opengl with smart 8.2, demise's includes and simba v1.00
I can use it with the browser.

Ian

2013-09-06 18:25:18

More details might be useful.

When a SMART pops up, what happens? Does it close automatically or does it load in Safemode?

If it manages to load, is there an OpenGL option? If so, does the SMART client close when you switch to it?

The Killer

2013-09-06 18:30:44

From: BMWxi
More details might be useful.

When a SMART pops up, what happens? Does it close automatically or does it load in Safemode?

If it manages to load, is there an OpenGL option? If so, does the SMART client close when you switch to it?

it manages to loads, goes to the auto setup screen. I hit autosetup and it goes to safemode with med settings. The opengl option is there btu when I click it, it says it could not enter it

Ian

2013-09-06 18:39:09

From: The Killer
it manages to loads, goes to the auto setup screen. I hit autosetup and it goes to safemode with med settings. The opengl option is there btu when I click it, it says it could not enter it


Did you make sure that you removed all of your pid files and other things?

The Killer

2013-09-06 18:41:29

From: BMWxi
Did you make sure that you removed all of your pid files and other things?


No, I removed the prefances files as instructed on the runescape offical wiki

Brandon

2013-09-06 20:46:50

Get her to update her Smart and include I guess.. With Smart 8.3, it can automatically enter OpenGL mode.. Sorta..


SmartSpawnClient(GetJavaPath(False), Replace(PluginPath, '\', '/', [rfReplaceAll]), Params[0], ',' + Params[1], Width, Height, InitSequence, '', '', Implode(',', Plugins));

GetJavaPath is a function that loads Smart using the correct Java/bin location.
The boolean is whether to use Java or Javaw (shows/hides the smart console).

The code for that function can be found here: https://github.com/Brandon-T/SRL-GLX/blob/master/Internals.simba#L207

Or just see below:

Function GetJavaPath(Console: Boolean): String;
var
Drive: String;
CurrentPath: String;
Begin
Drive := Copy(PluginPath, 0, 3);

If (FindDirectory('Program\sFiles\s\(x86\)', Drive)) Then
Begin
CurrentPath := Drive + 'Program Files (x86)\';
End Else
CurrentPath := Drive + 'Program Files\';

If (FindDirectory('Java|java', CurrentPath + '\')) Then
Begin
CurrentPath := CurrentPath + 'Java\';
End Else
Begin
Writeln('Failed To Find Path: ' + CurrentPath + 'Java\');
Exit;
End;

Drive := GetDirectoryName('jre', CurrentPath);
If (Length(Drive) > 0) Then
Begin
If (Console) Then
CurrentPath := CurrentPath + Drive + '\bin\java.exe'
Else
CurrentPath := CurrentPath + Drive + '\bin\javaw.exe';
End Else
Begin
Drive := GetDirectoryName('jdk', CurrentPath);
If (Console) Then
CurrentPath := CurrentPath + Drive + 'jre\bin\java.exe'
Else
CurrentPath := CurrentPath + Drive + 'jre\bin\javaw.exe';
End;

If (FileExists(CurrentPath)) Then
Result := CurrentPath
Else
writeln('Failed To Find Java.exe or Javaw.exe. Please add ~\JRE\Bin to your PATH environment variable.');
End;

The Killer

2013-09-07 16:19:01

From: Brandon
Get her to update her Smart and include I guess.. With Smart 8.3, it can automatically enter OpenGL mode.. Sorta..



I'm using opengl because I want accurate text grabbing from chatbox, I'm just running demise's stuff to check its working. I wouldn't want to bug her to update everything for me :S
I don't really know how to lape but it looks ok, I'll try and setup with your includes :)

DemiseScythe

2013-09-07 17:25:27

If you uninstall all the unneeded Java versions, 8.2 works fine.

Get rid of all 64bit and Jdks and it should work after deleting the preference files.

Mark

2013-09-07 17:30:36

After deleting the preference files and downloading and compiling the latest smart 8.2 and altering the smart loading function with my own jvm path it work perfect

line 46 in glx/smart.simba

  Self.__Target := SmartSpawnClient('C:/Program Files/Java/jdk1.7.0_25/jre/bin/javaw.exe', Replace(PluginPath, '\', '/', [rfReplaceAll]), Params[0], ',' + Params[1], Width, Height, InitSequence, '', '', Implode(',', Plugins));

The Killer

2013-09-07 18:25:04

From: DemiseScythe
If you uninstall all the unneeded Java versions, 8.2 works fine.

Get rid of all 64bit and Jdks and it should work after deleting the preference files.


From: CRU1Z1N
After deleting the preference files and downloading and compiling the latest smart 8.2 and altering the smart loading function with my own jvm path it work perfect

line 46 in glx/smart.simba

  Self.__Target := SmartSpawnClient('C:/Program Files/Java/jdk1.7.0_25/jre/bin/javaw.exe', Replace(PluginPath, '\', '/', [rfReplaceAll]), Params[0], ',' + Params[1], Width, Height, InitSequence, '', '', Implode(',', Plugins));


Demise may have a point I am probably on 64 bit java :S.
And thanks cru1z1n, I'll try that if demise's idea doesn't work.

DemiseScythe

2013-09-08 00:01:01

From: Brandon
Get her to update her Smart and include I guess.. With Smart 8.3, it can automatically enter OpenGL mode.. Sorta..


Edit:

Nvm, I had the Exit inside the GL_WaitOption if then loop so it wasn't Exiting the function, now it works correctly. Sorry.

The Killer

2013-09-08 13:08:47

Update: Demise's method didn't work :/
Trying to setup with @brandon@ 's stuff but I don't know what to include and what I need to put in my mainloop to get smart to spawn :/ - Thanks for all the help so far

Brandon

2013-09-08 14:51:43

From: The Killer
Update: Demise's method didn't work :/
Trying to setup with @brandon@ 's stuff but I don't know what to include and what I need to put in my mainloop to get smart to spawn :/ - Thanks for all the help so far



{$DEFINE SMART} //If using SMART v8.2 or lower then {$DEFINE SMART8API}
{$I GLX/Setup.Simba}

var
Smart: TSmart;
begin
SetupGLX(Smart, 1360, 670); //Width, Height of Smart.
end.

Should use Smart v8.3 tbh. Nothing special required. No need for path variables or anything..

The Killer

2013-09-08 15:46:23

From: Brandon

{$DEFINE SMART} //If using SMART v8.2 or lower then {$DEFINE SMART8API}
{$I GLX/Setup.Simba}

var
Smart: TSmart;
begin
SetupGLX(Smart, 1360, 670); //Width, Height of Smart.
end.

Should use Smart v8.3 tbh. Nothing special required. No need for path variables or anything..

GOT IT WORKING! Thank you soo much brandon :'), I would rep you, but I'v already repped you for the path thingy. Thanks to Demise and Cru1z1n also sending rep your way :)

Mark

2013-09-08 17:13:58

when ever i have any problems i usually uninstall everything then re-download and compile newest sources from all corresponding GIT repos.

Glad your up and running tho and thanks for the rep :D.

The Killer

2013-09-09 17:38:56

From: CRU1Z1N
when ever i have any problems i usually uninstall everything then re-download and compile newest sources from all corresponding GIT repos.

Glad your up and running tho and thanks for the rep :D.

No problem :') but I'v got MORE problems
just going to casually mention @Brandon :D
So I can't seem to grab text properlly:
I have no problems debugging it:
code so far (playing with it to try and get some results):
{$DEFINE SMART8}  //If using SMART v8.2 or lower then {$DEFINE SMART8API}
{$I GLX/Setup.Simba}

var
Smart: TSmart;
Textgl: glCharArray;
Text: TStringArray;
i, a: Integer;
begin
SetupGLX(Smart, 800, 600); //Width, Height of Smart. should change these
// GLXMapHooks(T.CurrentClient);
glDebug(GL_MODE_Fonts, 0, 7, 71, 651, 536);
Textgl := glGetChars(IntToBox(7, 71, 651, 536));
a := glGetCharSpacing(Textgl);
Text := glCharsToText(Textgl, a);
for i := Low(Text) to High(Text) do
Writeln(Text[i]);

Writeln(glCharsToTexts(glGetChars(IntToBox(7, 71, 651, 536))));

// Writeln(glGetTextures(IntToBox(7, 71, 651, 536)));
Writeln(glGetChars(IntToBox(7, 71, 651, 536)));

end.
output:
Paired with SMART[7388]

[{TEXT =
[{TEXTUREID = 16, COLOUR = 551, X = 114, Y = 1095761920, LETTER =
Successfully executed.
The following bitmaps were not freed: [0]
Thanks in advance, sorry for my noobiness, lape and opengl is completely new to me tbh and the noobiness is spread between @Sjoe and I since this is a project we're doing together :/

Sjoe

2013-09-09 17:42:25

I'm have nothing to do with this

The Killer

2013-09-09 17:44:05

From: Sjoe
I'm have nothing to do with this


Stop lying.

DemiseScythe

2013-09-09 17:48:50

What you both doing?

Also, you playing too small. Try 1350 by 670 pixels for a more playable setup.

Sjoe

2013-09-09 17:55:41

From: DemiseScythe
What you both doing?

Also, you playing too small. Try 1350 by 670 pixels for a more playable setup.


We just wanna grab the text in the chat. but debug isn't really showing any text :p

DemiseScythe

2013-09-09 18:00:52

From: Sjoe
We just wanna grab the text in the chat. but debug isn't really showing any text :p


Debug for the text is pretty much useless, just search for text and do stuff to it.

The text functions work regardless of position unlike RS2 SRL.

Type "Return to a Slayer Master." into chatbox, change x1, y1, x2, y2 to chatbox bounds and run Writeln(VTaskComplete); and it should print True meaning it found the text.

function VTaskComplete: Boolean;
var
I: Integer;
T: TStringArray;
begin
T := glCharsToText(glGetChars(IntToBox(x1, y1, x2, y2)));
for I := 1 to High(T) do
begin
if (Between('Return to a ', '.', T[I]) = 'Slayer Master') then
begin
Result := True;
Exit;
end;
end;
end;

Modify to fit what you want.

Sjoe

2013-09-09 18:02:57

From: DemiseScythe
Debug for the text is pretty much useless, just search for text and do stuff to it.

The text functions work regardless of position unlike RS2 SRL.

Type "Slayer Master" into chatbox, change x1, y1, x2, y2 to chatbox bounds and run Writeln(VTaskComplete); and it should print True meaning it found the text.

function VTaskComplete: Boolean;
var
I: Integer;
T, P: TStringArray;
begin
T := glCharsToText(glGetChars(IntToBox(x1, y1, x2, y2)));
for I := 1 to High(T) do
begin
if (Between('Return to a ', '.', T[I]) = 'Slayer Master') then
begin
Result := True;
Exit;
end;
end;
end;

Modify to fit what you want.


Aah ok, thought it wasn't working since nothing was debugging. Thx for help demise!

The Killer

2013-09-11 12:44:25

From: DemiseScythe
Debug for the text is pretty much useless, just search for text and do stuff to it.

The text functions work regardless of position unlike RS2 SRL.

Type "Return to a Slayer Master." into chatbox, change x1, y1, x2, y2 to chatbox bounds and run Writeln(VTaskComplete); and it should print True meaning it found the text.

function VTaskComplete: Boolean;
var
I: Integer;
T: TStringArray;
begin
T := glCharsToText(glGetChars(IntToBox(x1, y1, x2, y2)));
for I := 1 to High(T) do
begin
if (Between('Return to a ', '.', T[I]) = 'Slayer Master') then
begin
Result := True;
Exit;
end;
end;
end;

Modify to fit what you want.

[{TEXT = 
[{TEXTUREID = 0, COLOUR = 318, X = 211, Y = 82, LETTER =
n
a
s
P
k
p
g
c
p
a
R
M
g
7 l
l
1 x
!
d e
t
i
t
a
r
r
R
M
k
[
x
: 6 1 A
, 3 :
[
n
]
r
P
a
?
?
e
:
f
l
: 0 0 2 A
1
P
k
S
h
c
u
m
a
m
e
7 i
[ 0 ]
R
!
s
R
M
g
i
h
m
t
c
i
2
P
k
M
:
n
m
) a
f
P
k
K
?
:
o
0
R
M
e n
o
r a
k
5 ] m
R
M
g
i
d
a
y
a
P
k
K
?
:
s
t
s
o
e
o
h
g
b
?
?
?
e
0 (
(
) e
?
?
n
3 l
l
[ a
e e
e
c
s
n
2
a
v
c
R
M
g
7 o
?
?
n
r
o
t
e
t
n
y
l
e
c
[
n
]
2 R
v
?
?
n
3 c
[
n
]
y
:
n
l
o
s
R
s C
, - = s
e
h
n
P
k
P
t n
o
r a
k
5 ] m
e
1 l
-
'
_
M
' "
r
p
9
k
2 ?
_
0
'
'
4 l e
_
7
c
3 l
-
'
_
M
' "
r
p
c
e
1 l
-
'
_
M
' "
r
p
t
e
1 l
-
'
_
M
' "
r
p
G
a
: l
" '
- = $
m
s
i
.
'
M 0
.
l
p
s
a
8 m
.
M 0
.
l
b
r
t s
"
_ ,
1 3 e
m
i
-
e
- _
r
p
p
p
2
k
2 ?
_
0
'
'
4 l e
_
s
, - = s
e
n
False
Successfully executed.
The following bitmaps were not freed: [0]
:/
code:
function VTaskComplete: Boolean;
var
I: Integer;
T: TStringArray;
begin
T := glCharsToText(glGetChars(IntToBox(7, 71, 651, 536)));
for I := 1 to High(T) do
begin
Writeln(T[I]);
if (Between('Return to a ', '.', T[I]) = 'Slayer Master') then
begin
Result := True;
Writeln('Found mr master');
Exit;
end;
end;
end;

DemiseScythe

2013-09-11 20:02:40

From: The Killer
[{TEXT = 
[{TEXTUREID = 0, COLOUR = 318, X = 211, Y = 82, LETTER =
n
False
Successfully executed.
The following bitmaps were not freed: [0]
:/
code:
function VTaskComplete: Boolean;
var
I: Integer;
T: TStringArray;
begin
T := glCharsToText(glGetChars(IntToBox(7, 71, 651, 536)));
for I := 1 to High(T) do
begin
Writeln(T[I]);
if (Between('Return to a ', '.', T[I]) = 'Slayer Master') then
begin
Result := True;
Writeln('Found mr master');
Exit;
end;
end;
end;


Would help to at least get a picture of the text you are trying to recognize but as I see it, your problem is the spacing between the lines. Max spacing param is too high causing Simba to interpret say the word Cake as 4 words C, a, k, and e.

Brandon

2013-09-11 21:16:42

From: DemiseScythe
Would help to at least get a picture of the text you are trying to recognize but as I see it, your problem is the spacing between the lines. Max spacing param is too high causing Simba to interpret say the word Cake as 4 words C, a, k, and e.



What she said.

Basically:

glCharsToText(glGetChars(IntToBox(......)), HorizontalSpacing, VerticalSpacing);

Horizontal spacing determines how much tolerance there should be before considering x amount of space a space character.
Vertical spacing determines how much tolerance there should be before considering y amount of space a new line.

These have default values. This function works the exact same as SRL's GetTextAtExWrap function.

Finally, if you really really need 100% accuracy and performance is key but not being a performance freak then:


glGetCharSpacing(glCharsHere); //Can also be used to determine how much space to use for SRL's Colour OCR.

will automatically determine the horizontal spacing for you.

Mark

2013-09-12 07:33:16

From: Brandon
…


wondering if you could shine some light on this for me.

program new;
{$DEFINE SMART}
{$I GLX/Setup.Simba}

var
Smart: TSmart;
Area:TBox;

function GLIsTextEx(TB: TBox; Text: string): Boolean;
var
Found: glTextExArray;
begin
Result := False;
Found := glCharsToTextEx(glGetChars(IntToBox(TB.X1,TB.Y1,TB.X2,TB.Y2)));

Writeln(Found[0].Text[0]); //print found text

if Found[0].Text[0] = Text then
begin
Result := True;
Writeln('Found');
end else Writeln('Not Found');
end;

begin
SetupGLX(Smart, 1360, 670);
glDebug(3, 0, 0, 0, Smart.Height, Smart.Width);
Area := IntToBox(0, 0, 152, 20);//GL_ChatBounds;
GLIsTextEx(Area,'Da ');
end.

as you can see im playing about with grabbing text first thing i tried was grabbing my user name which printed nothing
i then tried to grab the subscribe button text from the top left corner only to have my username printed out instead any idea whats up is this something you know about or and error on my part?


Edit: All sorted now need to check Git more often i missed your update 2 days ago :D.