SRL Archive - OSR Help

GetMMLevels not working (RSPS)


Twinki

2013-09-24 23:56:55

Awhile ago I edited the GetMMLevels function for a RSPS, and it worked perfectly, but I quit for awhile and have now came back but my edited GetMMLevels isn't working anymore. I didn't edit much at first, only the coordinates to look for the color / HP or Prayer.

function RLGetMMLevels(LevelType: string; var ColorSign: string): Integer;
var
Colors : TIntegerArray;
Signs: TStringArray;
P: TPointArray;
I: Integer;
B: TBox;
begin;
Result := -1;
ColorSign := '';
case LowerCase(Leveltype) of
'health', 'hp', 'hitpoints', 'constitution': B := IntToBox(722,26,741,40);
'prayer', 'pray' : B := IntToBox(735,66,762,82);
'run','energy' : B := IntToBox(735,103,762,122);
'summon', 'summoning' : B := IntToBox(719,119,745,156);
else
begin;
srl_Warn('GetMMLevels', 'Invalid LevelType: ''' + LevelType + '', warn_AllVersions);
Exit;
end;
end;
Colors := [65280, 65535, 2070783, 255];
Signs := ['Green', 'Yellow', 'Orange', 'Red'];
for I := 0 to 3 do
begin
With B do
FindColorsTolerance(P, Colors[i], x1, y1, x2, y2, 30);
if Length(P) < 1 then
Continue;
Result := StrToIntDef(GetNumbers(GetTextAtExWrap(B.X1, B.Y1, B.X2, B.Y2, 0, 4, 4, Colors[i], 20, statChars)), -1);
if (Result > -1) then
begin
ColorSign := Signs[i];
Exit;
end;
end;
end;

I tried updating the coords, and it still isn't working.. I checked the colors, and it's perfect.

Twinki

2013-09-25 13:52:22

Bump…

Ian

2013-09-25 14:53:36

Maybe the font changed. Does it look different than it used to?

Twinki

2013-09-25 15:08:56

From: BMWxi
Maybe the font changed. Does it look different than it used to?

No it doesn't.. The one thing that changed that I can think of that may mess it up is the amount of HP the players get. The owner upped the HP level to 120, so the max HP we can have now is 1200.


It's exactly like it is right before the EoC update like 2 years ago for regular RS.

rj

2013-09-25 15:55:39

From: Twinki
No it doesn't.. The one thing that changed that I can think of that may mess it up is the amount of HP the players get. The owner upped the HP level to 120, so the max HP we can have now is 1200.


It's exactly like it is right before the EoC update like 2 years ago for regular RS.

Make sure it's looking for the next is the exact spot

Twinki

2013-09-25 15:57:27

From: Officer Barbrady
Make sure it's looking for the next is the exact spot

What do you mean?

rj

2013-09-25 15:59:00

From: Twinki
What do you mean?


In he function here:

 case LowerCase(Leveltype) of
'health', 'hp', 'hitpoints', 'constitution': B := IntToBox(722,26,741,40);
'prayer', 'pray' : B := IntToBox(735,66,762,82);
'run','energy' : B := IntToBox(735,103,762,122);
'summon', 'summoning' : B := IntToBox(719,119,745,156);
else
That's were it's looking for the text
so if you put pray it's looking here B := IntToBox(735,66,762,82);

Twinki

2013-09-25 16:03:48

From: Officer Barbrady
In he function here:

 case LowerCase(Leveltype) of
'health', 'hp', 'hitpoints', 'constitution': B := IntToBox(722,26,741,40);
'prayer', 'pray' : B := IntToBox(735,66,762,82);
'run','energy' : B := IntToBox(735,103,762,122);
'summon', 'summoning' : B := IntToBox(719,119,745,156);
else
That's were it's looking for the text
so if you put pray it's looking here B := IntToBox(735,66,762,82);


Yeah I Know, I changed and tried updating the coordinates but nothing :(

rj

2013-09-25 16:06:03

From: Twinki
Yeah I Know, I changed and tried updating the coordinates but nothing :(


Are you sure it's not *exactly* right? Also make sure the RSPS is in software mode not in OpenGL or DirectX (or else color grabbing won't work)

What type of results are you getting?

Twinki

2013-09-25 16:07:52

From: Officer Barbrady
Are you sure it's not *exactly* right? Also make sure the RSPS is in software mode not in OpenGL or DirectX (or else color grabbing won't work)

What type of results are you getting?


I'm getting -1, but I'm in Safe Mode. Software mode seems to lag the fuck out of my computer for some reason.

rj

2013-09-25 16:08:45

From: Twinki
I'm getting -1, but I'm in Safe Mode. Software mode seems to lag the fuck out of my computer for some reason.

What RSPS is this?

Twinki

2013-09-25 16:11:18

From: Officer Barbrady
What RSPS is this?

http://runelove.net/ I think it's a 714, not exactly sure. It's pretty much the way RS was right before EoC.

rj

2013-09-25 16:13:08

From: Twinki
http://runelove.net/ I think it's a 714, not exactly sure. It's pretty much the way RS was right before EoC.


Sec lemme run it

Edit:

@Twinki It's working fine for me with these graphic settings:



EDIT2: Don't do setupsrl, this causes a s***storm with functions on RSPS's(it will cause simba not to focus on the client). Leave that out and it will work perfectly

Twinki

2013-09-25 16:51:39

From: Officer Barbrady
Sec lemme run it

Edit:

@Twinki It's working fine for me with these graphic settings:



EDIT2: Don't do setupsrl, this causes a s***storm with functions on RSPS's(it will cause simba not to focus on the client). Leave that out and it will work perfectly


Ahhhh now it works perfectly! Thanks again Barbrady :)

rj

2013-09-25 16:57:12

From: Twinki
Ahhhh now it works perfectly! Thanks again Barbrady :)


Np, and BTW a lot of core SRL functions are working for that RSPS

Writeln(RLGetMMLevels('hp', CS));
Writeln(rs_GetUptext);
Writeln(GetChooseOptions('Options'));

I'm sure a lot more

Writeln(length(GetMinimapDots('White')));

Twinki

2013-09-25 16:59:08

From: Officer Barbrady
Np, and BTW a lot of core SRL functions are working for that RSPS

Writeln(RLGetMMLevels('hp', CS));
Writeln(rs_GetUptext);
Writeln(GetChooseOptions('Options'));

I'm sure a lot more

Writeln(length(GetMinimapDots('White')));


Yeah most SRL functions do work with it, like FFlag and all those. I'm going to try and get SPS to work soon using your guide :)

rj

2013-09-25 17:00:19

From: Twinki
Yeah most SRL functions do work with it, like FFlag and all those. I'm going to try and get SPS to work soon using your guide :)


If you get a globals error it's because a bitmap/dtm or something wasn't called that would otherwise be called with setupsrl btw