Advertisement
Guest User

Untitled

a guest
Feb 14th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
  2. ; #Warn  ; Enable warnings to assist with detecting common errors.
  3. SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
  4. SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
  5. #SingleInstance Force
  6.  
  7. #IfWinActive ahk_class IglooDocumentWindow ; Reason
  8. {
  9.     BlockInput SendAndMouse
  10.     noteButtonX := ""
  11.     noteButtonY := ""
  12.  
  13.     ^+Up::
  14.     {
  15.         WinGetActiveStats title, curWinWidth, curWinHeight, topLeft, topRight
  16.         ImageSearch noteButtonX, noteButtonY, 0, 0 ,curWinWidth, curWinHeight, NoteButton.png
  17.         if ErrorLevel = 0
  18.         {
  19.             clickTargX := noteButtonX + 15
  20.             clickTargY := noteButtonY + 25
  21.             ; MsgBox Found button at: %noteButtonX% , %noteButtonY%
  22.             ; MsgBox Calculated Coordinates: %clickTargX% , %clickTargY%
  23.             MouseGetPos startX, startY
  24.             Click %clickTargX%, %clickTargY%
  25.             MouseMove startX, startY
  26.             Send {Raw}+12
  27.             Send {Enter}
  28.         }
  29.     }
  30.     return
  31.    
  32.     ^+Down::
  33.     {
  34.         WinGetActiveStats title, curWinWidth, curWinHeight, topLeft, topRight
  35.         ImageSearch noteButtonX, noteButtonY, 0, 0 ,curWinWidth, curWinHeight, NoteButton.png
  36.         if ErrorLevel = 0
  37.         {
  38.             clickTargX := noteButtonX + 15
  39.             clickTargY := noteButtonY + 25
  40.             ; MsgBox Found button at: %noteButtonX% , %noteButtonY%
  41.             ; MsgBox Calculated Coordinates: %clickTargX% , %clickTargY%
  42.             MouseGetPos startX, startY
  43.             Click %clickTargX%, %clickTargY%
  44.             MouseMove startX, startY
  45.             Send {Raw}-12
  46.             Send {Enter}
  47.         }
  48.     }
  49.     return
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement