Da 0wner
2009-05-03 11:04:52
procedure RecordPath;
This is a procedure that records a path for you. It puts it into a nice function in the end and is formatted like:
To use it you can use this script:
Commands:
F11 - Record current tile
F12 - Stop script
F10 - Remove last recorded tile
I hope you find it easier to record a path with this :D.
Also this is for Reflection paths.
This is a procedure that records a path for you. It puts it into a nice function in the end and is formatted like:
function LoadPath : TPointArray;
begin
SetArrayLength(Result, 1);
Result[0] := Point(3000, 3000);
end;
To use it you can use this script:
Program RecordPath;
{.Include SRL\SRL\Misc\Smart.Scar}
{.Include SRL\SRL.Scar}
{.Include SRL\SRL\Reflection\Reflection.Scar}
const
World = 118;
Members = false;
Signed = true;
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Active := True;
end;
Procedure SetupSMART;
Begin
SmartSetupEx(World, Members, Signed, False);
SetTargetDC(SmartGetDC);
end;
procedure RecordPath;
var
Path : TPointArray;
Pos2 : TPoint;
OffMM : boolean;
i : integer;
begin
ClearDebug;
Writeln('function LoadPath : TPointArray;');
Writeln('begin');
Writeln(' SetArrayLength(Result, 1);');
Writeln('');
repeat
if IsFKeyDown(11) then
begin
SetArrayLength(Path, GetArrayLength(Path) + 1);
Pos2 := GetMyPos;
Writeln(' Result[' + IntToStr(High(Path)) + '] := Point(' + IntToStr(Pos2.x) + ', ' + IntToStr(Pos2.y) + ');');
Path[High(Path)] := Point(Pos2.x, Pos2.y);
if GetArrayLength(Path) > 1 then
begin
OffMM := not TileOnMM(Path[High(Path) - 1]);
if OffMM then Writeln(' //Warning: The recorded tile is not in range of last tile. Press F10 to delete it.');
end;
Wait(250);
end;
if ((IsFKeyDown(10)) and (GetArrayLength(Path) > 0)) then
begin
if OffMM then
for i := GetDebugLineCount - 1 downto 1 do
if pos('Warning', GetDebugLine(i)) > 0 then
DeleteDebugLine(i);
DeleteDebugLine(GetDebugLineCount - 1);
SetArrayLength(Path, GetArrayLength(Path) - 1);
Wait(250);
end;
until(IsFKeyDown(12));
if GetArrayLength(Path) = 0 then
begin
ClearDebug;
Writeln('No path was recorded.');
exit;
end;
Writeln('end;');
ReplaceDebugLine(2, ' SetArrayLength(Result, ' + IntToStr(GetArrayLength(Path)) + ');');
end;
begin
SetupSRL;
SetupSMART;
SetupReflection;
DeclarePlayers;
if not LoggedIn then
LoginPlayer;
RecordPath;
end.Commands:
F11 - Record current tile
F12 - Stop script
F10 - Remove last recorded tile
I hope you find it easier to record a path with this :D.
Also this is for Reflection paths.