Just whipped this up quickly because i needed a path...
So... Start it up, Login, and DISABLE SMART.
Now... go to your point that you want to walk to and click ENABLE SMART.
NOW DONT PRESS ANYTHING! Smart will disable itself again automatically.
It will then print out your position and store it to a tile array/point array.
Next, Move to your next spot. ENABLE SMART again...
it will save that spot to the array and print it out again.
repeat until youre content. Copy and paste array from the debug window into script, etc.
Simba Code:
program ReflPathMaker;
{$Define SMART}
{$I SRL-OSR/SRL.simba}
const
{how randy do you like it?}
randy = 1;
{current revision corresponds to elfyys include. get new hooks there or somewhere else.}
{updated ones should be at http://osrreflection.googlecode.com/git/Core/Hooks.simba}
ReflectionRevision = '33';
HookLocalPlayer = 'g.ho';
HookGetBaseX = 'o.cc';
HookGetBaseY = 'aa.ci';
HookCharacterX = 'k';
HookCharacterY = 'p';
HookGetBaseXMultiplier = -2032069411;
HookGetBaseYMultiplier = -170410595;
HookCharacterXMultiplier = -657252599;
HookCharacterYMultiplier = -1947713529;
{end hook consts}
Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
end;
(*
R_GetTileGlobal2
~~~~~~~~~~~
.. code-block:: pascal
function R_GetTileGlobal: TPoint;
Returns the current location of player.
.. note::
by Brandon
*)
function R_GetTileGlobal2: TPoint;
var
Me: Integer;
begin
Me := SmartGetFieldObject(SmartCurrentTarget, 0, HookLocalPlayer);
Result.X := (SmartGetFieldInt(SmartCurrentTarget, 0, HookGetBaseX) * HookGetBaseXMultiplier) + (SmartGetFieldInt(SmartCurrentTarget, Me, HookCharacterX) * HookCharacterXMultiplier) div 128;
Result.Y := (SmartGetFieldInt(SmartCurrentTarget, 0, HookGetBaseY) * HookGetBaseYMultiplier) + (SmartGetFieldInt(SmartCurrentTarget, Me, HookCharacterY) * HookCharacterYMultiplier) div 128;
SmartFreeObject(SmartCurrentTarget, Me);
end;
function TPAPathToString(TPA: TPointArray): String;
var
i : integer;
begin
result := '';
for i := 0 to length(TPA) - 1 do
result := result + ' Point(' + intToStr(TPA[i].X) + ', ' + intToStr(TPA[i].Y) + '),';
result[1] := '[';
result[length(result)] := ']';
end;
function TPAPathToStringRandom(TPA: TPointArray; ran: integer): String;
var
i : integer;
ranstr: string;
begin
result := '';
ranstr := ' + RandomRange(' + IntToStr(iAbs(ran)*-1) + ', ' + IntToStr(iAbs(ran)) + ')';
for i := 0 to length(TPA) - 1 do
result := result + ' Point(' + intToStr(TPA[i].X) + ranstr + ', ' + intToStr(TPA[i].Y) + ranstr + '),';
result[1] := '[';
result[length(result)] := ']';
end;
var
path : TPointArray;
begin
DeclarePlayers;
SetupSRL;
setlength(path, 0);
SmartSetEnabled(SmartCurrentTarget, false);
repeat
wait(500);
until LoggedIn;
if not LoggedIn then TerminateScript;
repeat
if SmartEnabled(SmartCurrentTarget) then
begin
SmartSetEnabled(SmartCurrentTarget, false);
setlength(path, length(path) + 1);
path[length(path) - 1] := R_GetTileGlobal2;
ClearDebug;
if randy > 0 then
writeln(TPAPathToStringRandom(path, randy))
else
writeln(TPAPathToString(path));
wait(2000);
end;
wait(100);
until false;
end.
sample output:
Simba Code:
[Point(2467 + RandomRange(-1, 1), 3475 + RandomRange(-1, 1)), Point(2465 + RandomRange(-1, 1), 3462 + RandomRange(-1, 1)), Point(2463 + RandomRange(-1, 1), 3450 + RandomRange(-1, 1))]
[Point(2462, 3427), Point(2461, 3412), Point(2460, 3398), Point(2461, 3385), Point(2458, 3389), Point(2451, 3394)]
(just a simple path from the bank in tree gnome stronghold to the magic tree)