Advertisement
TheVideoVolcano

Simple Silent Mouse Click Screenshot

Jun 6th, 2015
516
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 2.52 KB | None | 0 0
  1. #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
  2. #AutoIt3Wrapper_Icon=..\tool.ico
  3. #AutoIt3Wrapper_UseX64=n
  4. #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
  5. #include <Date.au3>
  6. #include <ScreenCapture.au3>
  7. #include <Misc.au3>
  8. #include <Array.au3>
  9. #include <File.au3>
  10. If _Singleton("instance1", 1) = 0 Then
  11.     MsgBox(0, "", "Already Running")
  12.     Exit
  13. EndIf
  14.  
  15. Global $cursor = True
  16.  
  17. Global $time = StringReplace(_Now(), ":", ";")
  18. Global $t = StringReplace($time, "/", "_")
  19. Global $showCONFIRM = False
  20. ;Global $driveLabel = InputBox("Drive...", "Drive label for USB", "F:\")
  21.  
  22. ;If $driveLabel = "" Or Not FileExists($driveLabel) Then
  23. ;MsgBox(0, "Exiting...", "No Drive")
  24. ;Exit
  25. ;EndIf
  26.  
  27. ;Global $dir = $driveLabel & "Screens"
  28.  
  29. Local $sDrive = "", $sDir = "", $sFilename = "", $sExtension = ""
  30. Local $aPathSplit = _PathSplit(@ScriptFullPath, $sDrive, $sDir, $sFilename, $sExtension)
  31.  
  32. Global $dir = @ScriptDir & "\" & $sFilename & " Screens"
  33.  
  34. Global $count = 0
  35. Global $cShow = False
  36. global $JpgQual = 100
  37. Global $Clicked = False
  38. Global $usr = @UserName
  39.  
  40. Opt("TrayMenuMode", 1) ;remove standard menu
  41.  
  42. global $t_openDir = TrayCreateItem("Open Screen(s) folder")
  43. global $t_exit = TrayCreateItem("Exit")
  44.  
  45. func test()
  46.     MsgBox(0,"", "Hid")
  47.  
  48.     EndFunc
  49.  
  50. Func Msg($msg, $title = "")
  51.  
  52.     MsgBox(0, $title, $msg)
  53. EndFunc   ;==>Msg
  54.  
  55.  
  56. If $CmdLine[0] > 0 Then ; 1 check trick
  57.  
  58.     If $CmdLine[0] = 1 Then commandLineProcess($CmdLine[1])
  59.  
  60. EndIf
  61.  
  62.  
  63. Func commandLineProcess($command)
  64.  
  65.     If $command > 0 Then
  66.         ;$showCONFIRM = False
  67.         $JpgQual = $command
  68.     EndIf
  69.  
  70. EndFunc   ;==>commandLineProcess
  71.  
  72. While True
  73.  
  74.  
  75.     If _IsPressed(01) Then
  76.  
  77.         If Not FileExists($dir & "\" &  $usr & " - " & $t) Then DirCreate($dir & "\" & $usr & " - " & $t)
  78.  
  79.         If FileExists($dir & "\" & $usr & " - " & $t) Then
  80.  
  81.             _ScreenCapture_SetJPGQuality($JpgQual)
  82.             _ScreenCapture_Capture($dir & "\" &  $usr & " - " & $t & "\" & $usr & " - Capture-" & $count & ".jpg", 0, 0, -1, -1, $cursor)
  83.             $count += 1
  84.  
  85.         EndIf
  86.     EndIf
  87.  
  88.     If $showCONFIRM Then
  89.         If Not $cShow Then
  90.             If $count > 0 Then
  91.                 $cShow = True
  92.                 MsgBox(0, "", "Success", 0.5)
  93.                 ;TrayTip(@ScriptName, "Executing success!", 2, 0)
  94.             EndIf
  95.         EndIf
  96.     EndIf
  97.  
  98.  
  99.  
  100.  
  101. switch TrayGetMsg()
  102.  
  103.     case $t_openDir
  104.  
  105.     ShellExecute($dir & "\" &  $usr & " - " & $t)
  106.  
  107.     If @error <> 0 Then
  108.  
  109.         MsgBox(64, "Error", "Cannot find the folder, this is likely because you haven't clicked the mouse once, yet")
  110.         endif
  111.     case $t_exit
  112.  
  113.         Exit
  114.  
  115. EndSwitch
  116.  
  117.  
  118.  
  119.     Sleep(10)
  120.  
  121. WEnd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement