Page 1 of 1

Mouse bouncer (Just made for fun)

Posted: 21 Jul 2016, 10:20
by Acuena
Hi!
Havent been active for a while.
Just made a useless script that bounses the mouse around.
Not tested on multiple monitors.
It's commented so it should be quite easy to se what evrything does :)

Important: You stop and exit the script by pressing s
Here is the code:
Spoiler

Re: Mouse bouncer (Just made for fun)

Posted: 21 Jul 2016, 12:17
by geek
Had to modify it a little bit to work in WINE on Linux (substituted A_ScreenWidth/height for the WinGet) and gave it a run.

http://i.imgur.com/IePpXRz.gifv

Image

Re: Mouse bouncer (Just made for fun)

Posted: 22 Jul 2016, 03:02
by metacognition
Image

Real life applications haha!

Nice little code :D

Also nice to see others dabble in porting scripts to wine... Several of my scripts have a wine version and a windows version...

Re: Mouse bouncer (Just made for fun)

Posted: 25 Jul 2016, 06:48
by Acuena
Hi!

I made some changes to the code, I don't know if it will work in WINE, I do not have it available here at the computer I am at now.
The changes are the following:
  • Changed "WinGetPos,,, desk_width, desk_height, Program Manager ;Get the screen size" to:

    Code: Select all

    desk_width := A_ScreenWidth
    desk_height := A_ScreenHeight
    Added:

    Code: Select all

    k::Random, dir, 1,4 ;Randomize the dir variable
    
    Now you can press k to change the direction of the mouse by random the dir variable
    Added:

    Code: Select all

    numpadAdd::spd++ ;Increese the spd variable
    numpadSub::spd-- ;Decreese the spd variable
    
    Now you can press numpadadd and numpadsub to increese and decreese the movemnt speed.

Re: Mouse bouncer (Just made for fun)

Posted: 25 Jul 2016, 07:20
by Acuena
Added some more.
  • Added a new key, t

    Code: Select all

    t::
    GetKeyState, state, LButton  ; Right mouse button.
    if state = D
    {
    	send, {lbutton up}
    }
    else
    {
    	send, {lbutton down}
    	}
    return
    
    It toggles the left mouse key, usefull if you want to draw some lines in a painting program.

    I also added this to the s key, making it check if the left mouse key is pressed and if it is, release it.

    Code: Select all

    GetKeyState, state, LButton  ; Right mouse button.
    if state = D
    {
    send, {LButton up}
    }
    
    /