SRL Archive - Reflection Tutorials

Object Finding


NiCbaZ

2008-09-12 19:13:31

Object Finding



Here is an Example of a Object Finding Function i will explain how it all works.

{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
function Find: boolean;
By: Nicbaz
Description: Find Obects with reflection.
Status: Good
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-}
function FindBird: boolean;
var
xx : TPoint;
begin
if FindObject(xX,19175) then
begin
Result:= True;
XX:= TileToMS(XX, 0);
Mouse(xX.x,xX.y,2,2,true);
Wait(30 + Random(10));
FindNormalRandoms;
end;
end;



var
xx : TPoint;


FindObject Returns a Tpoint of a Tile On the MiniMap, we are just declaring that Tpoint.


Function FindObject(Var Tile: TPoint; objType: Integer): Boolean;

Is the function we are using for the object finding, its in the reflection Include.

 if FindObject(xX,19175) then

The xX is just the Tpoint We declared so that's what it will return as.


19175

That is the Id of the object to get the ID use Rs bot and the debug will show up for the ID or find an Id list.

Result:= True;



Just saying the the function Returns True Because it found the Object.

 XX:= TileToMS(XX, 0);

This is What makes it change the TPoint of the Tile the FindObject Returned onto the Main screen, without this the function cannot work.

 
Mouse(xX.x,xX.y,2,2,true);

Mouse(xX.x,xX.y,2,2,true);

This will Click on the Object You are finding the XX is what TileToMS returned making it possible to get the x and the y cords of the object..



So its all Very simple and easy to do, if you see and errors in here please tell me, also if its hard to understand please tell me.

Harry

2008-09-12 19:18:56

I'd advise you to use moar randomness than 2,2.. but nice basic tut :)

NiCbaZ

2008-09-12 19:27:41

Hah, yeah i just wrote that there anyway use more than 2,2 randomness Guys!

Thanks.

Method

2008-09-12 19:37:13

Your function won't even compile because you have some random semicolon inside the parentheses. Besides that, it's pretty basic and you tell people to "use RSBot" to find object information instead of writing something yourself to do so, which might be a better idea.

NiCbaZ

2008-09-12 19:39:58

Besides that, it's pretty basic

hmm meant to be basic?


Its not meant to compile, i wrote it there and then idc if it doesn't compile im just saying a basic method of object finding, for the Rs bot thing, just saying thats what i use for debugging, sorry im not good enough for you.

Shuttleu

2008-09-12 19:42:53

lol its good enough for me

at least now i know how to use object finding

~shut

Shady?

2008-09-12 22:58:44

Nice tut, i learned a lot from this. (well, at least i know how to find objects now)

Maybe use
Function GetObjectAt(TileX, TileY: Integer): UID;

to get the uids?

dorkythedork

2008-09-16 12:29:49

where can you find rsbot cant find it any where or does somebody got a id list?