SRL Archive - SRL Archives

function MoveMouseOver.


JAD

2007-05-06 21:42:01

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.


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

bullzeye95

2007-05-06 21:54:03

Whoa I'm really confused on one thing. How does it compile when MouseBox has 4 parameters, and you put 5? I tried that and it didn't compile, yet when I use that, it compiles!

EDIT: Oh nevermind. That's strange. There's a MouseBox in SRL, and one made for Divi… Different parameters. Nice procedure though. Pretty good.

Bobarkinator

2007-05-06 22:01:18

That's pretty useful and I love the functions with low amount of parameters.

bullzeye95

2007-05-06 22:08:54

Really? I like them with a lot of parameters. More customizable :)

But this would really help in essence miners and such.

JAD

2007-05-07 00:26:09

Great! Since people like it I may add to it :D I'll post in the utilities section for all non membs that want to use :p Thanks for posting guys!