SRL Archive - Outdated Tutorials

[#33] LapTop Mouse - Rev #33+


Sir R. M8gic1an

2009-05-22 02:19:22

Ok guys, there's a new feature being added to SRL which deserves it's very own small tutorial.

This will come in public rev #33, or for those who use the Open Dev it has been there for a while.

You now have the possibility of choosing between laptop-like mouse movements or "normal" mouse movements.

This, however, is not something that you can change during script run, it's something that you choose for yourself.

In SRL.scar you will notice on line 92 the following:

//{$DEFINE UseLaptopMouse}

The default mouse is the "normal" one, if you wish to use LapTop mouse movements all you have to do is change line 92 to


{$DEFINE UseLaptopMouse}

Basically you just have to uncomment it.

A lot more changes and additions have been made, but a thread will be made about those once the public revision comes out.

Enjoy this new feature :)

SRL Development Team

Richard

2009-05-22 02:27:57

Now that is very clever :)

Just in case people want to see the added bit, I found it in the open dev, under MMouse:

{$IFDEF UseLaptopMouse}
miss := (Random(LMouse_MissChance) = 0);
e:= 0;
a:= x - cx;
b:= y - cy;
c:= Pow(a,2) + Pow(b,2)
hypo:= Round(Sqrt(c));
case hypo of
0: Exit;
1..225: seg:=1;
226..600: seg:= Random(2) + 1;
601..1800: seg:= random(3) + 2;
else seg := 5;
end;
f := Round( a / seg);
g := Round( b / seg);
repeat
Wait(30 + random(50));
{Begin: Modified from MMouse by Benland100}
randSpeed := (random(MouseSpeed) / 2.0 + MouseSpeed) / 10.0;
if randSpeed = 0.0 then
randSpeed := 0.1;
getMousePos(cx,cy);
nx:= (cx + (f * e)) + random(rx);
ny:= (cy + (g * e)) + random(ry);
{End: Modified from MMouse by Benland100}
if Miss then
begin
nx:= nx + RandomRange(rx, rx * 2);
ny:= ny + RandomRange(ry, ry * 2);
end;
WindMouse(cx,cy,nx,ny,11.0,8.0,10.0/randSpeed,12.0/randSpeed,10.0*randSpeed,10.0*randSpeed);
e:= e + 1;
until(e = seg);
GetMousePos(cx, cy);
if not PointInBox(Point(cx, cy), IntToBox(x, y, x + rx, y + ry)) then
begin
Wait(30 + random(30));
WindMouse(cx,cy,(x + random(rx)),(y + random(ry)),11.0,6.0,10.0/randSpeed,15.0/randSpeed,10.0*randSpeed,10.0*randSpeed);
end;
{$ELSE}

So how long have you been working on that?

Dynamite

2009-05-22 02:30:18

Looks good, cheers Devs, I have been using though :p

T~M

Sir R. M8gic1an

2009-05-22 02:30:48

From: Richard
Now that is very clever :)
So how long have you been working on that?


i believe hobbit worked on it fairly long.

~RM

noidea

2009-05-22 03:20:45

AMG, I saw a thread from Hobbit AGES ago about laptop mouse. It must have taken, a very long time.
Good work.

Da 0wner

2009-05-22 03:47:51

So what does it do?

senrath

2009-05-22 03:52:58

From: Da 0wner
So what does it do?


It makes movements similar to a laptop's trackpad, as opposed to a regular mouse.

Da 0wner

2009-05-22 03:57:43

So it starts to move their stops and then keeps going like if your finger is at the edge? Or something like that? I don't have a laptop so I'm kind of :/.

Nava2

2009-05-22 04:35:32

It moves in that pulsy method.

King of the Nites

2009-05-22 04:53:50

Wow nice! So it works the same as reg mouse and will function the same, just with a different style, am i right?

Da 0wner

2009-05-22 05:18:53

Yes.

mrpickle

2009-05-22 05:58:09

Good anti-ban, but our new scripts are making autoing less and less efficient!

TViYH

2009-05-22 08:50:29

Mrpickle, that's not necessarily true.

Decreasing the chance of ban is definitely not less efficient, it is in fact a needed switch.

Hobbit

2009-05-22 10:13:06

From: Rasta Magician
i believe hobbit worked on it fairly long.

~RM


From: noidea
AMG, I saw a thread from Hobbit AGES ago about laptop mouse. It must have taken, a very long time.
Good work.


Took about a week to make…

but spent like 2 more weeks making slight tweaks and alterations.

Longest time taken was getting it added into SRL ;)

Gu3st...

2009-05-22 10:57:57

Wouldn't it be better to make it as an variable?
so that it could be used like this:
procedure SetupScript;
begin
UseLaptopMouse := True;
end;

Sir R. M8gic1an

2009-05-22 12:51:24

From: Zyt3x
Wouldn't it be better to make it as an variable?
so that it could be used like this:
procedure SetupScript;
begin
UseLaptopMouse := True;
end;


not at all. Quite risky actually.

Imagine you use a script that has in it's antiban UseLapTopMouse := RBool;
It'll keep switching your mousemovements from regular to laptop, during runtime, making it look like your plugging in your mouse to play, then unplugging and using the laptop, then plugging it in again etc. Doesn't lok natural.

~RM

Gu3st...

2009-05-22 13:28:10

From: Rasta Magician
not at all. Quite risky actually.

Imagine you use a script that has in it's antiban UseLapTopMouse := RBool;
It'll keep switching your mousemovements from regular to laptop, during runtime, making it look like your plugging in your mouse to play, then unplugging and using the laptop, then plugging it in again etc. Doesn't lok natural.

