SRL Archive - SRL Archives

Antiban: MisMouse


Sir R. M8gic1an

2010-03-14 17:35:28

This is not to be used on antiban on it's own, but rather as a multi threaded anti ban. (eg, misclicking a rock while mining, and then properly clicking it)


function MisMouse(Target: TPoint; rX, rY: integer; Right: boolean; MouseColor(Yellow, Red, Either)): boolean;
var
realX, realY, tx, ty, tt: integer;
TimeFactor: extended;
begin
realX := Random(rX) + Target.x;
realY := Random(rY) + Target.y;

tx := Random(RMOUSE_X);
ty := Random(RMOUSE_Y);
tt := 50 + Random(CLICK_TIME) ;
Timefactor := tt * 0.1;

Mouse(realX, RealY, tx, ty, Right);
wait(tt);
Mouse(
Target.x - round(TimeFactor*(realX + tx)),
Target.y - round(TimeFactor*(realY + ty)),
Right
);

Result := true;

If MouseColor <> Either then
if MouseColor = Red then
if DidRedClick then
Result := true
else
Result := false
else //MouseColor = Yellow
if DidYellowClick then
Result := true
else
Result := false;

end;

Thoughts, comments?

I could always add the % parameter to make it more user friendly, meaning you'd always call MisMouse instead of mouse, with a % possibility of it misclicking.

~RM

Gu3st...

2010-03-14 17:45:19

  Result := True;

If MouseColor <> Either then
if MouseColor = Red then
if DidRedClick then
Result := true
else
Result := false
else //MouseColor = Yellow
if DidYellowClick then
Result := true
else
Result := false;
  case MouseColor of
Either: Result := True;
Red: Result := DidRedClick;
Yellow: Result := DidYellowClick;
end;

Sir R. M8gic1an

2010-03-14 17:46:55

From: Zyt3x
  Result := True;

If MouseColor <> Either then
if MouseColor = Red then
if DidRedClick then
Result := true
else
Result := false
else //MouseColor = Yellow
if DidYellowClick then
Result := true
else
Result := false;
  case MouseColor of
Either: Result := True;
Red: Result := DidRedClick;
Yellow: Result := DidYellowClick;
end;


Nicely pointed out. Was writing it under inspiration rather than with any specifics in my head, but nicely pointed out.

Anyway, ideas on its usability?

~RM

Gu3st...

2010-03-14 18:25:23

It's a bit hard to understand just how it works and how random it is by looking at the code, and why is the parameter "Right" instead of "Left" when setting it to True would result in clicking with the left mouse button? Just change it to Left :p

I suggest having two MisMosue functions, one that is like it is now and one that has %

rya

2010-03-14 18:27:45

From: Zyt3x

I suggest having two MisMosue functions, one that is like it is now and one that has %


Am i going or mad or could you just do

If Random(100) = 1 Then
MisMouse;
Else Mouse(x,y,0,0,True)

Or am i just mad?

Sir R. M8gic1an

2010-03-14 18:27:53

From: Zyt3x
It's a bit hard to understand just how it works and how random it is by looking at the code, and why is the parameter "Right" instead of "Left" when setting it to True would result in clicking with the left mouse button? Just change it to Left :p

I suggest having two MisMosue functions, one that is like it is now and one that has %


I don't see the point of having the two of them…


function MisMouse(Target: TPoint; rx, ry: integer; Left: boolean): boolean
begin
Result := MisMousePRCT(0, Target, rx, ry, Left);
end;

~RM

Sir R. M8gic1an

2010-03-14 18:29:17

From: rya
Am i going or mad or could you just do

If Random(100) = 1 Then
MisMouse;
Else Mouse(x,y,0,0,True)

Or am i just mad?


You could, but it's more friendly to have the % as a param. (Less lines of code for the 'normal' scripter to write)

~RM

rya

2010-03-14 18:32:52

From: Rasta Magician
You could, but it's more friendly to have the % as a param. (Less lines of code for the 'normal' scripter to write)

~RM


Is 3 lines of code so much compared to 1??

and with extra paramenter my way would easyer for some one to read the code that does not know what the parameters are for MisMouse

Sir R. M8gic1an

2010-03-14 18:40:56

From: rya
Is 3 lines of code so much compared to 1??

and with extra paramenter my way would easyer for some one to read the code that does not know what the parameters are for MisMouse


Alt + enter?

~RM

NCDS

2010-03-14 19:13:58

You should just add the %. That's a great idea and seems like it should have been done long ago.

Alek000

2010-03-14 20:20:48

Not really good with the scripting as of yet, but I think miss-clicks would be great anti-ban. I miss-click all the time when playing legit so I would definitely use it.

noidea

2010-03-14 23:11:23

Are user-made types in Simba/SCAR case sensitive?
If they are, I suggest changing the MouseColor(Red, Yellow, Either) to lowercase.

How would you thread this?