SRL Archive - Help

Fail to Open Door (Reflection)


Brandon

2011-07-11 03:08:49


GateObj:= GetObjectByID(13182, 0, 52);
if(FindRSObject(GateObj)) then
Repeat
GatePoint:= TileToMSEx(GateObj.Tile, 0, 0, 50);
WalkToTile(GateObj.Tile, 0, 1);
wait(RandomRange(500, 1000));
writeln('DistanceFrom Object: ' +tostr(DistanceFrom(GateObj.Tile)));
Until(Not FindRSObject(GateObj) or (DistanceFrom(GateObj.Tile) < 10));

AltarDoor:= GetObjectByID(13119, 1, 3);
if(FindRSObject(AltarDoor)) then
Repeat
AltarPoint:= TileToMSEx(AltarDoor.Tile, 0, 0, 0);
Mouse(AltarPoint.X, AltarPoint.Y, 0, 0, true);
wait(RandomRange(500, 1000));
Until(Not FindRSObject(AltarDoor));

This is what I have.. It find the altar, tries to walk to it.. the door blocks the way. The altar is South of me when I enter the Portal so what happens is that it tries to click the door but instead clicks one tile south of the door.. if I rotate the camera, it will click the door..

I've really tried changing the height because I don't know the height, I put something like 100.. and it didn't work. So how Do I find Player Direction so that I can turn the compass to face the door to open it?

KingKong

2011-07-11 04:00:24

use r_getme to get info about your player.

me:= r_getme;
orientation:= me.orientation;

IMO, i think its best if you use ref + col to click the door since its easy that way. To do this, get the tiles surrounding the door and do a tiletomsex on the topright and bottom left of the tile, then use tpas to find the door color.

Flight

2011-07-11 05:21:08

Just always have your player turn the compass to 'that' angle when you're near the door.