SRL Archive - SRL Site Discussion

[Runtime Error] : Exception: Can't create compatible DC in line 30 in script C:\Progr


noidea

2008-03-28 20:51:20

[Runtime Error] : Exception: Can't create compatible DC in line 30 in script C:\Program Files\SCAR 3.13\Scripts\teleporter.scar

Umm… I was just wondering what this meant. I always get this error into about 40 minutes of autoing from a home-made script. I have know idea what it means and I would Very much so like to know what this means and how I can fix it.
Thank you,


Noidea

PriSoner

2008-03-28 22:10:07

please post the script so we can see whats appenin…

Putnam

2008-03-29 00:43:45

get scar 3.15. You have 3.13

hope that helps

Bobarkinator

2008-03-29 02:41:02

Just so you know, wrong section, and we need to see the script

mixster

2008-03-29 07:22:57

If you're using SMART, you may have it inside the main repeat loop so it runs it more than once which could give a problem when it tries to start up SMART, but it fails so when it tries to set the DC to SMARTs it fails as there is no SMART window. Another solution is that you could be setting the DC to a bitmap to do colour finding and forgetting to setup the bitmap first, so it tries to set the DC to a non-existent bitmap. Just a note: both of these could be wrong, but this is the best I can do with no script.

noidea

2008-03-29 13:43:18

Thank you for posting, sorry that I forgot to post this script. Here it is. Also, I did use many BitMaps. I could not get the error center post working for some reason (Would not let me post). Sorry for being in the wrong section.




program New;
{.include SRL/SRL.scar}
var
CloseWindow1: Integer;
Username1: Integer;
Existing1: Integer;
Dareeyak_tele1: Integer;
Tab1: Integer;
x,y: integer;
Tab2: Integer;
Public1: Integer;
Private1: Integer;
Trade1: Integer;


const
Merlin1=8147213;
Merlin2=8607245;
Merlin3=4927753;
Merlin4=9789969;
Merlin5=9329937;

Procedure Tele;
begin
Dareeyak_tele1 := BitmapFromString(14, 14, 'beNrzdRIV0s/lrMeK4FIMDIwhX' +
'tZwrgW7IxzBVUJkgSqBCK7s/79/EBEgwqoYogzIQFaJphhuGkQKTS' +
'VcMRkqibcd2UdwhNVHxIcS8SGPrBdZDbIyuEq4FDJCUwZE8GjCRMj' +
'KwnydIIrR1COrgaoEABSghfs=');

If(FindBitmap(Dareeyak_tele1,x,y))Then
begin
Wait(100);
MoveMouse(x,y);
ClickMouse(x,y,true);
Wait(300)
end else
end;

Procedure Ancient;
begin
Tab1 := BitmapFromString(18, 7, 'beNoLcVVSlAMiPS0VCyNNIENBWhS' +
'I4IIQBJQCIicrfW8nUyAK8bKBi0NUwhGyeogWCALqSgpxhQji0oKs' +
'GG4RRBeae9BcBdECVAxBQC1ARKQWoEo0XXjUw22BKIYjeACieRzNI' +
'ygIALxHT6Q=');
If(FindBitmap(Tab1,x,y))Then
begin
Wait(300)
MoveMouse(x,y)
ClickMouse(x,y,true)
Wait(500)
end else
end;


Procedure Login;
begin
Username1 := BitmapFromString(37, 16, 'beNqFlM1qw0AMhPeZWgg' +
'lhiYUH9JC20tOef/3cNQMDB+jdbPoIMbrGf2stKyXr+vH+kMrhPb9' +
'ewuk7ryfPo/LKiufpq+2unB4O7+8LmXldH5z2kwutkAIWot3pCU5k' +
'W+P0+VIK6d+KYukoj6RPk1fJTfGcLKOlgzSmvL3BB1SyDk7y/GXqU' +
'VSUWf+GNUQueWiayy+OYW4MiYXCeX4SKZyUfwNh00M3E0cj2NCn1J' +
'kNSzHB2ywjiOf4ioXo7KQ7yhZvkxmFyk/9RlG5dJDEh5ynAWCU39P' +
'uoowlfaz73Lxfp7K7WVHadGagUcdJKLKMBJ+qr5MJYh77spGOx1nZ' +
'6Mvmg5ek6+RkV+OlrD2sJ3/V+j0OWnneD1q1hSDnTJJdNvb1S5UDA' +
'XnndPtrSLbU+lyHOfeUwpxaxn/c+4GWq8M');
If(FindBitmap(Username1,x,y))Then
begin
MoveMouse(x,y)
Wait(400)
ClickMouse(x,y,true)
Wait(400)
end else
end;

