function MoveMouseOver, useful for opening doors and much more!
Well, this is a very simple function, but could be used a lot for a little bit of anti ban while being used to check for up text. For example, this would be very useful when checking if a door is opened or closed, because it just acts like you are moving the mouse over it on accident almost, then moves it off it a bit randomly. Read description for more info.
SCAR Code:
program New;
{.include SRL/SRL.scar}
{*******************************************************************************
function MoveMouseOver(Color, MaxTol: Integer; Text: String): Boolean;
By: JAD
Description: Looks for color adding to tolerance until it finds, or is at
maximum tolerance. Then moves the mouse to the color, checking for the Text
and after looking for the text moves the mouse off it randomly on MS. if
the Text is up and stay is true, will keep the mouse there and not Mouse box away.
********************************************************************************}
function MoveMouseOver(ax,ay,Color, MaxTol: Integer; Text: String; Stay: Boolean): Boolean;
var Tol: Integer;
begin
repeat
Tol := Tol + 1;
until(FindColorTolerance(ax,ay,Color,MSX1,MSY1,MSX2,MSY2,Tol)) or (Tol > MaxTol);
if(Tol > MaxTol) then
Exit;
if(FindColorTolerance(ax,ay,Color,MSX1,MSY1,MSX2,MSY2,Tol))then
begin
MMouse(ax,ay,1,1);
if(IsUpText(Text))then
begin
Result := True;
if(Stay)then
begin
GetMousePos(ax,ay);
Result := True;
Exit;
end;
end;
MouseBox(MSX1,MSY1,MSX2,MSY2,3);
wait(300+random(300));
MouseBox(MSX1,MSY1,MSX2,MSY2,3);
end;
if(not(Result))then
begin
Writeln('Specified text was not up :(');
Result := False;
end;
end;
begin
SetupSRL;
ActivateClient;
wait(2000+random(500));
MoveMouseOver(12303556,50,'one');
end.
Very short I know, but still, could be very useful :D