SRL Archive - SRL Archives

RandomRClickEx ~ AntiBan.scar


Rich

2009-06-27 13:59:48

Quite simple. Right clicks the mouse on a random area of the screen, then either chooses "Examine", or "Cancel".
{*******************************************************************************
procedure RandomRClickEx;
By: R1ch
Description: Performs random right, then examines or cancels.
*******************************************************************************}

procedure RandomRClickEx;
var
X, Y, MS : Integer;

begin
if not LoggedIn then Exit;
MS:= MouseSpeed;
MouseSpeed:= 8 + Random(5);
case Random(8) of
0, 4..7 : MouseBox(MSX1, MSY1, MSX2, MSY2, 2);
1 : MouseBox(MIX1, MIY1, MIX2, MIY2, 2);
2 : MouseBox(MCX1, MCY1, MCX2, MCY2, 2);
3 : MouseBox(MMX1, MMY1, MMX2, MMY2, 2);
end;
Wait(Random(1500) + (Random(750)));
repeat
if OptionExist('xamine', False) then
begin
ChooseOption('xamine');
Break;
end else
ChooseOption('ancel');
until(True);
MouseSpeed:= MS;
end;

Richard

EDIT: Changed it so that if there is Examine, it will click it, and if there is not, it will Cancel.

Dynamite

2009-06-27 14:05:04

Cool but maybe RandomRClickEx(Click : Boolean?);
So they can choose what to click?

T~M

Rich

2009-06-27 14:06:35

I did that at first, but then thought it to be a bit pointless really. I'll see what others think, then decide whether to add it or not.

Naum

2009-06-27 14:22:46

  case Random(8) of
0, 4..7 : MouseBox(MSX1, MSY1, MSX2, MSY2, 2);
1 : MouseBox(MIX1, MIY1, MIX2, MIY2, 2);
2 : MouseBox(MCX1, MCY1, MCX2, MCY2, 2);
3 : MouseBox(MMX1, MMY1, MMX2, MMY2, 2);
end;

EDIT: There is already one which does this, its called BoredHuman.

Tniffoc

2009-06-28 08:02:03

From: NaumanAkhlaQ
  case Random(8) of
0, 4..7 : MouseBox(MSX1, MSY1, MSX2, MSY2, 2);
1 : MouseBox(MIX1, MIY1, MIX2, MIY2, 2);
2 : MouseBox(MCX1, MCY1, MCX2, MCY2, 2);
3 : MouseBox(MMX1, MMY1, MMX2, MMY2, 2);
end;

EDIT: There is already one which does this, its called BoredHuman.


I was going to say, I thought I saw this somewhere.

Rich

2009-06-28 12:20:11

Ignoring the fact that this is like BoredHuman, would anyone use this?

Gu3st...

2009-06-28 12:46:02

procedure RandomRClickEx;
var
X, Y, MS : Integer;

begin
if not LoggedIn then Exit;
MS:= MouseSpeed;
MouseSpeed:= 8 + Random(5);
ActivateClient;
case Random(8) of
0, 4..7 : MouseBox(MSX1, MSY1, MSX2, MSY2, 2);
1 : MouseBox(MIX1, MIY1, MIX2, MIY2, 2);
2 : MouseBox(MCX1, MCY1, MCX2, MCY2, 2);
3 : MouseBox(MMX1, MMY1, MMX2, MMY2, 2);
end;
Wait(Random(1500) + (Random(750)));
repeat
if ChooseOption('xamine') then
Break;
ChooseOption('ancel');
until(True)
MouseSpeed:= MS;
end;
Fixed it, as you had it now it would not reset MouseSpeed after clicking Examine
Notice the until(True) that means it will run this only once, but you can still use Break; :)

Rich

2009-06-28 12:53:13

Ooh, thanks Zytex. Would you consider using this?

Gu3st...

2009-06-28 12:59:51

From: R1ch
Ooh, thanks Zytex. Would you consider using this?

If there were no BoredHuman then yes of course I would, but not now since there is one…
Are there any differences between this and BoredHuman?

Naum

2009-06-28 13:01:39

R1ch, I would rather you wouldn't use ActivateClient in it. This is because if your using SMART then it mucks up the focus. This results in Handle errors.

Gu3st...

2009-06-28 13:04:46

From: NaumanAkhlaQ
R1ch, I would rather you wouldn't use ActivateClient in it. This is because if your using SMART then it mucks up the focus. This results in Handle errors.

Taken from SMART.scar in misc folder:
procedure ActivateClient;
begin
end;
:)

But yeah, remove the ActivateClient;

weequ

2009-06-28 15:05:17

You should make OptionExists function to get this working becouse ChooseOption moves the mouse out of the option box if it results false :/

Naum

2009-06-28 15:16:20

From: Zyt3x
Taken from SMART.scar in misc folder:
procedure ActivateClient;
begin
end;
:)

But yeah, remove the ActivateClient;


Exactly, it doesn't do anything ;)

ian.

2009-06-28 15:24:46

I think he's saying that it won't mess it up if he has it :p

Naum

2009-06-28 15:34:27

I think he's saying that it won't mess it up if he has it


But it's still a waste of a line, no?

Rich

2009-06-28 17:04:25

Removed ActivateClient.
Added OptionExist.
Added the repeat loop.

Richard.