SRL Archive - Reflection Development

TileSaver


Twisted

2008-08-09 04:38:16

This is a tile saver, used mainly just for Path TPA's, but it still gets the coords. You can have SMART disabled so you can keep on clicking. Just run this, press F12 to get a Point() and F11 for the final Point(). Comes with standards and all :P

{Used to make Path's or just WalkToTile stuff!
fill in const
for Paths put Path
for Tiles put Tile }
program TileSaver;
{.include srl/srl/misc/smart.scar}
{.include srl/srl.scar}
{.include srl/srl/reflection/reflection.scar}

const
PathOrTile = 'Tile'; //Just tile coords, or make a path?

Procedure SetupSMART;
Begin
SmartSetupEx(136, False, True, False);
SetTargetDC(SmartGetDC);
If Not (LoggedIn) Then
While Not (SmartGetColor(360, 172) = 13158) Do
Wait(100);
End;

Procedure WriteTheStuff;
var
P: TPoint;
begin
If (PathOrTile = 'Path') then
begin
Writeln('Procedure LoadStuff;');
Writeln('begin');
Writeln(' SetArrayLength(Path, 0);');
Writeln(' Path:= [');
repeat
If IsFKeyDown(12) then
begin
P:= GetMyPos;
Writeln(' Point(' + IntToStr(P.X) + ', ' + IntToStr(P.Y) + '),');
Wait(100 +random(500));
end;
If IsFKeyDown(11) then
begin
P:= GetMyPos;
Writeln(' Point(' + IntToStr(P.X) + ', ' + IntToStr(P.Y) + ')');
Writeln(' ];');
Writeln('end;');
Writeln(' ');
Writeln('Copy and paste this into your script now.');
TerminateScript;
end;
until False;
end;

If (PathOrTile = 'Tile') then
begin
repeat
If IsFKeyDown(12) then
begin
P:= GetMyPos;
Writeln('WalkToTile(' + IntToStr(P.X) + ', '+ IntToStr(P.Y) + ');');
Wait(100 +random(500));
end;
If IsFKeyDown(11) then
begin
P:= GetMyPos;
Writeln('WalkToTile(' + IntToStr(P.X) + ', '+ IntToStr(P.Y) + ');');
Writeln('Don''t forget to put failsafes in your script!');
Wait(100 +random(500));
TerminateScript;
end;
until false;
end;
end;

begin
setupsmart;
setupsrl;
setupreflection;
Writeln('Starting...');
Wait(1000);
ClearDebug;
WriteTheStuff;
end.

Note, that you have to start it, let SMART setup, stop, login, then restart it. :)

Change Log:
Changed so that it is procedure not function, and a little semicolon problem
Changed it so that it's compatible w/ REV 66.
Changed the F11 for TileWalk so it actually says another before it terminates.
Made const for Path or Tile
Release

Macrosoft

2008-08-09 05:01:14

Nice tool. (thanks for explaining it to me on IRC)

Ill def use it next time I use reflection :)

EvilChicken!

2008-08-09 08:58:31

Why not use ReplaceDebugLine? (ReplaceDebugLine(Int, GetDebugLine(Int) + 'new stuff..');)
So your path would take up 2-3 lines instead of 20.

Twisted

2008-08-09 15:32:53

Can you tell me what your thinking of? Have you tried it to see what it does?

Shuttleu

2008-08-09 15:45:03

cool i will definatly use this to get my tile positions :)

~shut

EvilChicken!

2008-08-09 17:28:34

From: Twisted
Can you tell me what your thinking of? Have you tried it to see what it does?


program New;
{.include SRL/SRL/misc/SMART.scar}
{.include SRL/SRL.scar}
{.include SRL/SRL/Reflection/Reflection.scar}

const
worldNumber = 101;

var
S: string;
X, Y: Integer;
FirstPassed: BOolean;