Procedure FindMerlin;
begin
if/////
Findcolor(x,y,Merlin1,201,113,327,220)
or
Findcolor(x,y,Merlin2,201,113,327,220)
or
Findcolor(x,y,Merlin3,201,113,327,220)
or
Findcolor(x,y,Merlin4,201,113,327,220)
or
Findcolor(x,y,Merlin5,201,113,327,220)then

WriteLn('Found Random Event, Taking Care of It.');
Wait(250);
MoveMouse(x,y);
Wait(200);
ClickMouse(x,y,true);
end;





Procedure Existing;
begin
Existing1 := BitmapFromString(94, 15, 'beNqNl81KBzEMxH0' +
'dvQgKIv5BRTyooF5Ewavv/wwaGBjHX9Jdl7B0s/3KdDJtzw/Pr5+w' +
'h6e3u/sXWZVhcrqC7frmsSwbogL60UDouXq4OtzL1KHNQ8iqwsXl7' +
'dn5oawKbjVaVXDltJVfNsKS80HgjmJEIP92VFHZOHig9KQzJ+A6GW' +
'DikPB2iKr+8clpWYKAz47Md3sSHE+ysyWXeOQDkEkEcllBldVYZZq' +
'eQ/YnYMEnGDICsoHM0d/HgYsGSLeRYDZ1CDp1tAXL2EOnjSbjqSYy' +
'/tzNLEPU+WO/IgUyI/l7vqy4ZBjdofPO0Y0GhJFo2dA9y79CpmvRh' +
'rB0zjjSHE6xdHkBjFYngKlCQp1DpFA4fHnqjcRJ0BzdChlo0f9xWG' +
'WTgkqFqc/3j68yf7qC11TpliBkczgdr1p53f0okKRE1zrojKEYgfJ' +
'jfDCc1iKdiYzCL+s6A3/+9WQSMQhUTtiSlcFmn54tWkFpO2fw2QfF' +
'QmS3IipCk+xUn6MCOyOEDEADgZVfIAwQgyb3EEY/pDUPIfaLDxuc6' +
'dKU9YFYarJhceKkLHTOmNVApt4ZI5DpWAG33XLqDKDo1ZzpCQ5SrH' +
'MJu/mIjJUntxjghn1nO/bdv7ucgTx6aZCV0OoVN8yQ1RDatTdOetA' +
'QTwbbwbgcUHVk0wqZ1frmsU05NY67wY3+K2V5gzOyo/Y4TRSp1dWM' +
'zXLKr3mSTuxo3e+zHPQHu7mWu6wr7cq5Wx+XjvGmk9co3KpWN8F6Z' +
'zU3zML2NWo8+vYF1c6eBRzkutMwjkdieHDS6wc5AAK4xrNxb7jqan' +
'W/yJ0F2YcDre9ZODTmAa9fpXcvDr+VfwDdIDdF');
If(FindBitmap(Existing1,x,y))Then
begin
MoveMouse(x,y)
Wait(400)
ClickMouse(x,y,true)
Wait(400)
end else
end;


Procedure Wait1;
Begin
Wait(3000);
end;

Procedure Wait3;
begin
Wait(1500)
end;

Procedure CloseWindow2;
begin
CloseWindow1 := BitmapFromString(45, 4, 'beNpjYICAA2CEDA5gCGKqgYsTI0' +
'LQCjwMBrKkqMVgwBEU+EODFs4gKIWp7AA2vxDFAABusClB');
If(FindBitmap(CloseWindow1,x,y))Then
begin
MoveMouse(x,y)
Wait(400)
ClickMouse(x,y,True)
Wait(500)
end else
end;

Procedure Public2;
begin
Public1 := BitmapFromString(66, 26, 'beNq9lr1KBEEQhD' +
'dTEwPBREFUNFBQQRBEjAQTTe8JTHwEH//ss7Qsq2dm59bVoTnmen6' +
'2vunu2b27ujw/uTjda9jx0UHY7s622tbmxrrGhVwOz+H+LiyU0G6v' +
'z8LUAzHq0aGHu6seiz2nIUCn6cfT43ComcrNjKg2gSKXX62IgF9Yz' +
'MnPhbNhxWOkxXKikY6mnjwaRnmxz/DRoEcRzDDTom/ObG2Q0eWZ1y' +
'hg2IdxMQqNSPGJ/TKK56zLa7FAmDDTQpYprJ+zq01RPKtGMkyIRaZ' +
'4friBYRSd+GVfMdlB05xXGexwZlGMDmF5npx3UA9jtHi6D4NgNCIQ' +
'LZRr3yrI6kKFgQgt57YO8ViwbZ5mvGgMx8viESA6qmiZyHJPKQynl' +
'iScbB7dgduy5W2ZV0EBEIxCP02dmnK1ABVx7DYzndmjOyA6iEXjcE' +
'ARhlH+zWhGUQtQxqnd1T0U5pxAQT9agIBIo4wiKlJoPlCtvp44pKt' +
'qO6j4fAmo4CIF/FovwGFDUOLpLBa9pTktfwzYkK3KO2gp2Y1RlN0w' +
'rRre0gQpvl/0S2DUivuMfs+sS5FBMk6NqEf5v1FkFgvNECm8HGqCi' +
'Wmd9lHY96dRvL0uRm2tuIR+lLyCZHk15W2QWlB6KBogFo5QjtpnUD' +
'rVwmq5OppdnRSjRKTQVz/+dsqm8lqi1limUTRYlEKhPtPso15UW9b' +
'coNBsNJbJFEUWyM6hoX7Ui+nUaBYTtVEvs1AYCyksNMPy+72p8eq5' +
'CQmVb/V5KchSpDC/zZlwq1tE5qWAhUiq5VfNvBT57pqdAiCK8HuK9' +
'sfPH1GsQAaX+iPT1qfICOisYvEOzP7QRA==');

If(FindBitmap(Public1,x,y))Then
begin
MoveMouse(x,y);
Wait(400)
ClickMouse(x,y,True);
Wait(200);
ClickMouse(x,y,true);
Wait(500);
end else
end;

Procedure Private2;
begin

Private1 := BitmapFromString(55, 23, 'beNqtl0FOxDAMRX' +
'OJWY2EALGBBUhISAixGokNbHsCNhyB4xdP//D5fLduaYmsyElT58V' +
'2XHW/Ozzd9X0fvcrj/XXI7c3VlMQrrbVQLi/OimWzrxcSlkOw8u3w' +
'EFShGG3oQA3pv5vuMjtjVPoUW+f1XAZCQEYLSPRQQAtIkgdnG5rtg' +
'oZh9LZGt+bTaDw1JtVmNkJPUoFOlyowG6k0XhwCwEKpTxkaBYaiIb' +
'ONMiQOAkJi84Bm2cJEt5PHMPKM2lRPKmT3+kwlhNFXSMuBvK9G33g' +
'KSNxQs2nOH4XUIXwLTo2ChoZ1QNdoibCEwQztqG5GFPi9ewmJGSjg' +
'NEg4lo0VQP3GISe1oOlTvqt2AMkbyisJAZsKOEMJNkO1cpo9tkSmr' +
'DEouUpnSHIyS7WvgWfZqI8SqsxCZlQCn6IfKdO3wkt2Fh0Wx5yC/P' +
'zoQhZykhB5q5w1WyEKqbVUaQFZoBonCQlcAFiGYCYn0mzoFbJGRd+' +
'GiqjMuRQQQBUd5rTPXq0hwTlKW0CePDzkqiFlqqlUn0IdhSwcC6qf' +
'iiqQmquGYcWtvpV6xcA5C2mohNQhaVVXpLqGkHmq0C2EJGoNOXqQJ' +
'WLpsQUSEgwE5if1XyBz9FdDglMJt0OOfuko6yCPnM1JfqXBNkgtZf' +
'AkCs5fZQXDwkuUPwqrPbkizXQSut0UZOD5fgeJH7Gj8gUqR56n');

If(FindBitmap(Private1,x,y))Then
begin
MoveMouse(x,y)
Wait(400)
ClickMouse(x,y,True)
Wait(200)
ClickMouse(x,y,true)
Wait(500)
end else
end;

Procedure Trade2;
begin
Trade1:= BitmapFromString(71, 20, 'beNq9lr1KQ0EQhW' +
'+nNhZCKiEYsdFCQRBErAI22uYJbHwEH/865iQfx9mfXJLgMlzmjuN' +
'mvz2zs3cxX748hH0sn+TIxnEchoHX58fbZPd3N8oJ5x/sejHHWr97' +
'dnqCBY7buB2C8ohDxWvM45OT1okQxEm71MonKCiN8FMOUOGv3l9l4' +
'QdFLFVQIgq0YT3kA5WIxKiRIiyJoDtMGE/ywUyToFTrh2YX52HKEV' +
'E8YXGnrEmgnFErYf0k8FeCKeJONd8nLPcz5QD1uXqDToBAMSSZiOR' +
'7NfqrL7u68o6TkL38HKqsPXL6UDgM9ZOyjThCUod8gp1IOKWOXmwt' +
'pRhxoK4uZ0CJyxsFgAyaiUNRkH72U6SF4E7KZ3NaLahsJuoVASVAQ' +
'YU5tSI6aC6Wmkm6BegnCOQRz6k6acO9kkuxCNISPSfKD5yO0R7DvP' +
'+XFxwFWQar5lfJzptxpykzxJoCVUXTk4X115wSPNIq6T5RCtI3dAt' +
'/f62w6VBJtSFWNP4pSOd1WVtGv3UuNn+iUsoPQIdKNlGvwNmcuy1X' +
'ueZSOIyp1JpK0fcoxQ7UFDSIkKylRdqKjl9W7NGhOmUpKJp/enWcE' +
'q1jVZVbB63KOAWqAygKtANqo+D6rFVXzr9UD2x5DCc2kP2gEhpQ/u' +
'o4OmsJod+OSHaV/fpoCXQgFGg9qO0NnnKmXx+pdAXFl1hHr0Ogwqp' +
'QCWRvqGpBlnV4dChxoZo+tA6Han3JJCivQ3cOh9roZUTHhaoWYesK' +
'+718fwBugxlj');

If(FindBitmap(Trade1,x,y))Then
begin
MoveMouse(x,y)
Wait(400)
ClickMouse(x,y,True)
Wait(200)
ClickMouse(x,y,true)
Wait(500)
end else
end;

Procedure TurnChat;
begin
Public2;
Private2;
Trade2;
end;

Procedure ProgressReport;
begin
writeln('');
writeln('*******************************');
writeln('*******This is the report******');
writeln('******Your account(#@&*$)******');
writeln('*****Worked for '+ (TimeRunning)+' ****');
writeln('*********End of report*********');
writeln('*******************************');
end;

/////////////////////////////
////This is the main line////
/////////////////////////////

begin
Wait1;
repeat
Wait3;
TurnChat;
Ancient;
Tele;
Tele;
Tele;
Tele;
FindMerlin;
Tele;
Tele;
Tele;
Tele;
Tele;
Tele;
Tele;
FindMerlin;
Tele;
Tele;
Existing;
Login;
CloseWindow2;
Tele;
Tele;
FindMerlin;
ProgressReport;
until(false)
End.

mixster

2008-03-29 13:56:30

