Advertisement
Guest User

AHK Moonwalk

a guest
Aug 11th, 2019
385
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #NoEnv
  2. #SingleInstance Force
  3. #MaxThreadsperHotkey 2
  4. point := True
  5. point1 := True
  6. toggle := False
  7. xx = 1
  8. Loop, Read, Settings.txt
  9. {
  10.     if (";" != SubStr(A_LoopReadLine, 1, 1)) {
  11.         yy := StrReplace(A_LoopReadLine, A_Space, "")
  12.         yy := StrSplit(yy, "=")
  13.         if (point1) and (xx = 1) {
  14.             if (yy[2] = 1) {
  15.                 issprint := True
  16.             } else {
  17.                 issprint := False
  18.             }
  19.             point1 := False
  20.             xx = 0
  21.         }
  22.         else if (xx <= 5) and (point) {
  23.             if (yy[2] = "") {
  24.                 if (xx != 5) or (issprint) and (xx = 5) {
  25.                     MsgBox, Missing a necessary hotkey, script won't launch. Check the settings.txt file.
  26.                     ExitApp
  27.                 }
  28.             }
  29.             Hotkey%xx% := yy[2]
  30.         } else if (xx <= 7) and (point) {
  31.             if (yy[2] != "") {
  32.                 Hotkey%xx% := yy[2]
  33.                 Hotkey := % Hotkey%xx%
  34.                 if (issprint) {
  35.                     Hotkey, +%Hotkey%, Moonwalk%xx%
  36.                 }
  37.                 Hotkey, %Hotkey%, Moonwalk%xx%
  38.             }
  39.         } else if (point) {
  40.             point := False
  41.             xx = 1
  42.             if (yy[2] = "") {
  43.                 Time%xx% := 0
  44.             } else {
  45.                 Time%xx% := yy[2]
  46.             }
  47.         } else if (!point) and (xx <= 11) {
  48.             if (yy[2] = "") {
  49.                 Time%xx% := 0
  50.             } else {
  51.                 Time%xx% := yy[2]
  52.             }
  53.         }
  54.         xx += 1
  55.     }
  56. }
  57. if (Hotkey7 = "") and (Hotkey6 = "") {
  58.     MsgBox, Missing 2 main hotkeys, script won't launch. Check the settings.txt file.
  59. }
  60. return
  61. Moonwalk6:
  62. if (toggle) {
  63.     toggle := False
  64.     GetKeyState, state, %Hotkey6%
  65.     while (state = "D") {
  66.         GetKeyState, state, %Hotkey6%
  67.     }
  68.     return
  69. } else if (looping) {
  70.     toggle := False
  71.     GetKeyState, state, %Hotkey6%
  72.     while (state = "D") {
  73.         GetKeyState, state, %Hotkey6%
  74.     }
  75.     return
  76. } else {
  77.     toggle := True
  78.     GetKeyState, state, %Hotkey6%
  79.     while (state = "D") {
  80.         GetKeyState, state, %Hotkey6%
  81.     }
  82. }
  83. if (issprint) {
  84.     sendinput {%hotkey5% down}
  85. }
  86. sendinput {%Hotkey3% down}
  87. sleep %Time1%
  88. sendinput {%Hotkey3% up}
  89. sendinput {%Hotkey2% down}
  90. sleep %Time2%
  91. sendinput {%Hotkey2% up}
  92. sendinput {%Hotkey4% down}
  93. sleep %Time3%
  94. sendinput {%Hotkey4% up}
  95. sendinput {%Hotkey1% down}
  96. sleep %Time4%
  97. sendinput {%Hotkey1% up}
  98. sendinput {%Hotkey2% down}
  99. while (toggle) {
  100.     sendinput {%Hotkey3% down}
  101.     sleep %Time5%
  102.     sendinput {%Hotkey3% up}
  103.     sendinput {%Hotkey4% down}
  104.     sleep %Time6%
  105.     sendinput {%Hotkey4% up}
  106. }
  107. if (issprint) {
  108.     sendinput {%hotkey5% up}
  109. }
  110. sendinput {%Hotkey2% up}
  111. return
  112. Moonwalk7:
  113. if (toggle) {
  114.     toggle := False
  115.     GetKeyState, state, %Hotkey7%
  116.     while (state = "D") {
  117.         GetKeyState, state, %Hotkey7%
  118.     }
  119.     return
  120. } else if (looping) {
  121.     toggle := False
  122.     GetKeyState, state, %Hotkey7%
  123.     while (state = "D") {
  124.         GetKeyState, state, %Hotkey7%
  125.     }
  126.     return
  127. } else {
  128.     toggle := True
  129.     GetKeyState, state, %Hotkey7%
  130.     while (state = "D") {
  131.         GetKeyState, state, %Hotkey7%
  132.     }
  133. }
  134. if (issprint) {
  135.     sendinput {%hotkey5% down}
  136. }
  137. sendinput {%Hotkey1% down}
  138. sleep %Time7%
  139. sendinput {%Hotkey1% up}
  140. sendinput {%Hotkey3% down}
  141. sleep %Time8%
  142. sendinput {%Hotkey3% up}
  143. sendinput {%Hotkey2% down}
  144. sleep %Time9%
  145. sendinput {%Hotkey2% up}
  146. sendinput {%Hotkey1% down}
  147. while (toggle) {
  148.     sendinput {%Hotkey3% down}
  149.     sleep %Time5%
  150.     sendinput {%Hotkey3% up}
  151.     sendinput {%Hotkey4% down}
  152.     sleep %Time6%
  153.     sendinput {%Hotkey4% up}
  154.     looping := True
  155. }
  156. looping := False
  157. if (issprint) {
  158.     sendinput {%hotkey5% up}
  159. }
  160. sendinput {%Hotkey1% up}
  161. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement