SRL Archive - RS3 Help

"access violation" SRL error[Please help]


footballjds

2013-12-12 15:38:42

Hey guys, got this error:

-- TRSChooseOptions.optionsExist(): result = true
Exception in Script: Runtime error: "Access violation" at line 352, column 53 in file "C:\Simba\Includes\SRL-6\lib\interfaces\chooseoption.simba"
The following bitmaps were not freed: [Minimap Mask, SMART Debug Image, 2, Gametab Bitmap[0], Gametab Bitmap[1], Gametab Bitmap[2], Gametab Bitmap[3], Gametab Bitmap[4], Gametab Bitmap[5], Gametab Bitmap[6], Gametab Bitmap[7], Gametab Bitmap[8], Gametab Bitmap[9], Gametab Bitmap[10], Gametab Bitmap[11], Gametab Bitmap[12], Gametab Bitmap[13]]
File[C:\Simba\Includes\SRL-6/logs/SRL log (12-12-13 at 02.47.02 PM).txt] has not been freed in the script, freeing it now.

that line in chooseoption.simba is:
      // sort chars from (left..right) and then read the text
sortATPAFromFirstPointX(tmp, [b.x1, atpa[i][0].y]);

No idea why this came up. I think it is an issue with SRL and not my script, but either way. Here's the only place where I call optionsExist in my script:

function fishChoice: boolean;
var
tOptions: __TOptionArray;
options: TStringArray;
i: integer;
begin
if chooseOption.optionsExist(['Harpoon'], randomRange(1500, 3000)) then
begin
tOptions := chooseOption.__getOptions;
if not(length(tOptions) > 0)then exit;
for i := 0 to high(tOptions) do insert(tOptions[i].str, options);
options.invert;
case lowercase(players[currentPlayer].strings[1]) of
'tuna', 'swordfish': begin
for i := 0 to high(options) do
begin
if (pos('Harpoon', options[i]) > 0) then
if i > 0 then if pos('Cage', options[i-1]) then
begin
mouseBox(tOptions[i].bounds, Mouse_Left);
exit(true);
end;
end;
end;
'sharks': begin
for i := 0 to high(options) do
begin
if (pos('Harpoon', options[i]) > 0) then
if i > 0 then if pos('Net', options[i-1]) then
begin
mouseBox(tOptions[i].bounds, Mouse_Left);
exit(true);
end;
end;
end;
'random': result := chooseOption.select(['Harpoon']);
else chooseOption.close2;
end;
end else chooseOption.close2;
end;

Abu

2013-12-12 17:59:54

Confused as to why you've added randomRange(1500, 3000)?

Surely you just do this:
chooseOption.optionsExist(['Harpoon'])

The Mayor

2013-12-12 19:31:59

From: abu_jwka
Confused as to why you've added randomRange(1500, 3000)?

Surely you just do this:
chooseOption.optionsExist(['Harpoon'])



TRSChooseOption.optionsExist(options: TStringArray; matchPercent: extended): boolean;

The second parameter is the matchPercent (i.e., between 0 and 1.00) not a wait time.

Coh3n

2013-12-12 23:50:31

In Lape, "Access violation" usually means out of range, which makes sense given the "error" line. I can't look right now, but my guess would be that "atpa" has a length of 0 and it's trying to access index 0, which obviously isn't possible. That would be a good place to start.

Abu

2013-12-13 02:34:16

From: The Mayor
TRSChooseOption.optionsExist(options: TStringArray; matchPercent: extended): boolean;

The second parameter is the matchPercent (i.e., between 0 and 1.00) not a wait time.


Ya I knew dat, he didn't. I just assumed there was a default value for matchPercent so no real need to try change it.

The Mayor

2013-12-13 03:43:21

From: abu_jwka
Ya I knew dat, he didn't. I just assumed there was a default value for matchPercent so no real need to try change it.


Oh opps I was meant to quote OP :p

footballjds

2013-12-13 11:17:28

From: abu_jwka
Confused as to why you've added randomRange(1500, 3000)?

Surely you just do this:
chooseOption.optionsExist(['Harpoon'])


yes, surely I could. stupid

From: Coh3n
In Lape, "Access violation" usually means out of range, which makes sense given the "error" line. I can't look right now, but my guess would be that "atpa" has a length of 0 and it's trying to access index 0, which obviously isn't possible. That would be a good place to start.


yeah, i figured. However, it appears it is an issue with SRL as I don't directly call that.

Coh3n

2013-12-13 12:41:18

From: footballjds
yeah, i figured. However, it appears it is an issue with SRL as I don't directly call that.
Right.

Could you open a bug report please? It will remind us to look into this. Add a link to this thread in the report as well.