Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; 20240714
- ; getMousePosOnClick_1.2.ahk
- ; 1) SHIFT + MOUSE1 : Afficher la dernière position du pointeur sur l ecran
- ; 2) CTRL + MOUSE1 : Remplacer le contenu du clipboard par la position
- ; 3) ALT + MOUSE1 : Enregistre la position dans un fichier, comme ça on peut bombarder
- ; ========================================== ___ _ _ ___ _____ ==========================================
- ; ========================================== |_ _| | \| | |_ _| |_ _| ==========================================
- ; ========================================== | | | .` | | | | | ====small=================================
- ; ========================================== |___| |_|\_| |___| |_| ==========================================
- ; ========================================== ==========================================
- #NoEnv
- SendMode Input
- SetWorkingDir %A_ScriptDir%
- #SingleInstance Force
- global logfile_path:="D:\SCRIPTS\AHK\getMousePosOnClick.log"
- verbose:=0
- log_datetime:=0 ; BUG : toujours true
- ; ========================================== ___ ___ _ _ ___ _____ ___ ___ _ _ ___ ==========================================
- ; ========================================== | __| / _ \ | \| | / __| |_ _| |_ _| / _ \ | \| | / __| ==========================================
- ; ========================================== | _| | (_) | | .` | | (__ | | | | | (_) | | .` | \__ \ ================small=====================
- ; ========================================== |_| \___/ |_|\_| \___| |_| |___| \___/ |_|\_| |___/ ==========================================
- ; ========================================== ==========================================
- WriteLog(text) {
- if(StrLen(logfile_path) > 0){
- if(log_datetime is true){
- ; MsgBox log_datime VRAI
- 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
- } else {
- ; MsgBox log_datime FAUX OK ca marche
- FileAppend, `n%text%, logfile_%A_YYYY%%A_MM%%A_DD%.txt
- }
- } else {
- MsgBox "Error : fichier invalide"
- }
- }
- msgMousePos(){ ; SHIFT + mouse1 : popup
- MouseGetPos, xpos, ypos
- MsgBox, Mousepos : X=%xpos% Y=%ypos%.
- }
- getMouseXpos(){ ; CTRL + mouse 1 : copy to clipboard
- MouseGetPos, xpos
- return xpos
- }
- ; ALT + mouse1 writes in a logfile the X,Y so you can do it in game, so you're not
- ; bothered by any pop-up. Example : (20240725 192256 005) 1139:393
- getMouseYpos(){ ; ALT + mouse1
- MouseGetPos, irrelevantshitwedontcare, ypos
- return ypos
- }
- ; ========================================== ___ ___ ___ ___ ___ _____ ==========================================
- ; ========================================== / __| / __| | _ \ |_ _| | _ \ |_ _| ==small===================================
- ; ========================================== \__ \ | (__ | / | | | _/ | | ==========================================
- ; ========================================== |___/ \___| |_|_\ |___| |_| |_| ==========================================
- ; ========================================== ==========================================
- CoordMode, mouse, Screen
- ; -------------------------------------------- SHIFT + CLIC : display (ok marche )
- +LButton::
- MouseGetPos, x, y
- MsgBox (SHIFT + Mouse1) MOUSE POS = %x%:%y%
- return
- ; -------------------------------------------- CTRL + CLIC : press-papiers (ok marche )
- ^LBUtton::
- MouseGetPos, x, y
- clipboard := x ";" y
- MsgBox (CTRL + Mouse1) CLIPBOARD COPY = %clipboard%
- return
- ; -------------------------------------------- ALT + CLIC : append la position à un fichier
- !LButton::
- MouseGetPos, x, y
- if(verbose){
- MsgBox (ALT + Mouse1) ADDED TO LOGFILE = %x%:%y%
- }
- writeLog(x ":" y)
- return
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Kill Switch
- F12::
- MsgBox "Script interrompu"
- ExitApp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement