Etrnl Fear
2012-07-30 17:19:12
Kind of stuck on this part of my first script. It's supposed to check if it's at the Oak trees north of Falador, and if it isn't, it teleports to the Falador Lodestone and walks there. It went great at first, but it wouldn't continue after arriving at the Lodestone and waiting 5 seconds (to make sure the player has stepped off the Lodestone). So, I tried to fix it (can't remember what exactly I changed) and now it seems to skip a step. I added in a few Writeln functions to see where it was skipping.
Here's the procedure
Any help is appreciated. :)
Here's the procedure
var //Variables set after defining smart and SRL.
x, y, FallyTrees: Integer;
F: Array [0..6] of Integer;
aFound: Extended;
procedure LocationCheck;
FallyTrees := DTMFromString('mlwAAAHicY2dgYOAFYnkglgFibgYIkARiaSDmgIqB5CWgckxALArEATEKDO6B6gyewRpgtqU5F4N8uAiDfqIEAz9QHhdmxIOhAAAEUgYn');
begin
if not FindDTMRotated(FallyTrees, x, y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound) then
begin
//Set DTMs to home tele to Falador and walk to trees.
begin
F[0] := DTMFromString('m1gAAAHic42JgYHjNxMDwGIg/AfEjIP4MxG+B+AkQf2SCyL8E4jdAtY+B+BEQf4fibwwQ8bdA/AyIPwNxhqcaQ1FKIENWrDeYBmFzZXGG1hBFhg1zKxgaE3UYirJ8GfiBaonBjERiBAAASlwd9g==');
F[1] := DTMFromString('mlwAAAHicY2dgYLBlgmArIHYCYhsgNgViRyAWZ2RgEABiMSCWBmI5RoiYMBDvO/KJYeXepwx///5laJtzA45b848y8APNxYUZ8WAoAAADIBIy');
F[2] := DTMFromString('mlwAAAHicY2dgYBBlZGCQB2IuRghbBIj5gVgaiH8D5d9DMQ+Q/xFIMzBC8Pw1Wxj0XCoZXr55w3Bo2UQG5/yFDHzW5Qy8xhkM/EAluDAjHgwFAFhSD0g=');
F[3] := DTMFromString('mbQAAAHicY2VgYMhlYmAoAuIIIM4A4gAg7gSKpwBxDRBPBOJMIHZy1GR4+5aBwSReksHWUpUhRo+bgR8ojo4ZsWAwAACC+AkU');
F[4] := DTMFromString('mggAAAHicY2NgYAhiYmCIBmJ3KJ0MxH5A3AaUqwHiRiCewADhlwKxp78yg2KoABi7eigwZCa4MXgHqjDwA+WwYUYcGAIANMEJxA==');
F[5] := DTMFromString('mlwAAAHicY2dgYAhgYmCIhmI/II4D4nggzgbiBqB8BRB3AnEfENcB8SQgbgbi0FhNMA6KkgFjw3gRhkg9NgbFUAEGfqA8LsyIB0MBAIENC6E=');
F[6] := DTMFromString('mlwAAAHicY2dgYJjMxMAwDYg7gHgKEM+EsnuB+ANQ/hkQvwHir0D8EYi/APFTIC72lGBYXaTGkGIvBsfmyuIMNV5SDPxAeVyYEQ+GAgCqjBCN');
end; //It seems to exit the procedure after this point. I'm not sure why, because I didn't change anything before it. :x
// Also, the spell book shows up as the only matching DTM, if imported into the DTM editor.
//Click Spell Book
if FindDTM(F[0], x, y, 0, 0, 502, 502) then
begin
Mouse(x, y, 2, 2, True);
repeat
Wait(500 + Random(500));
until FindDTM(F[1], x, y, MIX1, MIY1, MIX2, MIY2);
end;
//Click Home Teleport
if FindDTM(F[1], x, y, MIX1, MIY1, MIX2, MIY2) then
begin
Mouse(x, y, 2, 2, True);
Wait(1000 + Random(500));
end;
//Click Falador Lodestone and wait for arrival.
if FindDTMRotated(F[2], x, y, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound) then
begin
Mouse(x, y, 2, 2, True);
repeat
wait(500 + Random(250));
Until FindDTMRotated(F[3], x, y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound)
Wait(4000 + Random(1500));
end;
//Click first point of path to trees.
if FindDTMRotated(F[4], x, y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound) then
begin
Mouse(x, y, 2, 2, True);
repeat
Wait(100 + Random(50));
until FindDTMRotated(F[5], x, y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound)
end;
//Click second point of path to trees.
if FindDTMRotated(F[5], x, y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound) then
begin
Mouse(x, y, 2, 2, True);
Wait(500 + Random(250));
end;
//Free DTMs.
begin
FreeDTM(F[0]);
FreeDTM(F[1]);
FreeDTM(F[2]);
FreeDTM(F[3]);
FreeDTM(F[4]);
FreeDTM(F[5]);
FreeDTM(FallyTrees);
//F[6] is freed later on before beginning the woodcutting procedure (It's the inventory icon).
end;
end;
end;
begin //And this is what I have in the main loop that would require it to run.
ClearDebug;
SetupSRL;
DeclarePlayers;
LoginPlayer;
MouseSpeed := 18
LocationCheck;
end.
Any help is appreciated. :)