SRL Archive - OSR Help

DTMs were not freed: [0]


Xempes

2012-01-08 03:34:18

program new;
Procedure StartGame;
Begin
MoveMouse(331, 222);
ClickMouse(331, 222, 1);
End;
Procedure HitBall;
Var
x, y:Integer;
Begin
if FindColorSpiralTolerance(x, y, 10944439, 50, 56, 611, 426, 20) then
MoveMouse(x, y)
End;
Procedure Click;
Var
x, y, Ball:Integer;
Begin
Ball := DTMFromString('mwQAAAHic42RgYJAFYn0gZgNiTiA2BGJpBgiQAmJzKM0BxDpAzA7EulBxSag6EP3q/1OGff/XMbj+l2So+B8BxOEMfv9VGIL/azEs+t/DsPz/JAZiACMRGA4AE6oTew==');

If FindDTM(Ball, X, Y, 1429, 564, 1483, 611) Then
ClickMouse(X, Y, 1);
FreeDTM(Ball);
end;


begin
StartGame;
Click;
Repeat
Hitball;
until(false);

end.


By the way, Im just fooling around with the game "curve ball" on addictinggames.com

imaloser

2012-01-08 08:15:16

you free DTM's once they're done being used

Gu3st...

2012-01-08 11:02:37

From: imaloser
you free DTM's once they're done being used
That is actually the "proper" way of doing it, so nothing wrong there :)

Xempes

2012-01-08 18:11:41

So, there is nothing wrong with it?

putonajonny

2012-01-08 18:25:16

From: Xempes
program new;
Procedure StartGame;
Begin
MoveMouse(331, 222);
ClickMouse(331, 222, 1);
End;
Procedure HitBall;
Var
x, y:Integer;
Begin
if FindColorSpiralTolerance(x, y, 10944439, 50, 56, 611, 426, 20) then
MoveMouse(x, y)
End;
Procedure Click;
Var
x, y, Ball:Integer;
Begin
Ball := DTMFromString('mwQAAAHic42RgYJAFYn0gZgNiTiA2BGJpBgiQAmJzKM0BxDpAzA7EulBxSag6EP3q/1OGff/XMbj+l2So+B8BxOEMfv9VGIL/azEs+t/DsPz/JAZiACMRGA4AE6oTew==');

If FindDTM(Ball, X, Y, 1429, 564, 1483, 611) Then
ClickMouse(X, Y, 1);
FreeDTM(Ball);
end;


begin
StartGame;
Click;
Repeat
Hitball;
until(false);

end.


By the way, Im just fooling around with the game "curve ball" on addictinggames.com



A bit of a cheat if you only have a few DTMs is to put this line somewhere at the start of your script:
AddOnTerminate('EndScript');

Then this procedure somewhere:
procedure EndScript;
begin
FreeDTM(0)
WriteLn('Goodbye')
end;

Like I said it is a cheat and not good practice