SRL Archive - SRL Bugs

SkillCoords


Baked0420

2009-08-14 06:33:28

Since this was updated in Dev Svn I keep getting an error, I found the silly error. I kept getting:

[Runtime Error] : Out Of Range in line 322 in script C:\Program Files\Scar 3.21\includes\SRL\SRL\Core\GameTab.scar

It comes from two different lines before it, those lines are 310 and 315, you just need to change:

1) if (not InRange(Row, 1, 8)) then

2) if (not InRange(Column, 1, 3)) then

to:

1) if (not InRange(Row, 0, 7)) then

2) if (not InRange(Column, 0, 2)) then


respectively.


Remember, it's an array, it starts at 0 ;).

Evilchicken, you been updating lots, fix it now! :p


EDIT: Also, I think this is in the same file, if not sorry, but the script isn't getting the experience to go, it opens skill tab, but never goes to the skill.

EvilChicken!

2009-08-14 06:50:07

Fixed SkillCoords, thank you.

Are you using GetXP to retrieve the XP?
And, if so, for what skill(s)?

Baked0420

2009-08-14 06:55:22

yes, I am using getxp and for mining :) thanks for the quick fix, well, I already fixed the one, but it'd be cool if you can fix getxp.


EDIT: aww no fair, you give noidea credit for his fix in SVN changelog but not me, lol, I actually don't really care that much, just glad to help an annoying error.

bugger0001

2009-08-14 23:53:19

There's still an error in it…
function SkillCoords(Row, Column: Integer): TPoint;
var
RowArr: array [1..3] of Integer;
ColArr: array [1..8] of Integer;
begin
Result := Point(-1, -1);
if (not InRange(Row, 1, 8)) then
begin
srl_Warn('SkillCoords', 'Row #' + IntToStr(Row) + ' is an invalid row', warn_Warning);
Exit;
end;
if (not InRange(Column, 1, 3)) then
begin
srl_Warn('SkillCoords', 'Column #' + IntToStr(Column) + ' is an invalid column', warn_Warning);
Exit;
end;
ColArr := [577, 631, 687];
RowArr := [228, 260, 293, 324, 356, 388, 420, 419];
Result := Point(ColArr[Column], RowArr[Row]);
end;

But the beginning should be:
function SkillCoords(Row, Column: Integer): TPoint;
var
RowArr: array [1..8] of Integer;
ColArr: array [1..3] of Integer;