SRL Archive - Reflection Help

Staircases


DeSnob

2010-06-07 16:58:47

I'm trying to have it find a staircase, and click it but it seems to find the whole staircase and and never the steps, where you click. Does anybody have any ideas? I was thinking of TileToMS, then converting the "step" tile to the mainscreen.

Awkwardsaw

2010-06-07 17:03:12

do that, use tiletoms of the step. :)

Narcle

2010-06-07 17:08:44

If the stairs are 2 tiles wide get the TileToMS of both tiles and average them out for the middle of the stairs. (I do this a lot)

DeSnob

2010-06-07 17:39:53

From: Awkwardsaw
do that, use tiletoms of the step. :)


Yeah, did that :tongue:

 begin
P := TileToMS(Tile(3204, 3209), 0);
MMouse(p.x, p.y, 0, 0);
if (R_IsUpText('Climb-down')) then
begin
GetMousePos(p.x,p.y);
Mouse(p.x, p.y, 2, 2, True);
Result := True;
end; //Failsafe here
end;

Note:Since I'm making my script, I decided to add failsafes once the hardest parts are done


It does the same thing, and I understand why.. but I still don't know how i could have it mouse that tile/object :angry::crying:


From: Narcle
If the stairs are 2 tiles wide get the TileToMS of both tiles and average them out for the middle of the stairs. (I do this a lot)


The problem is, the staircase apparently has 1 more tile added to it .. :(

So it will never accurately find the staircase!

Blumblebee

2010-06-07 17:45:01

TileToMS -> get's the area for your color search. Use color in a box around the tile (add 15 pixels to each side for a better result). And viola!

DeSnob

2010-06-07 17:50:50

From: Blumblebee
TileToMS -> get's the area for your color search. Use color in a box around the tile (add 15 pixels to each side for a better result). And viola!


Actually PointToMS i believe.

That could work, but most of the lumbridge area is the same color as the tile. I think I'll implement a color stair-finding procedure as a failsafe, and do a "-random(50)" or so, to x and +Random(50) to y in the object finder since it gets pretty close.. OR
n := x + 50; mmouse(n+random(5)..
or something like that.

Narcle

2010-06-07 17:58:42

From: DeSnob
Actually PointToMS i believe.

That could work, but most of the lumbridge area is the same color as the tile. I think I'll implement a color stair-finding procedure as a failsafe, and do a "-random(50)" or so, to x and +Random(50) to y in the object finder since it gets pretty close.. OR
n := x + 50; mmouse(n+random(5)..
or something like that.


I don't think you got what he said.

T := TileToMS(stairtile, 40);//w/e your using

and use t.x-15, t.y-15, t.x+15, t.y+15 for the color search box, it'll look only in that small are where the tile is. I've used this method numerous times when its a small object to click on.

Drakan

2010-06-07 18:34:37

From: Narcle
If the stairs are 2 tiles wide get the TileToMS of both tiles and average them out for the middle of the stairs. (I do this a lot)


Why go through that much trouble when you can use TileToMSEx(TheTile, offsetX, offsetY, height);?

DeSnob

2010-06-07 19:41:02

From: Narcle
I don't think you got what he said.

T := TileToMS(stairtile, 40);//w/e your using

and use t.x-15, t.y-15, t.x+15, t.y+15 for the color search box, it'll look only in that small are where the tile is. I've used this method numerous times when its a small object to click on.


Still wouldn't work.. because what it returns as the staircase.. or tile is far from it. I'll post pic in a while.

bbri06

2010-06-07 19:43:07

Are you setting height to 0?

Sir R. M8gic1an

2010-06-07 19:43:28

From: DeSnob
Still wouldn't work.. because what it returns as the staircase.. or tile is far from it. I'll post pic in a while.


Something wrong with detecting it.. if it's that far away!

~RM

DeSnob

2010-06-07 19:58:30

From: Rasta Magician
Something wrong with detecting it.. if it's that far away!

~RM


It did work :P Nevermind!

Thank you :kiss: