SRL Archive - SRL Bugs

Minimap Fonts are a bit off.


Brandon

2012-01-20 23:28:46

I've been debugging a script of mine.. and well for the prayer detection, I use detecting by level AND by TPA of colours.. it works fine except I noticed a small bug where level detection is broke. When finding prayer, sometimes instead of detecting 360, it detects 60 only.. Also sometimes messes up on detection overall.. The prayerLevel function is detecting 384 when my prayer is at 860.. See below (Picture and script)..



Function PrayerLevel: Integer;
var
ColourString: String;
begin
//LProc:= 'PrayerLevel';
Result:= GetMMLevels('Prayer', ColourString);

//if debugs then
writeln('Prayer: ' + ToStr(Result));
end;

mormonman

2012-01-21 00:21:08

I personally use a tpa of the HP circle to detect when I should eat…you should probably do the same.

Brandon

2012-01-21 00:24:28

From: mormonman
I personally use a tpa of the HP circle to detect when I should eat…you should probably do the same.


I do this already but I'm just reporting the bug ;) See that debug box there? It's a TPA using CLRed for colouring.

Coh3n

2012-01-21 14:56:47

Hm, I doubt it's the font. It could just be where GetMMLevels is searching for the font.

Narcle

2012-01-25 18:57:21

I'm going to update this to SRL5 standards. It should be using GetTextAtExWrap (a box) not a TPoint (ewwww).

Edit:
Have a fix will see in SRL update tonight.

Heavenzeyez1

2012-01-26 00:23:08

From: Narcle
I'm going to update this to SRL5 standards. It should be using GetTextAtExWrap (a box) not a TPoint (ewwww).

Edit:
Have a fix will see in SRL update tonight.


Resting doesn't seem to work for me. It will rest @100% if it's set to rest @ 60 or less…

~Eerik.

Narcle

2012-01-26 00:28:06

Resting has always been buggy. Because it has to look for 4 different colors AND the number is constantly changing.

Edit:
Weird, think I got the box wrong keeps returning summoning level. XD

E2:
yep lol, pushing fix now

Brandon

2012-01-26 00:49:45

From: Narcle
Resting has always been buggy. Because it has to look for 4 different colors AND the number is constantly changing.

Edit:
Weird, think I got the box wrong keeps returning summoning level. XD

E2:
yep lol, pushing fix now


Hmm was just going to report the resting till I saw this.. I had it fixed :S I used the old GetMMLevels and just set the searchbox to 25-15.. instead of 30-15.. I'll await this update.

Also can u tell me what else changed in the include? A lot of functions in my script just broke :S

Edit: Nvm Got myself a link to the Github include.

Edit2: Summoning MMLevel is broke now.. At 0, it detects 100 :S and now my smart crashes like mad.. Might be something on my side.. I'll go fix/check it out and report back n see via edit.

Narcle

2012-01-26 01:25:48

From: ggzz
Hmm was just going to report the resting till I saw this.. I had it fixed :S I used the old GetMMLevels and just set the searchbox to 25-15.. instead of 30-15.. I'll await this update.

Also can u tell me what else changed in the include? A lot of functions in my script just broke :S

Edit: Nvm Got myself a link to the Github include.

Edit2: Summoning MMLevel is broke now.. At 0, it detects 100 :S and now my smart crashes like mad.. Might be something on my side.. I'll go fix/check it out and report back n see via edit.


Its all working for me correctly.

Here's new GetMMLevels if your having problems:
function GetMMLevels(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(719,27,745,43);
'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;

Heavenzeyez1

2012-01-26 07:01:34

Thank you for fixing this so quickly! :)
Much love, Narcle! <3
BTW, it has worked really well for me…
~Eerik.