Nava2
2008-09-07 01:31:29
Just run this script.
Fill in the variable name, and it will output the path.
Instructions:
Sorry, its rather simple.
Btw, there are some standards included. If you copy and paste the text it out puts, it has some enters, but you have to copy and paste it.
Credits to Timer for his original version.
Fill in the variable name, and it will output the path.
Instructions:
- Fill in the name of the path you want to make, in the constants.
- Press Run.
- Press F2 to add Tiles, F3 to remove the most recent tile, and F4 or Stop the script to get an output.
Sorry, its rather simple.
Btw, there are some standards included. If you copy and paste the text it out puts, it has some enters, but you have to copy and paste it.
Credits to Timer for his original version.
program PathCreater;
{.include SRL/SRL/misc/smart.scar}
{.include SRL\SRL.Scar}
{.include SRL/SRL/reflection/reflection.scar}
const
VarName = 'Path';
var
I, II : integer;
S, SPC : string;
P, OP : TPoint;
procedure ScriptTerminate;
begin
Delete(s, Length(s) - 1, Length(s));
S := S + '];';
Writeln('');
if Pos('Point', S) = 0 then
Writeln('Error: No Path Created!')
else
Writeln(s);
end;
begin
ClearDebug;
SmartSetupEx(115, true, true, false);
SetTargetDC(SmartGetDC);
for I := 0 to Length(VarName) + 4 do
SPC := ' ' + SPC;
I := 0;
repeat
if (IsFKeyDown(2)) then
begin
P := GetMyPos;
if (OP.x = P.x) and (OP.y = P.y) then
begin
Writeln('Point: (' + IntToStr(p.X) + ', ' + IntToStr(p.Y) + ') is the same as last, ignoring addition.');
while IsFKeyDown(2) do
Wait(1);
Op := Point(-1, -1);
Continue;
end;
OP := P;
if I = 0 then
S := VarName + ' := [Point(' + IntToStr(p.X) + ', ' + IntToStr(p.Y) + '), '
else
S := S + 'Point(' + IntToStr(p.X) + ', ' + IntToStr(p.Y) + '), ';
Inc(II);
if II = 2 then
begin
S := S + #10#13 + SPC;
II := 0;
end;
WriteLn('[' + IntToStr(I) + '] Added Point(' + IntToStr(p.X) + ', ' + IntToStr(p.Y) + ')');
Inc(I);
while IsFKeyDown(2) do
Wait(1);
end;
if IsFKeyDown(3) then
begin
if I = 0 then
begin
Writeln('No point to remove!');
while IsFKeyDown(3) do
Wait(1);
Continue;
end;
Writeln('Removing Point [' + IntToStr(I - 1) + '].');
Delete(S, LastPos('Point', S), Length(S));
Dec(I);
Dec(II);
while IsFKeyDown(3) do
Wait(1);
end;
Wait(1);
until IsFKeyDown(4);
end.