SRL Archive - OSR Help

Easy way to click Reflection Object by ID?


Rare Scripts

2015-05-02 20:11:16

Hello, is there any easy way to click a object with reflection?

I need to make Chairs inside POH but i cant use R_InteractTile since the Coords/Tile change every few minutes.

Can anyone help me out please?

Also is there a way to detect if player is in POH?

If so can you give a example on how to?


Many thanks!

-Baws.:spot:

funnyman9292

2015-05-07 11:54:31

Call this in func/procedure/ect :

AllObjects.GetAll(objGame, 20); //Loads all game objects within 20 tiles
AllObjects.Get(objGame, 'Rocks', 20);// Loads all 'Rock's within 20 tiles
OurObject.Find(objGame, ID OF OBJECT, 10)) //10 is referring to all objects with specified ID within 10 tiles.
CoreLoc :=OurObject.GetMSPoint(); //This is the actual location of your object.

And of course dont forget to declare your vars:
var
AllObjects: TReflectObjectArray;
OurObject: TReflectObject; //This is the object you'll assign the ID to.
CoreLoc: Tpoint; //Location of Object

This is how I've done it in reflection. HOpe it helps, feel free to ask more questions I'm on summer break now; I've got the time :spot:

iEatApplez

2015-05-07 23:02:47


procedure clickChair;
var
chairObject: TReflectObject;
begin
chairObject.Find(CHAIR_ID);
Reflect.Mouse.Move(chairObject.GetMSPoint, ranX, ranY, mouse_Right);
Reflect.Text.ChooseOption(BUILD_OPTION);
end;

For checking if you're in the POH you might wanna search for a specific object that's always there (maybe the portal inside has a different ID than the portal outside? ;) )