SRL Archive - Reflection Help

Looking for a way to get object IDs


Cigue

2010-08-06 14:41:54

Is there a way to get all object IDs up to a certain distance from my character? I'm looking for the ID of a staircase in lumbridge but according to my IDs file it could be any of like 20 IDs all related to staircases with the same examine infos.

Sex

2010-08-06 14:59:10

Just look in Objects.simba.

Cigue

2010-08-06 15:14:17

var
i : Integer;
TRSOBJARRAY : TRSObjectArray;

begin
SetupSRL;
DeclarePlayers;
LoginPlayer;
TRSOBJARRAY := GetAllObjects(1);
Writeln(High(TRSOBJARRAY));
for i := 0 to High(TRSOBJARRAY) do
Writeln(ToStr(TRSOBJARRAY[i].ID) + ' at tile ' + ToStr(TRSOBJARRAY[i].Tile.x) + ', ' + ToStr(TRSOBJARRAY[i].Tile.x));
end.
Using this, I got -1 for array length using object types 0 (interactables) and 1 (wall object).

:confused:

Coh3n

2010-08-06 15:53:18

Could just use SmartColors. Would take about 5 minutes to make an test it. Saves you the trouble, since this doesn't seem to be working..

Blumblebee

2010-08-06 16:06:23

I cannot figure out the reflection object finding to save my life so instead I like to (if the object is static) Search for the color within the certain reflection tile that the object is located on. It makes sure that you find the proper object everytime and it doesn't matter the distance (as long as it's on the MS).

Cigue

2010-08-06 16:12:28

From: Blumblebee
I cannot figure out the reflection object finding to save my life so instead I like to (if the object is static) Search for the color within the certain reflection tile that the object is located on. It makes sure that you find the proper object everytime and it doesn't matter the distance (as long as it's on the MS).


You've got me interested. How exactly would one do this? I'm a total reflection noob, I didn't even know you could use tiles on mainscreen.

Blumblebee

2010-08-06 16:14:52

from my gnome agility runner

function CompleteStump(): Boolean;
var
I, x, y: Integer;
TPA: tPointArray;
m: tTile;
P: tPoint;
timer: LongInt;
H: Integer;
begin
with ObjectRecord[BRANCH] do
begin
m := tile(2486, 3419);
P := TileToMS(m, 3);
FindColorsTolerance(TPA, color, P.x-15, P.y-15, P.x+15, P.y+15, 8);
if Length(TPA) <= 0 then
Exit;
if High(TPA) > 3 then
H := 3
else
H := High(TPA);

for I := 0 to H do
begin
mMouse(TPA[i].x, TPA[i].y, 5, 5);
if waitUpText(uText, 500) then
begin
getMousePos(x, y);
Mouse(x, y, 5, 5, true);
Result := true;
Break;
end;
end;
timer := getSystemTime();
while not FindBlackChatMessage(sMessage) do
begin
FindNormalRandoms();
wait(randomRange(200, 300));
if getSystemTime-timer > 2500 then
begin
writeLn('didn''t find the chatmessage');
Exit;
end;
end;

while DistanceFrom(tTileArr[END_]) > 1 do
begin
FindNormalRandoms();
if FindBlackChatMessage(eMessage) then
Exit;
if getSystemTime-timer > 12000 then
Exit;
if Random(25) = 1 then
SleepAndMoveMouse(RandomRange(1000, 2400));
end;
end;
end;

notably looking at the first part of

 
m := tile(2486, 3419);
P := TileToMS(m, 3);
FindColorsTolerance(TPA, color, P.x-15, P.y-15, P.x+15, P.y+15, 8);

Cigue

2010-08-06 16:17:11

From: Blumblebee
One function to govern them all


It's… Beautiful ! Thank you :)

Blumblebee

2010-08-06 16:18:10

haha anytime ;)

Capricorn

2010-08-06 18:57:34

If you already have the tile, you can just do TileToMSEx and it will automatically make the TPoint in the middle of the tile.

Cigue

2010-08-06 19:31:17

From: Capricorn
If you already have the tile, you can just do TileToMSEx and it will automatically make the TPoint in the middle of the tile.


Hey, sweet! That's just like TileToMS except that there's Sex in it !:spongebob:

Honestly, I don't want to just rely on a tile, so I did just what Blumblebee told me to do.