SRL Archive - Help and Support

Help wiht old procedure Face('')


Rencuz

2006-10-05 08:27:36

whats the new 1 for this Face('N');

WT-Fakawi

2006-10-05 09:23:22

This:

{*******************************************************************************
function MakeCompass(direction: String);
direction: set to: North='n', South='s', East='e', West='w'
By: Wizzup?
Description: Aligns RS to specified direction
*******************************************************************************}
Function MakeCompass(Side:String): Boolean;
Var
Fx, Fy, Dx, Dy : Integer;
ComMark: Integer;
Left_Right : Boolean;
Begin
MarkTime(ComMark);
Case LowerCase(Side) Of
'n' : Begin Fx := 566; Fy := 13; End;
'e' : Begin Fx := 560; Fy := 19; End;
's' : Begin Fx := 566; Fy := 27; End;
'w' : Begin Fx := 573; Fy := 20; End;
end;
If FindColor(Dx,Dy,723587,Fx,Fy,Fx,Fy) Then
begin
Result:=True;
Exit;
end;
If Random(2) = 1 Then Left_Right := True
Else Left_Right := False;
If Left_Right Then KeyDown(VK_RIGHT)
Else KeyDown(VK_Left);
Repeat
Wait((10)+ Random(10));
If(FindColor(Dx,Dy,723587,Fx,Fy,Fx,Fy))then
begin
Result := True;
break;
end;
Until(TimeFromMark(ComMark) > 7000);
If Left_Right Then KeyUp(VK_Right)
Else KeyUp(VK_Left);
End;