SRL Archive - SRL Suggestions

MMRandom Antiban


[D]ude

2012-05-21 02:50:41

Function MMRandom(Time:integer):boolean;
var
x, y, fx, fy, t:integer;
begin
result:= false;
MarkTime(t);
GetMousePos(x, y);
repeat
repeat
fx := (x + random(715) - random(715));
fy := (y +random(474) - random(474));
until (fx > 0) and (fx < 715) and (fy > 0) and(fy < 474);
wait(150+random(250));
MMouse(fx, fy, 5, 5);
until (TimeFromMark(t) >= Time);
end;

Thought this might be a cool antiban to have. Kinda like you bumped your mouse and it got all wild for a bit.

MMRandom(100);

Le Jingle

2012-05-21 06:43:12

If I may as, what would you suppose you would use this for?

Runaway

2012-05-21 14:43:48

Perhaps instead of using the interesting random generator you've implemented, you could just use RandomRange? Also, the repeats and result really aren't necessary. The only thing that can come from repeat..until is jerking the mouse around randomly multiple times, which doesn't seem very humanlike. As for the result, mouse movements are generally procedures.

Try something like this:


procedure MMRandom;
var
x, y, rx, ry:integer;
begin
GetMousePos(x, y);
rx := RandomRange(-700, 700);
ry := RandomRange(-450, 450);
MMouse(x + rx, y + ry, 0, 0);
Wait(250+Random(750));
end;

If you want to get fancy you could add things like:


procedure MMRandom(xRange, yRange: Integer);
...
rx := RandomRange(-xRange, xRange);
ry := RandomRange(-yRange, yRange);
...

EDIT: Whoops, thanks Le Jingle :p

Le Jingle

2012-05-21 15:03:38

you should take the result out lol :p

also, I support more so what Runaway said. I didn't find the original function all to human like, and in addition, I find moving the mouse randomly once is better than jerking it randomly around for an amount of time (But moving the mouse in patterns seems to be a good antiban ;) [ovals, spirals, cirlces, zig-zags - all randomed too ofcourse, to prevent "perfect" patterns lol]).

[D]ude

2012-05-21 22:07:00

Yeah. I like Core's last one. I just had the idea and thought I might try to implement it as best I could. Would it be possible to get something like this into the antiban procedures?? :D