SRL Archive - Reflection Development

MeInBox by KitchenRange works


Brandon

2011-03-09 03:28:14

I read a thread where him and a few people couldnt get it to work… Well The code below works for me so I dont know.. I tested this in All the banks and it works…

If you run the code below, run it in edgeville bank and you will see that it finds the player in the Bank/Box..



program MeInBox;
{$i SRL/SRL/Misc/SMART.scar}
{$i SRL/SRL.scar}
{$i reflection\reflection.simba}


procedure DeclarePlayers;
begin
NumberOfPlayers(1);
CurrentPlayer := 0;
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := ''; //3-4 letters from name
Players[0].Active:= True;
Players[0].BoxRewards := ['Xp', 'mote', 'ostume', 'oins', 'aphire', 'ssence'];
end;

procedure SetUpSmartStuff;
begin
Smart_Server := 0;
Smart_Members:= False;
Smart_Signed := True;
Smart_SuperDetail := False;
end;

function R_MeInBox(Box: TBox) : Boolean;
var
Me : TTile;
MaxPx, MinPx, MaxPy, MinPy: Integer;
x,y: Integer;

begin
MaxPx := Max(Box.X1, Box.X2);
MaxPy := Max(Box.Y1, Box.Y2);

MinPx := Min(Box.X1, Box.X2);
MinPy := Min(Box.Y1, Box.Y2);

Me := GetMyPos;
x:= Me.X;
y:= Me.Y;

writeln('Player Gps X Location: ' + inttostr(x));
writeln('Player Gps Y Location: ' + inttostr(y));

if((x <= MaxPx) and (y <= MaxPy) and (x >= MinPx) and (y >= MinPy)) then
begin
Result:= True;
end;
end;

var
Box: TBox;

begin
Box.X1:= 3092;
Box.Y1:= 3499;
Box.X2:= 3099;
Box.Y2:= 3487;

SetUpSmartStuff;
SetupSRL;
SetupReflectionEx(true);
DeclarePlayers;
LogInPlayer;
MakeCompass ('n');
SetAngle (true);
SetRun (true);

Repeat
wait (2000);
ClearDebug;
if(R_MeInBox(Box) = True) then
begin
writeln('Player is In Box');
end else
writeln('Player is Not In Box');
Until(false);
end.