Advertisement
mkv

shuffle machine v1.2

mkv
Jul 2nd, 2016
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #UseHook
  2.  
  3. ; ============================================
  4. ; the shuffle machine v1.2
  5. ; 2016-07-02 21:25, ed @ irc.rizon.net
  6. ; copyleft and protected by stallman's beard
  7. ;
  8. ; lets you go like
  9. ; https://www.youtube.com/watch?v=mfSIcx1YgVE
  10. ;
  11. ; divided into three sections:
  12. ; <> toggle left mouse button,
  13. ;    enable/disable this with F1
  14. ; <> flipflop the A and D keys
  15. ; <> flipflop the W and S keys
  16. ;
  17. ; delete the sections you don't want
  18. ;
  19. ; don't come crying if this gets you banned,
  20. ; i have no idea what different games think
  21. ; about messing with the kb/mouse like this
  22. ; ============================================
  23.  
  24.  
  25.  
  26. ; ============================================
  27. ; below this line: Left mouse toggle
  28. ; ============================================
  29.  
  30. mx := false
  31. me := false
  32.  
  33. ; make left mouse button toggle
  34. $LButton::
  35.     if (me = false)
  36.     {
  37.         ; toggle feature has not been
  38.         ; enabled using the F1 hotkey
  39.         Send {LButton Down}
  40.         return
  41.     }
  42.     if (mx = false)
  43.         Send {LButton Down}
  44.     else
  45.         Send {LButton Up}
  46.     mx := !mx
  47.     return
  48.  
  49. $LButton Up::
  50.     if (me = false)
  51.         ; toggle disabled,
  52.         ; behave like regular LButton
  53.         Send {LButton Up}
  54.     return
  55.  
  56. ; toggle the toggle feature
  57. ; https://autohotkey.com/docs/KeyList.htm
  58. $F1::
  59.     me := !me
  60.     return
  61.  
  62. ; ============================================
  63. ; above this line: Left mouse toggle
  64. ; ============================================
  65.  
  66.  
  67.  
  68. ; ============================================
  69. ; below this line: keys A and D
  70. ; ============================================
  71.  
  72. ax := false
  73. dx := false
  74.  
  75. $a::
  76.     ; A was pressed, forward this to windows
  77.     Send {a Down}
  78.     ax := true
  79.    
  80.     if (dx = true)
  81.     {
  82.         ; D is also pressed, release D
  83.         Send {d Up}
  84.     }
  85.     return
  86.  
  87. $a Up::
  88.     ; A was released, forward this to windows
  89.     Send {a Up}
  90.     ax := false
  91.    
  92.     if (dx = true)
  93.     {
  94.         ; D was held down when A was pressed,
  95.         ; simulate D being pressed
  96.         Send {d Up}
  97.         Send {d Down}
  98.     }
  99.     return
  100.  
  101. $d::
  102.     ; same as above except swap D and A
  103.     Send {d Down}
  104.     dx := true
  105.     if (ax = true)
  106.     {
  107.         Send {a Up}
  108.     }
  109.     return
  110.  
  111. $d Up::
  112.     Send {d Up}
  113.     dx := false
  114.     if (ax = true)
  115.     {
  116.         Send {a Up}
  117.         Send {a Down}
  118.     }
  119.     return
  120.  
  121. ; ============================================
  122. ; above this line: keys A and D
  123. ; ============================================
  124.  
  125.  
  126.  
  127. ; ============================================
  128. ; below this line: keys W and S
  129. ; ============================================
  130.  
  131. wx := false
  132. sx := false
  133.  
  134. $w::
  135.     ; same as above except
  136.     ; ...you get the drift
  137.     Send {w Down}
  138.     wx := true
  139.     if (sx = true)
  140.     {
  141.         Send {s Up}
  142.     }
  143.     return
  144.  
  145. $w Up::
  146.     Send {w Up}
  147.     wx := false
  148.     if (sx = true)
  149.     {
  150.         Send {s Up}
  151.         Send {s Down}
  152.     }
  153.     return
  154.  
  155. $s::
  156.     Send {s Down}
  157.     sx := true
  158.     if (wx = true)
  159.     {
  160.         Send {w Up}
  161.     }
  162.     return
  163.  
  164. $s Up::
  165.     Send {s Up}
  166.     sx := false
  167.     if (wx = true)
  168.     {
  169.         Send {w Up}
  170.         Send {w Down}
  171.     }
  172.     return
  173.  
  174. ; ============================================
  175. ; above this line: keys W and S
  176. ; ============================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement