SRL Archive - Help and Support

wierd error


elementalelf

2007-09-07 23:37:31

new wierd error:
[Runtime Error] : Exception: Access violation at address 006FEDBE in module 'scar.exe'. Read of address 00000000 in line 224 in script C:\Program Files\SCAR 3.11\includes\SRL/SRL/Core/Object.scar

note: first 2 reply's are to a different problem.

after i changed findguy procedure to:

procedure findguy(uptexta,uptextb:string);
var clll: integer;
heheheheh: boolean;
begin
findobjectdeformed(lulx,luly,uptexta,uptextb,mini,MSX1,MSY1,MSX2,MSY2);
repeat
wait(300);
clll := clll + 1;
if (findnpcchattext('tinue')) or (findnpcchattext('cook')) then heheheheh := true;
until (heheheheh = true) or (clll = 10);
if (heheheheh = false)
then
begin
wait(500);
findguy(uptexta,uptextb);
end;
end;

The Claw

2007-09-08 01:24:28

its something to do with declaring variables inside functions i think..i got this error when i did Function Whatever(var x, y, MSX1, MSY1, MSX2, MSY2: Integer) and tried to use x and y as co ordinates. it was fixed when i did Whatever(var x, y: Integer; MSX1, MSY1, MSX2, MSY2: Integer). dunno why though

elementalelf

2007-09-08 02:15:22

figured out the problem, it was something to do with the standardizing software i was using.

Sumilion

2007-09-08 05:22:52

From: elementalelf
figured out the problem, it was something to do with the standardizing software i was using.


Told you you should actually do it yourself :p

elementalelf

2007-09-08 06:54:33

From: Sumilion
Told you you should actually do it yourself :p


the problem i was having previously has been solved, i do, however, have a new problem, i edited the entire first post and posted the new problem

The Claw

2007-09-08 07:13:27

have you set mini to be a bitmap? i mean, have you done mini := bitmapfromstring etc?

elementalelf

2007-09-08 07:14:36

yes.
mini := BitmapFromString2(False, 'a3201478DA6DCB310E80300C4' +
'3D12B59A5A4614C9AFAFE476A03A8626079FA830D00A60B9C3DA1' +
'A43E9682BABBE8DD9F8D943CB523B27965D7B11B62299583E1E53' +
'568CD7FECB4CAC7099EE');

The Claw

2007-09-08 07:19:15

hmm..its pretty obvious and basic, but have you made sure that when you call FindGuy the uptexta and uptextb you are using are strings? and that you havent freed the bitmap mini before trying to use it again?

elementalelf

2007-09-08 07:23:59

From: The Claw
hmm..its pretty obvious and basic, but have you made sure that when you call FindGuy the uptexta and uptextb you are using are strings? and that you havent freed the bitmap mini before trying to use it again?

thats almost insulting :P

findguy('talk', 'to');
is where i call it.
i havnt freed the bitmap at any point in the script.

The Claw

2007-09-08 08:12:25

yeah, just making sure lol. like i said, "pretty obvious and basic" :p i've read your posts, so perhaps you might have forgotten it over the years you were away. :D

could you give more info about the error? as in, when you get it, what line 224 is. it might have something to do with calling the procedure within itself, even though that should work fine. but instead of calling the procedure within itself, why not make the procedure a function and in your main loop or whatever just repeat the function until you get the desired result? cause what you have there would result in an infinite loop until you find the guy i believe.

elementalelf

2007-09-08 09:03:43

findobjectdeformed(lulx,luly,uptexta,uptextb,mini,MSX1,MSY1,MSX2,MSY2);
im pretty sure its to do with that line.

this is the line in object.scar
for times := 1 to 50 do
begin
FindDeformedBitmapToleranceIn(BMP, XT, YT, a, b, c, d, tol, 2, True, acc);
starting at 223, ending at 225

pwnaz0r

2007-09-08 14:41:44

call


SetupSRL;

first line of your mainloop or in lulsetup

