Marcelos

YAMM Yet Another Move Mouse application

2 posts in this topic

In my work place they blocked the application movemouse. so y decided to do one by myself , to cheat the system.

I have used some peaces of code from another scripts I have, and also I have found in this forum

Hope this helps

$version="0.2"

#include <Misc.au3>
If _Singleton(@ScriptName, 1) = 0 Then ; allow only one instance
    MsgBox(0, "Warning", "An occurence of " & @ScriptName & " is already running")
    Exit
EndIf

#region tray icon
    #NoTrayIcon
    Opt("TrayIconHide", 0)
    Opt("TrayMenuMode", 1)
    TraySetToolTip("Ratoner "&  $version)
    Local $exititem = TrayCreateItem("Exit")
    TraySetState(1) ; Show the tray menu.
#endregion
#region variables
    $BlockScreensaver=1
    $flagMouse=1
    $MouseNotMovedCounter=0
    $posMouseMovedX=0
    $posMouseMovedY=0
    $Counter= 0
#endregion
#region main
    Local $hTimer = TimerInit()
    while 1
        $Counter=$Counter+1
        if $Counter>1000 then
            CheckifMouseMove()
            if $MouseNotMovedCounter>2 then moveMouse()
            $Counter= 0
        endif
        Switch TrayGetMsg()
            Case $exititem
                exit
        EndSwitch
        sleep(50)
    wend
#endregion

#region functions
    func CheckifMouseMove()
;~      ConsoleWrite("+CheckifMouseMove()" & @crlf)
        $posMouseMoved = MouseGetPos()
        if $posMouseMovedX<>$posMouseMoved[0]or $posMouseMovedY <> $posMouseMoved[1] then
            $posMouseMovedX=$posMouseMoved[0]
            $posMouseMovedY=$posMouseMoved[1]
            $MouseNotMovedCounter=0
;~          ConsoleWrite('>$MouseNotMovedCounter = ' & $MouseNotMovedCounter & @crlf )
        Else
            ;$MouseMoved=0
            $MouseNotMovedCounter=$MouseNotMovedCounter+1
;~          ConsoleWrite('--$MouseNotMovedCounter = ' & $MouseNotMovedCounter & @crlf )
        endif
    EndFunc
    func moveMouse()
;~      ConsoleWrite("+moveMouse" & @crlf)
        Local $posMouse = MouseGetPos()
        $flagMouse=$flagMouse*-1
        Local $new_y = $posMouse[1] + $flagMouse ; + (10*$flagMouse)
        MouseMove($posMouse[0],$new_y)
        $MouseNotMovedCounter=0
;~                  ConsoleWrite("+mouseMove $MouseNotMovedCounter" & $MouseNotMovedCounter & @crlf)
    endfunc
#endregion

 

Share this post


Link to post
Share on other sites



I assume you do this to keep your computer not getting locked

another trick vbscript is to numlock on/off not converted to AutoIT code (I assume if mousemove gets blocked by policy its just a matter of time they block other tools) so far never seen getting wscript locked out by policy

' Function to prevent locking the screen
Function BlinkNumlock()
    Dim WxhShell

    Set WxhShell = CreateObject("WScript.Shell")
     WxhShell.SendKeys "{NUMLOCK}"
     WxhShell.SendKeys "{NUMLOCK}"
     Set WxhShell = Nothing
End Function

 

1 person likes this

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Similar Content

    • perlabsrat
      By perlabsrat
      Hello, I have a Logitech MX500 mouse, this has 7 buttons plus a wheel.
      I am trying to figure out how to detect clicks on three of the buttons on this mouse but have been unable to do so. I am not running any Logitech software just the standard Windows 7 driver. The buttons are all working fine but when I try to figure out which button was clicked unable to detect three of the buttons.

      Using this code snippet I am able to see all the button presses with the exception of these three marked by '?'.
      Is there some alternate method for detecting button clicks? I have been searching for example but have yet to find anything.
      Thanks...
       
      #include <Misc.au3> Dim $a While 1 For $a = 1 To 100 If _IsPressed($a) Then ConsoleWrite("you pressed " & $a & @CRLF) Next WEnd
    • WoodGrain
      By WoodGrain
      Hi guys,
      I'm trying to move and resize a program call CPUID HWMonitor (http://www.cpuid.com/softwares/hwmonitor.html) but WinMove() doesn't work. Can someone tell me how to get this to work for this program? I've successfully moved other programs using WinMove(), and I've used WinGetTitle ("[ACTIVE]") to confirm the title is correct. WinActivate("CPUID HWMonitor") does work.
      If I run the following code nothing happens, doesn't move or resize, but AutoIt doesn't complain about the code either:
      WinMove("CPUID HWMonitor", 0, 0, 475, 715) The class changes every time the program opens (and I've nevery had a lot of success with classes tbh, bit hit and miss for me).
      Thanks all!
    • Masum
      By Masum
      Hi all,
      Can this function be modified to support  @CRLF in the MsgBox's text?
      ; Move Message Box ; Author - herewasplato _MoveMsgBox(0, "testTitle", "testText", 0, 10) Func _MoveMsgBox($MBFlag, $MBTitle, $MBText, $x, $y) Local $file = FileOpen(EnvGet("temp") & "\MoveMB.au3", 2) If $file = -1 Then Return;if error, give up on the move Local $line1 = 'AutoItSetOption(' & '"WinWaitDelay", 0' & ')' Local $line2 = 'WinWait("' & $MBTitle & '", "' & $MBText & '")' Local $line3 = 'WinMove("' & $MBTitle & '", "' & $MBText & '"' & ', ' & $x & ', ' & $y & ')' FileWrite($file, $line1 & @CRLF & $line2 & @CRLF & $line3) FileClose($file) Run(@AutoItExe & " /AutoIt3ExecuteScript " & EnvGet("temp") & "\MoveMB.au3") MsgBox($MBFlag, $MBTitle, $MBText) FileDelete(EnvGet("temp") & "\MoveMB.au3") EndFunc;==>_MoveMsgBox  Thanks
    • algiuxas
      By algiuxas
      Hello,
      When I move GUI, script pause until I release GUI.
      I need to make script not pause while dragging GUI.
       
      GUICreate("Hello world!",250,175,-1,-1) Opt("GUIOnEventMode", 1) GUISetOnEvent(-3, "exit_") ; Check if closed GUISetState() While 1 ToolTip("This tooltip should move.") Sleep(50) WEnd Func exit_() GUIDelete() Exit EndFunc  
    • fishbones
      By fishbones
      Hi guys!
      I'm really new to AutoIT, and I have little experience with scripting or any sort of programming. But I'm trying to learn!
      Right now, what I'm trying to do is make a quick script that repeats a few functions while a key is held down. I want to see if I can make a quick-burst script that might work in Fallout 4 with machine guns
       
      #include <Misc.au3> $dll = DllOpen("user32.dll") While 1 Sleep(100) If _IsPressed("01", $dll) Then MouseDown("left") Sleep(320) MouseUp("left") Sleep(25) EndIf WEnd DllClose($dll) Right now, when I hold down my left mouse button, it just repeats the script once - then I have to release and hold again to enable it again. Is it possible to to start it from the top and basically just repeats itself while I'm holding down my mouse button?

      In advance, thank you!