SRL Archive - SRL Archives

[FIXED] The -b (aka X var) on Mouse


Harry

2008-04-27 21:52:36

Why do we have this on it? Seriously, just make you look like a macro shifting your mouse that 1 pixel left each time :p

Replace
procedure Mouse(mousex, mousey, ranx, rany: Integer; left: Boolean);
var
a, b, c: Integer;
begin
MMouse(mousex, mousey, ranx, rany);
Wait(60 + Random(30));
GetMousePos(b, c);
HoldMouse(b + 1, c, left);
repeat
Wait(20 + Random(30));
a := a + 1;
until (a > 4);
GetMousePos(b, c);
ReleaseMouse(b, c, left);
Wait(100 + Random(100));
end;
with
{*******************************************************************************
procedure Mouse(mousex, mousey, ranx, rany: Integer; left: Boolean);
By: Mutant Squirrle and Hy71194, minor help from Tarajunky.
Description: Moves then clicks mouse.
*******************************************************************************}
procedure Mouse(mousex, mousey, ranx, rany: Integer; left: Boolean);
var
a, b, c: Integer;
begin
MMouse(mousex, mousey, ranx, rany);
Wait(60 + Random(30));
GetMousePos(b, c);
if c mod 2 = 0 then
Inc(c);
HoldMouse(b, c, left);
repeat
Wait(20 + Random(30));
Inc(a);
until (a > 4);
a := 0;
GetMousePos(b, c);
ReleaseMouse(b, c, left);
Wait(100 + Random(100));
end;

Ftw?

/Discuss.

bullzeye95

2008-04-27 22:20:54

I think there was a bug with HoldMouse where it would move the mouse left one pixel… proven by "can" I think? (I get mad points if I'm right!)
Thought I don't know if the bug is still around.

EvilChicken!

2008-04-27 22:28:32

Actually, this has annoyed me A LOT. Plese remove that one small pixel shit.
This is probably that which makes SRL auto-alchers bannable.

Wizzup?

2008-04-29 08:12:19

Agreed. Replaced.

ShowerThoughts

2008-04-29 08:40:50

Lmao, this have been in srl for long time no one noticed(inclusive me :S)

Good Job Hy
off topic: i have to find that spell checker again :S, Done

Wizzup?

2008-04-29 11:02:52

program New;

var
x, y: Integer;

begin
x := 10;
y := 10;
repeat
ClickMouse(x, y, True);
Wait(1000);
GetMousePos(x, y);
writeln(inttostr(x));
writeln(inttostr(y));
until(False)
end.


Successfully compiled (63 ms)
8
10
8
10
8
10


Hmm..

EvilChicken!

2008-04-29 11:07:23

Ø_ø Wizz.

Bug in SCAR?

BTW, I would replace the "a := a + 1;" in Mouse to Inc(a). Its faster, and it just annoys me alot.

ShowerThoughts

2008-04-29 11:17:15

when i removed the + 1 wizzup it looked like my mouse moved to the left every time it clicked

n3ss3s

2008-04-29 11:19:43

There is a Finnish term for people bringing up things like that but I think I'll just leave it to Finland :p

Inc is was it like 0,003 or 0,03 milliseconds faster, so it's a question of prefer which we could argue about forever.

Wizzup?

2008-04-29 11:42:46

Well, holdmouse and releasemouse seem to work fine without any shift…

EvilChicken!

2008-04-29 11:48:02

The most important thing (for me) is that it annoys me! Inc(X) looks nicer!


var
X, Y: Integer;
begin
X := GetSystemTime;
for Y:= 0 to 1000000000 do
Y := Y + 1;
WriteLn(IntToStr(GetSystemTime - X));
X := GetSystemTime;
for Y:= 0 to 1000000000 do
Inc(Y);
WriteLn(IntToStr(GetSystemTime - X));
end.

On a old PC, can't test this, but runit and see.


ROFL. I WIN.

mastaraymond

2008-04-29 12:10:34

From: EvilChicken!
The most important thing (for me) is that it annoys me! Inc(X) looks nicer!


var
X, Y: Integer;
begin
X := GetSystemTime;
for Y:= 0 to 1000000000 do
Y := Y + 1;
WriteLn(IntToStr(GetSystemTime - X));
X := GetSystemTime;
for Y:= 0 to 1000000000 do
Inc(Y);
WriteLn(IntToStr(GetSystemTime - X));
end.

On a old PC, can't test this, but runit and see.


ROFL. I WIN.

Inc looks ugly:rolleyes:

EvilChicken!

2008-04-29 12:22:14

No it doesn't. What, are you going to tell me IncEx looks worse than the original x + x too?!





EDIT: YOU BOTH FAIL

n3ss3s

2008-04-29 12:28:57

Evil, Inc does look ugly, and I think that x := x + 1 does not :p

mastaraymond

2008-04-29 12:33:41

From: n3ss3s
Evil, Inc does look ugly, and I think that x := x + 1 does not :p

Amen

n3ss3s

2008-04-29 12:39:22


19:39 <Chuck Norris> End of conversation.


.

Harry

2008-04-29 16:29:06

From: Wizzup?
Agreed. Replaced.

My third suggestion eddited into SRL :)

Thanks ;)

@n3ss3s and Raym0nd: Tbh, Inc and Dec > i := i + 1; ;) AFAIK, Inc and Dec increase compiling time and also saves a bit of time. That is why Raym0nd` has a procedure called "TimeSavingStuff" in his obber that replaces those things with IncEx and stuff like that.

@The script Wizzup posted:
Strange :o Meh, revert it :p It does shift 1 pixel left still… or have Freddy fix it ^^.
Removed the repeats:

100
199


Edit:

ME HAD DISCOVERED THE SECRET TO THE MOUSE STUFF ;)
program New;

var
x,xx,xxx, y,yy,yyy: Integer;

begin
cleardebug;
wait(200);
x := 200;
y := 201; // Make it an even number - SCAR reduces it to an Odd number. Make it an even number, SCAR accepts it :p
movemouse(x,y);
wait(300);
repeat
holdmouse(x,y,true);
wait(20);
getmousepos(xxx,yyy);
releasemouse(xxx,yyy,true);

GetMousePos(xx, yy);
writeln(inttostr(xx));
writeln(inttostr(yy));
Wait(1000);
until(False)
end.

(Wizzup's script, I killed it and made horrible standards because I was too lazy to make it nice looking :rolleyes: ) Look at the comment at the y value. So that leads me now to round the value if it is even ;)

Here is the NEW and FTW Mouse (Still shifts a pixel, but only when the value is even, not all the time…)
{*******************************************************************************
procedure Mouse(mousex, mousey, ranx, rany: Integer; left: Boolean);
By: Mutant Squirrle and Hy71194, minor help from Tarajunky.
Description: Moves then clicks mouse.
*******************************************************************************}
procedure Mouse(mousex, mousey, ranx, rany: Integer; left: Boolean);
var
a, b, c: Integer;
begin
MMouse(mousex, mousey, ranx, rany);
Wait(60 + Random(30));
GetMousePos(b, c);
if c mod 2 = 0 then
Inc(c);
HoldMouse(b, c, left);
repeat
Wait(20 + Random(30));
Inc(a);
until (a > 4);
a := 0;
GetMousePos(b, c);
ReleaseMouse(b, c, left);
Wait(100 + Random(100));
end;