make everything better
This commit is contained in:
parent
d434dc3f1e
commit
5a4d36ff44
50
msmv.ahk
50
msmv.ahk
@ -1,16 +1,30 @@
|
|||||||
#SingleInstance, force
|
#SingleInstance, force
|
||||||
|
CoordMode, Mouse, Screen
|
||||||
|
|
||||||
|
waittime := 180000
|
||||||
|
|
||||||
|
Switch A_Args[1]
|
||||||
|
{
|
||||||
|
Case "on":
|
||||||
|
Menu, Tray, NoIcon
|
||||||
|
Goto, Start
|
||||||
|
Case "off":
|
||||||
|
ExitApp
|
||||||
|
}
|
||||||
|
|
||||||
|
Menu, Tray, Add, Hide GUI, GuiToggle ; Adds a button to toggle the gui
|
||||||
|
Menu, Tray, Add, Exit, GuiClose ; Exit button
|
||||||
|
Menu, Tray, NoStandard ; None of the standard tray buttons
|
||||||
Gui, +AlwaysOnTop +ToolWindow
|
Gui, +AlwaysOnTop +ToolWindow
|
||||||
|
Gui, Add, Button, x3 y3 w55 h20 gStart +Center, Start
|
||||||
Gui, Add, Button, x3 y3 w55 h20 gStart vStart +Center, Start
|
Gui, Add, Button, x3 y3 w55 h20 gStop +Center, Stop
|
||||||
Gui, Add, Button, x3 y3 w55 h20 gStop vStop +Center, Stop
|
|
||||||
Gui, Show, h28 w60, msmv
|
Gui, Show, h28 w60, msmv
|
||||||
GuiControl, Hide, Stop
|
GuiControl, Hide, Stop ; Since we want the Start button to show first
|
||||||
Return
|
Return
|
||||||
|
|
||||||
Start:
|
Start:
|
||||||
GuiControl, Hide, Start
|
GuiControl, Hide, Start
|
||||||
SetTimer, Msmv, 480000
|
SetTimer, Msmv, %waittime% ; Checks if the has been input in the last 2 minutes every 30 secs, easier to stop a loop with SetTimer
|
||||||
GuiControl, Show, Stop
|
GuiControl, Show, Stop
|
||||||
Return
|
Return
|
||||||
|
|
||||||
@ -21,11 +35,29 @@ Stop:
|
|||||||
Return
|
Return
|
||||||
|
|
||||||
Msmv:
|
Msmv:
|
||||||
MouseMove, 100, 0
|
If (A_TimeIdle > waittime) ; https://www.autohotkey.com/docs/Variables.htm#User_Idle_Time
|
||||||
Sleep, 240000
|
{
|
||||||
MouseMove, 0, 0
|
Random, x,, %A_ScreenWidth%
|
||||||
|
Random, y,, %A_ScreenHeight%
|
||||||
|
MouseMove %x%, %y%
|
||||||
|
}
|
||||||
|
Return
|
||||||
|
|
||||||
|
GuiToggle:
|
||||||
|
If !nogui
|
||||||
|
{
|
||||||
|
Gui, Hide
|
||||||
|
Menu, Tray, Check, Hide GUI
|
||||||
|
nogui := True
|
||||||
|
}
|
||||||
|
Else
|
||||||
|
{
|
||||||
|
Menu, Tray, uncheck, Hide GUI
|
||||||
|
nogui := False
|
||||||
|
Gui, Show
|
||||||
|
}
|
||||||
Return
|
Return
|
||||||
|
|
||||||
GuiClose:
|
GuiClose:
|
||||||
GuiEscape:
|
GuiEscape:
|
||||||
ExitApp ; Closes the app when escape or the exit button is pressed
|
ExitApp ; Closes the app when escape or the exit button is pressed
|
Loading…
Reference in New Issue
Block a user