SRL Archive - OSR Help

Need Help Freeing DTMs;


Wopey

2013-03-17 13:50:41

I need help freeing my DTMs. I keep getting this error:
program FireRuns; //By Wopey
{$DEFINE SMART8}
{$I SRL/SRL.Simba}
{$I P07Include.Simba}
{$I SRL/srl/misc/SmartGraphics.simba}

var
x, y: Integer;
ChestDTM, MtsDTM, AlterDTM: Integer;

procedure LoadDTMs;
begin;
ChestDTM := DTMFromString('mwQAAAHic42SAAGkglgVieSCWA2JhIOYFYi4gZoGqAYnxAzE3ELMDMSsUs0CxmooKQ05KCkNRdjZDalwsg4uDA0OgtxdDmL8/Q0RQEENseDgDM1AdIcxIBIYDAAZGCcY=');
MtsDTM := DTMFromString('mwQAAAHic6hAAGkglgVieSCWA2JhIOYFYi4gZoGqAYnxAzE3ELMDMSsUs0CxmooKQ05KCkNRdjZDalwsg4uDA0OgtxdDmL8/Q0RQEENseDgDM1AdIcxIBIYDAAZGCcY=');
AlterDTM := DTMFromString('mwQAAAH6y42SAAGkglgVieSCWA2JhIOYFYi4gZoGqAYnxAzE3ELMDMSsUs0CxmooKQ05KCkNRdjZDalwsg4uDA0OgtxdDmL8/Q0RQEENseDgDM1AdIcxIBIYDAAZGCcY=');


end;

procedure Bank;
begin
writeln('Looking For Bank');
If findDTM(ChestDTM, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
P07_MakeCompassEast;
P07_MakeCameraAngleHigh;
writeln('Getting Some Ze Essence');
MMouse(422,74,5,5);
wait(randomrange(15,50));
ClickMouse2(mouse_right);
wait(randomrange(400,600));
P07_chooseOptionMulti(['Withdraw All']);
wait(randomrange(500,800));
Mmouse(484,39,5,5);
wait(randomrange(15,100));
ClickMouse2(Mouse_Left);
end;
end;

procedure Teleport1;
begin
writeln('Teleporting To The Fire Station');
MMouse(323, 23, 2, 2);
wait(randomrange(15,50));
ClickMouse2(mouse_left);
wait(randomrange(15,50));
MMouse(422, 24, 2, 2);
wait(randomrange(15,50));
ClickMouse2(mouse_right);
wait(randomrange(15,50));
MMouse(424, 24, 0, 0);
wait(randomrange(15,50));
MMouse(233, 42, 1, 1);
wait(randomrange(15,50));
ClickMouse2(mouse_left);
end;
procedure FreeDTM2;
begin
FreeDTMs(['ChestDTM', 'MtsDTM', 'AlterDTM']);
end;

procedure MoveAlter;
begin
Mmouse(424, 24, 1, 1);
wait(randomrange(15,50));
ClickMouse2(mouse_left);
wait(10000);
if findDTM(MtsDTM, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
Mmouse(313, 313, 1, 1);
ClickMouse2(mouse_left);
wait(randomrange(15,50));
Mmouse(x, y, 3, 3);
ClickMouse2(mouse_left);
wait(randomrange(15,50));
end;
end;








begin
SetupSrl;
Setupp07Include;
ActivateClient;
LoadDTMs;
repeat
Bank;
wait(randomrange(50,100));
Teleport1;
Addonterminate('FreeDTM2');
until(false);
terminatescript();
end.

rj

2013-03-17 13:52:24

put addonterminate inside of the loop

Wopey

2013-03-17 14:06:55


begin
SetupSrl;
Setupp07Include;
ActivateClient;
LoadDTMs;
repeat
Bank;
wait(randomrange(50,100));
Teleport1;
Addonterminate('FreeDTM2');
until(false);
terminatescript();
end.

Wopey

2013-03-17 14:12:54

Nope, Still get the error brother :/

litoris

2013-03-17 14:22:48

1) What's the error
2) Why the hell are you trying to free x and y, they are just integers
3) It doesn't matter where you put addonterminate, as long as it is called before the script dies, the procedure you put in it will run when the script stops.

Wopey

2013-03-17 15:01:52

1)Read
2)I tried to see if it would fix it. No need for the hell part.
3)If you read, You will not be asking questions…

litoris

2013-03-17 15:28:31

The error isn't anywhere. You have problem freeing the DTM's obviously but you haven't posted the error line. Sorry for the "hell", didn't realize the message was that aggressive.

You are also not using the proper DTM names in your proc:

FreeDTMs(['ChestDTM', 'MtsDTM', 'AlterDTM']);

should be the line.

rj

2013-03-17 17:53:35

From: litoris
The error isn't anywhere. You have problem freeing the DTM's obviously but you haven't posted the error line. Sorry for the "hell", didn't realize the message was that aggressive.

You are also not using the proper DTM names in your proc:

FreeDTMs(['ChestDTM', 'MtsDTM', 'AlterDTM']);

should be the line.


Wait, it's possible to free DTM's like that? I never knew..

Wopey

2013-03-17 19:59:24

Well, It not freeing….Test The script yourself. It compiles and runs good. But It does not Free the DTMs when I end the script.

litoris

2013-03-18 03:06:33

What was I thinking yesterday… It isn't working because you have the DTM names as strings. Proper version:
FreeDTMs([ChestDTM, MtsDTM, AlterDTM]);
I suggest you check out other scripts to see how people do things, you can find answers to your questions faster that way.