~RM

Nono, you get me wrong. SetupScript; is only run once.
Example of a setupscript:
procedure SetupScript;
begin
if UseSMART then
SetupSMART;
SetupSRL;
UseLaptopMouse := True;
DeclarePlayers;
ClearDebug;
StartUp;
ActivateClient;
LoginPlayer;
end;
You see? SetupSRL; is in it

ZephyrsFury

2009-05-22 13:35:23

From: Zyt3x
Nono, you get me wrong. SetupScript; is only run once.
Example of a setupscript:
procedure SetupScript;
begin
if UseSMART then
SetupSMART;
SetupSRL;
UseLaptopMouse := True;
DeclarePlayers;
ClearDebug;
StartUp;
ActivateClient;
LoginPlayer;
end;
You see? SetupSRL; is in it


Yes thats what we thought about initially but imagine if someone came along and thought "Oh yes I'll use LaptopMouse as antiban" and then decide to change it periodically or even randomly. Thats not something that we'd like to see so using compiler directives makes sure that can't happen.

nielsie95

2009-05-22 13:46:02

And you can also define UseLaptopMouse in the script itself ;)

Naum

2009-05-22 13:47:52

Well done Hobster!

Gu3st...

2009-05-22 16:33:00

From: ZephyrsFury
Yes thats what we thought about initially but imagine if someone came along and thought "Oh yes I'll use LaptopMouse as antiban" and then decide to change it periodically or even randomly. Thats not something that we'd like to see so using compiler directives makes sure that can't happen.

Ah, yes of course. I can see that happen :o
Well.. Good work anyways guys! Thank you

lordsaturn

2009-05-31 00:03:47

Mouse trails using Laptop Mouse:

Gu3st...

2009-05-31 01:50:57

From: lordsaturn
Mouse trails using Laptop Mouse:

Wow, it looks so nice! :)

ZephyrsFury

2009-05-31 07:41:53

From: lordsaturn
Mouse trails using Laptop Mouse:


I think 2 are human. 3 are from LaptopMouse.

ian.

2009-05-31 08:14:46

:] Finally. Ha ha I tested Hobbit's when it was called LMouse :] I loved it <3 Ha ha

Hobbit

2009-05-31 08:50:28

From: ZephyrsFury
I think 2 are human. 3 are from LaptopMouse.


Wrong

See if anyone can get it ;)

ZephyrsFury

2009-05-31 08:51:58

From: Hobbit
Wrong

See if anyone can get it ;)


Isn't that what you said on the other thread?

Hobbit

2009-05-31 08:52:55

From: ZephyrsFury
Isn't that what you said on the other thread?


Nope :p

No cheating

senrath

2009-05-31 08:55:25

I'm gonna hazard a guess at only one of them being made by a human.

Hobbit

2009-05-31 08:58:44

From: senrath
I'm gonna hazard a guess at only one of them being made by a human.


2 are human 3 are my mouse

ian.

2009-05-31 09:02:01

Which are which? :p

And is this any different than the one I tested for you?

Hobbit

2009-05-31 09:16:04

From: 99_
Which are which? :p

And is this any different than the one I tested for you?


Guess and yes, its all build into mouse and mmouse now

ian.

2009-05-31 09:18:40

I know it's built into MMouse and Mouse, but is the general path and such different? :p

B and C are you?

Hobbit

2009-05-31 09:34:04

From: 99_
I know it's built into MMouse and Mouse, but is the general path and such different? :p

B and C are you?


No and No

ian.

2009-05-31 09:35:28

Damn. I'm bad at guessing. Ha ha.

Gu3st...

2009-05-31 12:44:32

A and C and D?

Lmao theyre so humanlike all of them xD

Hobbit

2009-06-01 05:06:37

From: Zyt3x
A and C and D?

Lmao theyre so humanlike all of them xD


1 of those is human

other 2 are mouse

ian.

2009-06-01 05:09:31

C and E?

Hobbit

2009-06-01 05:10:56

From: 99_
C and E?


50%

ian.

2009-06-01 05:21:23

D and E :D

noidea

2009-06-01 05:25:10

I also think its D and E

Hobbit

2009-06-01 05:28:38

Finally…

Yes D and E

ian.

2009-06-01 05:33:54

haha it just took us every guess before we could guess it after it was said.

SRL. We be smart.

noidea

2009-06-01 05:34:39

From: 99_
haha it just took us every guess before we could guess it after it was said.

SRL. We be smart.


You ninja'd me with D, and E :<
I was going to say it, but refresh and was like "fml".

ian.

2009-06-01 05:37:19

>.> ninja'd by 4 minutes.. lol :p

noidea

2009-06-01 05:39:33

From: 99_
>.> ninja'd by 4 minutes.. lol :p


no lie.

ian.

2009-06-01 05:40:53

I know you're not lying.. I'm just surprised at how pro of a ninja I am. :p

Camaro'

2009-06-11 21:47:43

I think d and b are used with LapTop Mouse. Rest idk :P

Xanith

2009-06-12 00:20:47

Wow. This is quite amazing. Never would have guessed which Lines were the the LaptopMouse.

Good job Hobbit. ^.^

I was going to suggest something like this, but there is not need to now.

V3n

2009-06-14 11:44:27

Wow, an extremely human-like addition. It is quite amazing to see that 3 of those lines were computer made, and almost look more human than the human movements o_O

drunken git

2009-06-19 00:55:55

Is this any more detectable? since when i play manualy its on a laptop this should make it look like no change :P

ian.

2009-06-19 01:03:30

It's not more detectable. I'd use it :] It's also just a fun way to make it look different :p