Advertisement
Diamonite

Untitled

May 25th, 2023
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. CoordMode, Mouse, Screen
  2.  
  3. stored_pos1 := ""
  4. stored_pos2 := ""
  5. toggle := 0
  6.  
  7. !s::
  8. BlockInput := !BlockInput
  9. toggle := !toggle
  10. If toggle
  11. SetTImer, timer, 13000
  12. else
  13. SetTimer, timer, Off
  14. Return
  15.  
  16. timer:
  17. DoSequence("f")
  18. Return
  19.  
  20. +F2::  ; Shift + F2 to record position
  21.   MouseGetPos, stored_pos3_x, stored_pos3_y
  22. Return
  23.  
  24. !f:: ; Alt + f
  25.   DoSequence("f")
  26. Return
  27.  
  28. !e:: ; Alt + e
  29.   DoSequence("e")
  30. Return
  31.  
  32. ShiftF3: ; This will used in the DoSequence() function.
  33. +F3:: ; NOTE: This will not executed if you dont press manually.
  34.     MouseGetPos, xpos, ypos
  35.     stored_pos1 := xpos "," ypos
  36.     return
  37.  
  38. +F4::
  39.     MouseGetPos, xpos, ypos
  40.     stored_pos2 := xpos "," ypos
  41.     return
  42.  
  43. !a::
  44.     BlockInput, MouseMove
  45.     SetTimer, EnableClickMove, 1000
  46.     toggle := !toggle
  47.     if (toggle = 1) {
  48.         Send, +{F3}
  49.         Send, {F4}
  50.         StringSplit, xy, stored_pos2, `,
  51.         MouseMove, %xy1%, %xy2%, 0
  52.         Send, {LButton}
  53.         Send, {F3}
  54.     } else {
  55.         Send, +{F3}
  56.         Send, {F4}
  57.         StringSplit, xy, stored_pos2, `,
  58.         MouseMove, %xy1%, %xy2%, 0
  59.         Send, {LButton}
  60.         Send, {F3}
  61.     }
  62.     BlockInput, MouseMoveOff
  63.     MouseMove, % A_ScreenWidth/2, % A_ScreenHeight/2, 0
  64.     return
  65.  
  66. EnableClickMove:
  67.    BlockInput, MouseMoveOff
  68.     return
  69.    
  70. #If (BlockInput)
  71.     *LButton::
  72.     *RButton::Return ; block mouse clicks
  73. #If
  74.  
  75. DoSequence(key){
  76.   Global stored_pos3_x, stored_pos3_y
  77.   MouseGetPos, starting_pos_x, starting_pos_y
  78.   Send, +{F3} ; NOTE: This will not trigger the hotkey above.
  79.   ; GoSub, ShiftF3 ; This will trigger the hotkey above, if you really need it.
  80.   Send, {F2}
  81.   MouseMove, % stored_pos3_x, % stored_pos3_y, 0
  82.   Send, {Click Left}
  83.   Send, {%key%}
  84.   MouseMove, % stored_pos3_x - 200, % stored_pos3_y, 0
  85.   Send, {Click Left}
  86.   Send, {%key%}
  87.   MouseMove, % stored_pos3_x, % stored_pos3_y - 200, 0
  88.   Send, {Click Left}
  89.   Send, {%key%}
  90.   MouseMove, % stored_pos3_x - 200, % stored_pos3_y - 200, 0
  91.   Send, {Click Left}
  92.   Send, {%key%}
  93.   Send, {F3}
  94.   MouseMove, % starting_pos_x, % starting_pos_y
  95. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement