The Claw
2007-05-28 05:42:18
[Runtime Error] : Exception: Access violation at address 00711D18 in module 'scar.exe'. Read of address 00000034 in line 133 in script C:\Program Files\SCAR 3.01\includes\srl\srl\core\BitMap.scarI get this in the debug box when I run this piece of code:
procedure FindKarimRepeated;
begin
Writeln('having trouble finding karim..maybe we are on top of him. moving');
MouseBox(666, 81, 675, 111, 1);
if(FindDeformed(x, y, KebabSign, 553, 6, 720, 160)) then
begin
Wait(100+random(10));
Mouse(x, y, 1, 1, true);
FreeBmps;
end else
begin
Writeln('Store Bitmap not found...');
Exit;
end;
end;
procedure KarimTrade;
begin
if(not(LoggedIn)) then exit;
S:=0
if(InStore = true) then
begin
repeat
if(not(LoggedIn)) then exit;
FindRandoms;
Wait(300 + random(100))
Writeln('In Store...attempting to right-click Karim');
S := S+1;
if(FindObj(x, y, 'arim', Karim, 10)) then
begin
MMouse(x, y, 1, 1);
Wait(50 + random(50));
end;
if(IsUpTextMulti('alk','to','arim')) then
begin
Mouse(x, y, 1, 1, false);
Wait(50 + random(25));
end;
if(S = 1) then
FindKarimRepeated;
if(S = 20) then
FindKarimRepeated;
if(S = 30) then
FindKarimRepeated;
if(S = 40) then
FindKarimRepeated;
if(S = 50) then
begin
Writeln('Took too long to find Karim, logging out');
Logout;
if(not(LoggedIn)) then exit;
end;
until(FindColorTolerance(x, y, Talk, 0, 0, 512, 337, 3)) or (S = 50)
S := 0;
end;
begin
ClickOption('alk', 1)
Writeln('Talking to Karim');
Flag;
end;
end;Im delibrately making it not find karim on the first shot, so S = 1, so I can test out the walking away and coming back procedure i made. But when it walks away, and is meant to find the bitmap again, i get that wierd error which I posted above. I know for sure its nothing to do with the bitmap, seeing as it can find the bitmap perfect earlier on in the script, using this:
if(FindDeformed(x, y, KebabSign, 553, 6, 720, 160)) thenSo ive got no clue.
While Im making a new post, I may as well ask about other things im wondering about too I geuss lol
Instead of using
if(S = 1) then
FindKarimRepeated;
if(S = 20) then
FindKarimRepeated;
if(S = 30) then
FindKarimRepeated;
if(S = 40) then
FindKarimRepeated;
if(S = 50) thenis there some way I can put that into an array?
and also, what is the best way to check if a door is open or shut? I was thinking of using a bitmap to find it, move the mouse there, and check up text, but I cant get it to find the right bitmap all the time. DTM is the same. And finding it using colours doesnt work either.
sorry about all the questions, im relatively new to making scripts in this much detail and I want this to be perfect.
any help at all is much appreciated.