Always use Scar tags [*scar] to open and [*/scar] to close (with out the *'s)
Also, it compiles fine for me and as line 30 is a Bitmap search, then it may be that your Scar was just open for a while, so was being a bit evil. Try running it again or closing and re-opening Scar and running it then.

noidea

2008-03-29 14:03:25

Ok, thanks for your suggestion I will try it, and what do you mean by this?

Always use Scar tags [*scar] to open and [*/scar] to close (with out the *'s)

thanks

mixster

2008-03-29 14:06:46

When you post script from scar, you're supposed to use scar tags so the script is easier to read, like so:

program HelloWorld;
begin
WriteLn('Hello world, this is my test script!');
end;
As you can see it, it looks similar to how it would in Scar which makes it a lot easier to read through and debug. Now, to put script into the funny little box thing, you have to put a tag around them. The scar tag is [*scar] without the * because if I put it normally, then it opens it, so I just put it like that so you can see it. Alternatively, as long as you aren't in fast reply, you can press the Scar tag button which is the little bulldozer.

noidea

2008-03-29 14:12:49

OK, thanks I see what you are are talking about and it is a will do in future.

thanks

noidea

2008-03-29 15:01:33

Closing down Down SCAR and reloading the script did not work. Once again it made complete stop after about 40 minutes. The only difference was that instead of the problem being in line 30, it was in line 66. Same exact problem. [Runtime Error] : Exception: Can't create compatible DC in line 66 in script C:\Program Files\SCAR 3.13\Scripts\teleporter.scar

mixster

2008-03-29 15:20:39

Just realised something and i can't believe I missed it earlier. Add FreeBitmap after you do the bitmap searching for all of your bitmaps. The problem is you're not freeing them, thus creating a memory leak. Also, if you're including SRL, you might as well use Mouse (I'm assuming this isn't for RS due to the fact that you have a custom login procedure that doesn't relate to RS) as you must have around half your script with MoveMouse() Wait() ClickMouse(), so you can shorten it a lot by just using Mouse as it has built in moving and no need to wait before clicking.

noidea

2008-03-29 15:25:19

OK, can you give me an example of freeing the BitMap please, I am having a bit of trouble understanding how to.

thanks

mixster

2008-03-29 15:29:05

Change

Procedure Tele;
begin
Dareeyak_tele1 := BitmapFromString(14, 14, 'beNrzdRIV0s/lrMeK4FIMDIwhX' +
'tZwrgW7IxzBVUJkgSqBCK7s/79/EBEgwqoYogzIQFaJphhuGkQKTS' +
'VcMRkqibcd2UdwhNVHxIcS8SGPrBdZDbIyuEq4FDJCUwZE8GjCRMj' +
'KwnydIIrR1COrgaoEABSghfs=');

If(FindBitmap(Dareeyak_tele1,x,y))Then
begin
Wait(100);
MoveMouse(x,y);
ClickMouse(x,y,true);
Wait(300)
end;
end;
to

Procedure Tele;
begin
Dareeyak_tele1 := BitmapFromString(14, 14, 'beNrzdRIV0s/lrMeK4FIMDIwhX' +
'tZwrgW7IxzBVUJkgSqBCK7s/79/EBEgwqoYogzIQFaJphhuGkQKTS' +
'VcMRkqibcd2UdwhNVHxIcS8SGPrBdZDbIyuEq4FDJCUwZE8GjCRMj' +
'KwnydIIrR1COrgaoEABSghfs=');

If(FindBitmap(Dareeyak_tele1,x,y))Then
begin
Wait(100);
MoveMouse(x,y);
ClickMouse(x,y,true);
Wait(300)
end;
FreeBitmap(Dareeyak_tele1);
end;
So all you have to do is add 'FreeBitmap(BitmapName);' to the end of all your procedures that involve a bitmap.
Edit: Also, it may be an idea to add better standards to your script to make it easier to read. If you don't know what I mean by standards, then check out one of the tuts in the Tutorial Island section for more info about standards.

noidea

2008-03-29 15:54:26

OK, thanks I have added FreeBitMap to the ends and thanks for all your help, also do I have to do that to the findcolor?

thanks

mixster

2008-03-29 16:10:41

You don;t need to do it to the colour as you don't continually set it, only at the beginning and it overwrites data in it when you assign it. You only need to do it to bitmaps and DTM's (when you get to them) :)

noidea

2008-03-29 16:40:48

Thanks for your help Mixster05, I sent you an email.