ZaSz
2008-10-07 22:26:23
O.k this is the script just press play and walk around. It will find the id of object to 1 square over to the direction you choose.
program Findobjectid;
{.include SRL/SRL/misc/smart.scar}
{.include SRL\SRL.Scar}
{.include SRL/SRL/reflection/reflection.scar}
function findobjectid(direction:string): boolean;
var
P : TPoint;
X, Y: integer;
TileObject: UID;
begin
P := GetMyPos;
if direction = 's' then
begin
x := p.x;
y := p.y - 1;
writeln('Location X = ' + inttostr(x)+ 'Location Y = '+ inttostr(y));
TileObject := GetObjectAt(X, Y);
writeln('Object I.D is ' + IntToStr(TileObject.objType));
end;
if direction = 'n' then
begin
x := p.x;
y := p.y + 1;
writeln('Location X = ' + inttostr(x)+ 'Location Y = '+ inttostr(y));
TileObject := GetObjectAt(X, Y);
writeln('Object I.D is ' + IntToStr(TileObject.objType))
end;
if direction = 'e' then
begin
x := p.x + 1;
y := p.y;
writeln('Location X = ' + inttostr(x)+ 'Location Y = '+ inttostr(y));
TileObject := GetObjectAt(X, Y);
writeln('Object I.D is ' + IntToStr(TileObject.objType))
end;
if direction = 'w' then
begin
x := p.x - 1;
y := p.y;
writeln('Location X = ' + inttostr(x)+ 'Location Y = '+ inttostr(y));
TileObject := GetObjectAt(X, Y);
writeln('Object I.D is ' + IntToStr(TileObject.objType))
end;
end;
begin
repeat
SmartSetup('world113', True, true, False);
cleardebug;
findobjectid('w'); // change w to direction
wait(700);
until false;
end.