Advertisement
littlebelialskey

rdr2_randHat_1.0.ahk

Jul 25th, 2024 (edited)
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; 20240714
  2.  
  3. ; getMousePosOnClick_1.2.ahk
  4. ; 1) SHIFT + MOUSE1 : Afficher la dernière position du pointeur sur l ecran
  5. ; 2) CTRL  + MOUSE1 : Remplacer le contenu du clipboard par la position
  6. ; 3) ALT  + MOUSE1 : Enregistre la position dans un fichier, comme ça on peut bombarder
  7.  
  8.  
  9. ; ==========================================  ___   _  _   ___   _____   ==========================================
  10. ; ========================================== |_ _| | \| | |_ _| |_   _|  ==========================================
  11. ; ==========================================  | |  | .` |  | |    | |    ====small=================================
  12. ; ========================================== |___| |_|\_| |___|   |_|    ==========================================
  13. ; ==========================================                             ==========================================
  14.  
  15.  
  16. #NoEnv  
  17. SendMode Input  
  18. SetWorkingDir %A_ScriptDir%  
  19. #SingleInstance Force
  20.  
  21. global logfile_path:="D:\SCRIPTS\AHK\getMousePosOnClick.log"
  22.  
  23. verbose:=0
  24. log_datetime:=0 ; BUG : toujours true
  25.  
  26. ; ==========================================   ___    ___    _  _    ___   _____   ___    ___    _  _   ___  ==========================================
  27. ; ==========================================  | __|  / _ \  | \| |  / __| |_   _| |_ _|  / _ \  | \| | / __| ==========================================
  28. ; ==========================================  | _|  | (_) | | .` | | (__    | |    | |  | (_) | | .` | \__ \ ================small=====================
  29. ; ==========================================  |_|    \___/  |_|\_|  \___|   |_|   |___|  \___/  |_|\_| |___/ ==========================================
  30. ; ==========================================                                                                 ==========================================
  31.  
  32. WriteLog(text) {
  33.     if(StrLen(logfile_path) > 0){
  34.         if(log_datetime is true){
  35.             ; MsgBox log_datime VRAI
  36.             FileAppend, `n(%A_YYYY%%A_MM%%A_DD% %A_Hour%%A_Min%%A_Sec% %A_MSec%) %text%, logfile_%A_YYYY%%A_MM%%A_DD%.txt
  37.         } else {
  38.             ; MsgBox log_datime FAUX OK ca marche
  39.             FileAppend, `n%text%, logfile_%A_YYYY%%A_MM%%A_DD%.txt
  40.         }
  41.     } else {
  42.         MsgBox "Error : fichier invalide"
  43.     }
  44. }
  45.  
  46. msgMousePos(){ ; SHIFT + mouse1 : popup
  47.     MouseGetPos, xpos, ypos
  48.     MsgBox, Mousepos : X=%xpos% Y=%ypos%.  
  49. }
  50.  
  51. getMouseXpos(){ ; CTRL + mouse 1 : copy to clipboard
  52.     MouseGetPos, xpos
  53.     return xpos
  54. }
  55.  
  56.  
  57.  ; ALT + mouse1 writes in a logfile the X,Y so you can do it in game, so you're not
  58.  ; bothered by any pop-up. Example : (20240725 192256 005) 1139:393
  59. getMouseYpos(){ ; ALT + mouse1
  60.     MouseGetPos, irrelevantshitwedontcare, ypos
  61.     return ypos
  62. }
  63.  
  64. ; ==========================================   ___    ___   ___   ___   ___   _____   ==========================================
  65. ; ==========================================  / __|  / __| | _ \ |_ _| | _ \ |_   _|  ==small===================================
  66. ; ==========================================  \__ \ | (__  |   /  | |  |  _/   | |    ==========================================
  67. ; ==========================================  |___/  \___| |_|_\ |___| |_|     |_|    ==========================================
  68. ; ==========================================                                          ==========================================
  69.  
  70. CoordMode, mouse, Screen
  71.  
  72. ; -------------------------------------------- SHIFT + CLIC : display (ok marche )
  73. +LButton::
  74.     MouseGetPos, x, y
  75.     MsgBox (SHIFT + Mouse1) MOUSE POS = %x%:%y%
  76. return
  77.  
  78. ; -------------------------------------------- CTRL + CLIC : press-papiers (ok marche )
  79. ^LBUtton::
  80.     MouseGetPos, x, y
  81.     clipboard := x ";" y
  82.     MsgBox (CTRL + Mouse1) CLIPBOARD COPY = %clipboard%
  83. return
  84.  
  85. ; -------------------------------------------- ALT + CLIC : append la position à un fichier
  86. !LButton::
  87.     MouseGetPos, x, y
  88.     if(verbose){
  89.         MsgBox (ALT + Mouse1) ADDED TO LOGFILE = %x%:%y%
  90.     }
  91.     writeLog(x ":" y)
  92. return
  93.  
  94. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Kill Switch
  95. F12::
  96.     MsgBox "Script interrompu"
  97. ExitApp
  98.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement