Use the closed door ID for ClickDoor. Though, I warn you, ClickDoor = really slow, because FindObj is really slow. I personally made a custom function that has an extra parameter, the tile of the door. I haven't tried converting FindObj to FindObjEx though, it's a worth a try too.
Here's my function using the tile parameter
SCAR Code:
{*******************************************************************************
function ClickDoor2(DoorObj: integer; Dir, Action: string; ObjTile : TPoint): Boolean;
By: lordsaturn heavily modified by Tad
Description: Clicks a door. (or almost any object inbetween tiles) Returns true
when Door is open
*******************************************************************************}
function ClickDoor2(DoorObj: integer; Dir, Action: string; ObjTile : TPoint): Boolean;
var
Loc, MS: TPoint;
temp : UID;
i,x,y : integer;
begin
result := true;
while CharacterMoving do
if temp.objtype <> DoorObj then Exit;
temp := GetObjectAt(objTile.x, objTile.y);
Loc := ObjTile;
if temp.objtype <> DoorObj then
begin
R_Flag;
if temp.objtype <> DoorObj then Exit;
end;
case Lowercase(Dir) of
'n': MS := TileToMSEx(Tile(Loc.x + 0.5, Loc.y + 0.9), random(5));
's': MS := TileToMSEx(Tile(Loc.x + 0.5, Loc.y + 0.1), random(5));
'w': MS := TileToMSEx(Tile(Loc.x + 0.1, Loc.y + 0.5), random(5)); //try x-.5, y-.1
'e': MS := TileToMSEx(Tile(Loc.x + 0.9, Loc.y + 0.5), random(5));
'c': MS := TileToMSEx(Tile(Loc.x + 0.5, Loc.y + 0.5), 10); //(Center)
end;
result := false;
if MS.x = 0 then Exit;
MMouse(MS.x, MS.y, 3, 3);
if R_WaitUpText(Action, 150) then
begin
GetMousePos(x,y);
Mouse(x,y,0,0,true);
result := DidClick(true, 500);
end else if not Result then
begin
Mouse(MS.x, MS.y, 3, 3, False);
Result := R_ChooseOption(Action);
end;
end;