SRL Archive - Help and Support

A Runtime Error I get


w4ffl3z

2006-07-02 15:28:37

This is not an SRL error before I start. Sorry if this is not the right section. I have a script that runs for quite awhile. It runs majorily off of bitmaps.

[Runtime Error] : Exception: Can't create compatible DC in line 61 in script

That is the error I get. The error is always on the line of one of my declared bitmaps. If anyone can help me with this error so my script will work 24.7 it would be much appreciated because it seems to work for around 15-25 mins then it gets this error. Thanks in advance,

-w4ffl3z

WhiteShadow

2006-07-02 18:01:48

From: w4ffl3z
This is not an SRL error before I start. Sorry if this is not the right section. I have a script that runs for quite awhile. It runs majorily off of bitmaps.

[Runtime Error] : Exception: Can't create compatible DC in line 61 in script

That is the error I get. The error is always on the line of one of my declared bitmaps. If anyone can help me with this error so my script will work 24.7 it would be much appreciated because it seems to work for around 15-25 mins then it gets this error. Thanks in advance,

-w4ffl3z


Maybe your are declaring your bitmap incorrectly.

make sure to have it something like this

[PHP]program Name;
{.include SRL\SRL.Scar}

var
BmpName : Integer;

procedure Example;//declare this in mainloop so it is loaded.
begin
BmpName:= BitmapFromString(12, 11, 'z78DA73731B05A36014A0030081C1' +
'D891');//random bitmap
end;
//usage examples
procedure Usage;//if found then moves mouse there
begin
if(FindBitmap(BmpName, x, y))then
MMouse(x, y);
end;

procedure Usage2; //repeats movemouse until find bmp or it has been 30 secs.
var
Mark1 : Integer;
begin
MarkTime(Mark1);//<–starts a counting
repeat
MMouse(random(500), random(500), 6, 6);
until(FindBitmap(BmpName, x, y)) or (TimeFromMark(Mark1) > 30000)
end;

begin
SetUpSRL;
Example;
Usage;
Usage1;
end.

[/PHP]

Bego

2006-07-02 18:01:53

May I see your script? I have never heard of that error before but maybe its an obvious thing with your script.

w4ffl3z

2006-07-02 19:13:01

Here it is. It is for a game called Adventure Quest. Sorry for the "uglyness" of the script but I was just trying to get used to the use of bitmaps. Thanks again.

-w4ffl3z

WhiteShadow

2006-07-02 19:20:56

From: w4ffl3z
Here it is. It is for a game called Adventure Quest. Sorry for the "uglyness" of the script but I was just trying to get used to the use of bitmaps. Thanks again.

-w4ffl3z


Try making an alot smaller exitbmp

Also

[PHP]begin
repeat
wait(1300)
DeclareBMPS;
FindBMPS;
until(false)
end.[/PHP]

to:

[PHP]begin
DeclareBMPs;
repeat
Wait(1300 + random(500));
FIndBmps;
until(False)
end.[/PHP]

only need to declare once. Not sure of the runtimes though, make these changes and it might just disapear. (:

Cruel

2006-07-02 19:23:53

Probably a result of your memory leak due to you creating the same bitmaps every loop.
Try changing the end of the script to this:
begin
DeclareBMPS;
repeat
wait(1300)
FindBMPS;
until(false)
end.

w4ffl3z

2006-07-02 19:56:18

Thank you both, I am testing it now.

-w4ffl3z

w4ffl3z

2006-07-02 21:26:26

It does infact work much better. Thank you Cruel and WhiteShadow. Now one last thing, I was wondering about how to make the progress report say how long my script has worked for. If anyone can help me with this it would be much appreciated.

EDIT: After reviewing the SRL manuel I have solved it. Thanks Again to All who helped!

-w4ffl3z