PDA

View Full Version : [Function] angledir



Boreas
11-10-2006, 11:48 PM
I made this to change the angle and compass at the same time. It saves time plus it's what I do playing legit humanly. Probably could do with improving, but it does the job for now.





program new;
{.include srl\srl.scar}
{************************************************* ******************************
function angledir(angle,direction: String);
By: Boreas. Base on makecompass by Wizzup? and highest angle by StarBlaster 100
Description: Aligns RS to specified direction and angle at the same time
direction: set to: North='n', South='s', East='e', West='w'
angle: set to highest='h', lowest='l'
************************************************** *****************************}
Function angledir(angle,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;
case angle of
'h':
begin
if (Loggedin) then
begin
keydown(38);
sleep(1000 + random(100) + random(200));
keyup(38);
wait(1000 + random(100));
end;
end;
'l':
begin
if (Loggedin) then
begin
keydown(40);
sleep(1000 + random(100) + random(200));
keyup(40);
wait(1000 + random(100));
end;
end;
end;
Exit;
end
If Random(2) = 1 Then Left_Right := True
Else Left_Right := False;
If Left_Right Then
begin
case angle of
'h':keydown(38);
'l':keydown(40);
end;
KeyDown(VK_RIGHT)
end
Else
begin
case angle of
'h':keydown(38);
'l':keydown(40);
end;
KeyDown(VK_Left);
end;
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
begin
case angle of
'h':keyup(38);
'l':keyup(40);
end;
KeyUp(VK_Right);
end
Else
begin
case angle of
'h':keyup(38);
'l':keyup(40);
end;
KeyUp(VK_Left);
end;
End;


begin
activateclient;
setupsrl;
angledir('l','n');
end.