Flight
2011-02-15 06:35:10
I made a quick 30-minute script just as a test for working more in-debt with bitmaps, and I've tried every route I can think of and I'm still ending up with hundreds of unfreed bitmaps per minute.
Note: This is not for Runescape, therefore I do not use reflection, ect…
Procedure in my script:
And here is my main script loop:
Any suggestions or ideas would be grand, but I'm assuming it's a very simple mistake I'm making somewhere, probably obvious to you guys.
Note: This is not for Runescape, therefore I do not use reflection, ect…
Procedure in my script:
procedure Attack;
Var
x,y,x2,y2,
ChickenPic,
AttackText: integer;
begin
ChickenPic := BitmapFromString(10, 12, 'meJxjYIACAYFzQMSADUCk4AhNNq' +
'i6BYKwKgCKw9XgMgFNAZq9cAVoGtFkMd0MF4QYjksWqwJMLpp6TPd' +
'jehlZAQCzQzK8');
AttackText := BitmapFromString(23, 14, 'meJxjYKACaGBgOJ1CBUOWU+4UsD' +
'kEBbGqQVOw0wJdBIJWYOMiiyxHEplCokuWYxPHdC1+Q9DE4Q4jw5A' +
'GDJdMwVCAhzsFtzLk4MVvCK4waUA1B81tuLgNRMQ+PUEDNRAA7fAt' +
'5w==');
setbitmapname(ChickenPic,'ChickenPic');
setbitmapname(AttackText,'AttackText');
if (FindTarget) then
begin
if (FindBitmapToleranceIn(ChickenPic,x,y,5,5,450,320,25)) then
begin
FreeBitmap(ChickenPic);
x := x+Random(20);
y := y+Random(10);
MoveMouse(x,y);
wait(200+Random(100));
ClickMouse(x,y,mouse_Left);
wait(300+Random(100));
if (FindBitmapToleranceIn(AttackText,x2,y2,5,5,450,320,25)) then
begin
FreeBitmap(AttackText);
x2 := x2+Random(20);
y2 := y2+Random(10);
MoveMouse(x2,y2);
wait(200+Random(100));
ClickMouse(x2,y2,mouse_Left);
FindTarget := False;
end else
begin
FreeBitmap(AttackText);
end;
end else
begin
FreeBitmap(ChickenPic);
end;
end;
end;And here is my main script loop:
begin
KillCount := 0;
FindTarget := True;
repeat
CheckLogin;
CheckBmps;
if(FindTarget) then
Attack;
until(false)
end.Any suggestions or ideas would be grand, but I'm assuming it's a very simple mistake I'm making somewhere, probably obvious to you guys.