begin
SetUpSRL;
SetUpReflection;
ClearDebug;
WriteLn('Path := [];');
SmartSetupEx(worldNumber, True, False, False);
SetTargetDC(SmartGetDC);
repeat
if IsFKeyDown(2) then
begin
S := GetDebugLine(0);
Delete(S, Length(S) - 1, 2);
GetMyPos(X, Y);
if not FirstPassed then
begin
ReplaceDebugLine(0, S + 'Point(' + IntToStr(X) + ', ' +
IntToStr(Y) + ')];');
FirstPassed := True;
end else
ReplaceDebugLine(0, S + ', Point(' + IntToStr(X) + ', ' + IntToStr(Y) + ')];');
while IsFKeyDown(2) do
Wait(500);
end;
Wait(1000);
until false;
end.

I'm not even sure if you'll understand, it's something I wrote while timing myself to see how long it took me. So sorry for how crap it looks and works, but I hope you'll see what I mean.

And, also, I have two versions of this, sorry if I posted the one that messes up the debug, but I hope that you still will understand what I'm doing. (Or trying to do. :p)


Edit: Twisted, I was only trying to help you..?

Twisted

2008-08-09 19:30:52

I like mine a lot more though. Anyways, whatever.

Shady?

2008-08-09 21:35:52

Nice function, i have just made one like this myself, i was going to post it =P.

Twisted

2008-08-09 22:00:39

Yes, it is very handy.

lordsaturn

2008-08-09 23:16:10

Your version does not display the SetArrayLength correctly with the actual length of the array, so i fixed it with ReplaceDebugLine.

I also improved the SetupSmart procedure.


{Used to make Path's or just WalkToTile stuff!
fill in const
for Paths put Path
for Tiles put Tile }
program TileSaver;
{.include srl/srl/misc/smart.scar}
{.include srl/srl.scar}
{.include srl/srl/reflection/reflection.scar}

var
ax, ay: integer;

const
PathOrTile = 'Path'; //Just tile coords, or make a path?
WorldNumber = 107;


procedure SetupSmart;
var
SMARTTime: Integer;

begin
ClearDebug;
Writeln('Waiting for SMART to load...');
SmartSetup('world'+IntToStr(WorldNumber), True, False, False);
SetTargetDC(SMARTGetDC);
MarkTime(SMARTTime);
while not SmartGetColor(360, 172) = 13158 do
begin
Wait(100+Random(100));
if TimeFromMark(SMARTTime) > 180000 then
begin
Writeln('Could not load SMART, terminating script.');
TerminateScript;
end;
end;
end;

Procedure WriteTheStuff;
var
c: integer;
begin
If (PathOrTile = 'Path') then
begin
Writeln('Function LoadStuff: TPointArray;');
Writeln('begin');
Writeln(' SetArrayLength(Path, 1);');
Writeln(' Path:= [');
repeat
If IsFKeyDown(12) then
begin
c := c + 1;
GetMyPos(ax, ay);
ReplaceDebugLine(2, ' SetArrayLength(Path, '+Inttostr(c)+');');
Writeln(' Point(' + IntToStr(AX) + ', ' + IntToStr(AY) + '),');
Wait(100 +random(500));
end;
If IsFKeyDown(11) then
begin
c := c + 1;
GetMyPos(ax, ay);
ReplaceDebugLine(2, ' SetArrayLength(Path, '+Inttostr(c)+');');
Writeln(' Point(' + IntToStr(AX) + ', ' + IntToStr(AY) + ');');
Writeln(' ];');
Writeln('end;');
Writeln(' ');
Writeln('Copy and paste this into your script now.');
TerminateScript;
end;
until False;
end;

If (PathOrTile = 'Tile') then
begin
repeat
If IsFKeyDown(12) then
begin
GetMyPos(ax, ay);
Writeln('WalkToTile(' + IntToStr(AX) + ', '+ IntToStr(AY) + ');');
Wait(100 +random(500));
end;
If IsFKeyDown(11) then
begin
GetMyPos(ax, ay);
Writeln('WalkToTile(' + IntToStr(AX) + ', '+ IntToStr(AY) + ');');
Writeln('Don''t forget to put failsafes in your script!');
Wait(100 +random(500));
TerminateScript;
end;
until false;
end;
end;

begin
setupsmart;
setupsrl;
setupreflection;
Writeln('Starting...');
Wait(1000);
ClearDebug;
WriteTheStuff;
end.

Twisted

2008-08-10 17:27:17

Works for me perfect with the SetArrayLength…