VastlySuperior
2012-08-14 10:18:39
Hi
I have this procedure to open doors, I look for a specific DTM on the minimap and then try to transfer the coordinates to the main screen. The problem is that I can`t use the door on the minimap itself,I need to make a DTM that is right in front of the door as the symbol moves over the minimap door and then it does not find the DTM, so I made a dtm right in front of this door that never changes, It sometimes works and other times it messes up quite bad.
I would appreciate some help and suggestions here.
Here is the code and it is at the shop at Port Sarim
I have this procedure to open doors, I look for a specific DTM on the minimap and then try to transfer the coordinates to the main screen. The problem is that I can`t use the door on the minimap itself,I need to make a DTM that is right in front of the door as the symbol moves over the minimap door and then it does not find the DTM, so I made a dtm right in front of this door that never changes, It sometimes works and other times it messes up quite bad.
I would appreciate some help and suggestions here.
Here is the code and it is at the shop at Port Sarim
procedure OpenDoor;
VAR
DPoint:Tpoint;
aFound:Extended;
XCount:Integer;
begin
ClickNorth(SRL_ANGLE_HIGH);
ClosedDoor:= DTMFromString('mbQAAAHicY2VgYBADYlEgFgZiaSgGsVUZIABEswCxtZUZQ16iMkNSjDZDpJMMGBsBxbnQMCMWDAYAOXoFLg==');
WriteLn('Search For The Door');
// While not(IsUpText('oor')) do
// Begin
WriteLn('Beginning To Search For The Door In The MiniMap');
if FindDTMRotated(ClosedDoor, x, y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound) then
Begin
WriteLn('We Have Found The Door');
DPoint := MMToMS(Point(x,y));
XCount := 15;
Repeat
Inc(XCount);
MMouse(DPoint.x-XCount, DPoint.y,0,0);
x:=DPoint.x-XCount;
y:=DPoint.y+XCount;
// MMouse(DPoint.x-30, DPoint.y,0,0);
If (XCount > 50) then
Begin
Break;
End;
Until IsUpText('pen'); // or (XCount > 35);
If IsUpText('pen') then
Begin
ClickMouse2(mouse_right);
// Mouse(x, y, 0, 0, mouse_right);
Wait(RandomRange(480,530));
ChooseOption('pen');
Writeln('Opening door');
Wait(RandomRange(1500,1600));
end else
Begin
Writeln('The Door Is Already Opened.');
End;
End;
// End;
FreeDTM(ClosedDoor);
end;