Sumilion

2007-09-08 16:48:03

If im not mistaking he does so in lulsetup.

elementalelf

2007-09-09 01:09:17

as sumillion said, i do in lulsetup;
i have tried a few different things, including using bitmapfromstring(as opposed to bitmapfromstring2), and making my own findobj procedure
they both produce the same runtime error

function FindObjbmp(var cx, cy:integer; xdif, ydif: Integer; Text: string; bitmp, tolerance: Integer): Boolean;
var
a, c, i, x1, y1, x2, y2: Integer;
begin
x1 := 245;
y1 := 165;
x2 := 277;
y2 := 185;
repeat
if (not (Loggedin)) then
Break;
a := a + 1;
if (a = 1) or (a = 3) then
c := c + 1;
for i := 1 to c do
begin
if (a = 1) then
begin
x1 := x1 + 30;
x2 := x2 + 30;
end else
if (a = 2) then
begin
y1 := y1 - 20;
y2 := y2 - 20;
end else
if (a = 3) then
begin
x1 := x1 - 30;
x2 := x2 - 30;
end else
if (a = 4) then
begin
y1 := y1 + 20;
y2 := y2 + 20;
end;
if (x1 = 485) and (x2 = 517) then
x2 := x2 - 2;
if (y1 = 325) and (y2 = 345) then
y2 := y2 - 7;
if (x2 > 515) then
Break;
if (FindbitmapTolerancein(cx, cy, bitmp, x1, y1, x2, y2, tolerance)) then
begin
MMouse(cx+xdif, cy+ydif, 0, 0)
Wait(50+Random(50));
if (IsUpText(Text)) then
begin
Result := True;
Break;
end;
end;
end;
if (a = 4) then
a := 0;
until (x2 > 515) or (Result = True);
end;

pwnaz0r

2007-09-09 01:12:06


procedure lulsetup;
begin
mousespeed := 30;
lulbmp := BitmapFromString2(False, 'a67FF878DAC5CC310E00210' +
'804C02F712802A5A2FCFF490716575B5C6233D9B01B0000B40420' +
'3D68B8D2BA3349885243224BBDED4DCE19F3C2465F6E920597997' +
'26E1ECECFD8CCA79B8E8B76BEA779A7F5BFD58E1CAE454F7C0100' +
'2');
mini := BitmapFromString2(False, 'a3201478DA6DCB310E80300C4' +
'3D12B59A5A4614C9AFAFE476A03A8626079FA830D00A60B9C3DA1' +
'A43E9682BABBE8DD9F8D943CB523B27965D7B11B62299583E1E53' +
'568CD7FECB4CAC7099EE');
ggg := false;
textin := 'tutorial';
sparkle := 15000000;
end

elementalelf

2007-09-09 01:43:42

mine says:

procedure lulsetup;
begin
setupsrl;
lulbmp := BitmapFromString2(False, 'a67FF878DAC5CC310E00210' +
'804C02F712802A5A2FCFF490716575B5C6233D9B01B0000B40420' +
'3D68B8D2BA3349885243224BBDED4DCE19F3C2465F6E920597997' +
'26E1ECECFD8CCA79B8E8B76BEA779A7F5BFD58E1CAE454F7C0100' +
'2');
mini := BitmapFromString2(False, 'a3201478DA6DCB310E80300C4' +
'3D12B59A5A4614C9AFAFE476A03A8626079FA830D00A60B9C3DA1' +
'A43E9682BABBE8DD9F8D943CB523B27965D7B11B62299583E1E53' +
'568CD7FECB4CAC7099EE');
ggg := false;
textin := 'tutorial';
sparkle := 15000000;
end;

hmm…

elementalelf

2007-09-09 01:46:17

its got something to do wiht this line
note: same error occurs when i use findbitmapin rather than findbitmaptolerancein:

if (Findbitmaptolerancein(cx, cy, bitmp, x1, y1, x2, y2, tolerance)) then
begin