SRL Archive - Help and Support

Wow.. Stupid error.


JAD

2007-06-09 13:40:50

[Runtime Error] : Exception: Access violation at address 00652566 in module 'scar.exe'. Read of address 00000022 in line 148 in script C:\Program Files\*********************
Failed when compiling

The script walks from the bank to the tree, moves the mouse to the tree, tries to checks for the blue up text in the function below, and when it tries to check for it.. That's when I get this error.. Here's the function:


function IsUpRightTreeText(WhichTree: Integer): Boolean;
var Jx,Jy, I: Integer;
Tree: array[1..3] of Integer;
begin //line 146
//line 147
Tree[1] := DTMFromString('78DA63BCC5C0C03097010C58201403DBD1430' +
'C1A409A11CA677C012416A1AAE13D731A55CD3B4C7304CE9F4355' +
'730348CC4455237EE50CAA1A907B16A2AAE138761855CD074CF70' +
'85FBA0057F31F0800CD0417F6');

Tree[2] := DTMFromString('78DA63BCCDC0C0308F010C58201403D3850B0' +
'C1A409A11CA677C8EA986F9E27954356F80C40222D4CC21A0E60E' +
'909885AA86E7D62DB89AFF40000036D914B6');

Tree[3] := DTMFromString('78DA63BCCFC0C03087010C58201403F3B1A30' +
'C1A409A11CA67BC0924E6A3AA613D8EA6E62FA61A667435AF81C4' +
'4254350257CEA0AAF904241611500372CF6C54352C278EC1D5FC0' +
'70200C39917D4');
wait(100+random(100));
if(FindDTM(Tree[WhichTree],Jx,Jy,72,4,130,20))then
begin
Result := True;
Exit;
end else
begin
Result := False;
Status('Failed to find tree. Trying some more..');
end;
for I := 1 to 3 do
FreeDTM(Tree[I]);
Result := False;
end;

Any help would be greatly appreciated. And it's not a variables placement problem either because I tried making the array of integer global variable but that didn't help at all.. Still got the error when checking for the up text.

I also called for SetupSRL;, I don't have a bitmaps/DTMs procedure to call for, I called for declare players and I did everything.. In theory, this should work :)

Thanks.

Pentti

2007-06-09 13:52:10

Works in Divi, not in 2.03.

JAD

2007-06-09 15:50:45

From: Pentti
Works in Divi, not in 2.03.


Yeah I know.. Very strange. I'm not using any different kind of functions that either don't have/have now.

Anybody know why it doesn't work with scar 2.03?

Wanted

2007-06-09 16:13:11

When does the error occur because it's probably your FreeDTM…

Edit: Also shouldn't you use find DTM rotated??

JAD

2007-06-09 16:34:01

From: Icefire908
When does the error occur because it's probably your FreeDTM…

Edit: Also shouldn't you use find DTM rotated??


Never used DTMs for anything besides items in inventory.. And this DTM is just for text, so I don't think I need to use DTM rotated. Never used it though :p

And why would it occur because of my FreeDTM?? Because the way I did it with the for to do loop?

Wanted

2007-06-09 22:04:53

Well I think it might be because you're freeing a DTM that isn't loaded into memory thus causing out of range runtime errors.

rkroxpunk

2007-06-09 23:26:01

hmmm funny how people chose to help some and not others……>.< oh well I get this same type of error whenever I free my DTMs