Advertisement
Guest User

Untitled

a guest
Dec 10th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.79 KB | None | 0 0
  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.  
  6. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  7. ;; Global variables for toggles
  8. toggle_attack := 0
  9. toggle_e := 0
  10. toggle_run := 0
  11. toggle_eat := 0
  12. stack_number := 1
  13. harvest_number := 1
  14.  
  15. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  16. ;; Autorun macro
  17. ;; Press F1 to toggle on/off
  18.  
  19. arkAutoRun:
  20. IfWinNotActive ARK: Survival Evolved
  21. {
  22. SendInput {w up}
  23. SetTimer, arkAutoRun, off
  24. toggle_run = 0
  25. }
  26. return
  27.  
  28. F1::
  29. IfWinNotActive ARK: Survival Evolved
  30. return
  31. if toggle_run = 0
  32. {
  33. SendInput {w down}
  34. SetTimer, arkAutoRun, 200
  35. toggle_run = 1
  36. ToolTip, AUTO RUN, 10, 50, 1
  37. }
  38. else
  39. {
  40. toggle_run = 0
  41. SendInput {w up}
  42. SetTimer, arkAutoRun, off
  43. Tooltip, , , , 1
  44. }
  45. return
  46. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  47.  
  48. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  49. ;; Autoattack macro
  50. ;; Press F3 to toggle on/off
  51.  
  52. arkAutoAttack:
  53. IfWinActive ARK: Survival Evolved
  54. {
  55. SendEvent {Click}
  56. }
  57. else
  58. {
  59. SetTimer, arkAutoAttack, off
  60. }
  61. return
  62.  
  63. F3::
  64. if toggle_attack = 0
  65. {
  66. toggle_attack = 1
  67. SetTimer, arkAutoAttack, 100
  68. ToolTip, AUTO ATTACK, 10, 10, 3
  69. }
  70. else
  71. {
  72. toggle_attack = 0
  73. SetTimer, arkAutoAttack, off
  74. Tooltip, , , , 3
  75. }
  76. return
  77. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  78.  
  79. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  80. ;; Autofeeed drink macro
  81. ;; Press F5 to toggle on/off
  82.  
  83. arkAutoEat:
  84. IfWinActive ARK: Survival Evolved
  85. {
  86. Send {9 down}
  87. sleep 50
  88. send {9 up}
  89. sleep 50
  90. Send {0 down}
  91. sleep 50
  92. Send {0 up}
  93. }
  94. else
  95. {
  96. SetTimer, arkAutoEat, off
  97. }
  98. return
  99. F5::
  100. if toggle_eat = 0
  101. {
  102. toggle_eat = 1
  103. SetTimer, arkAutoEat, 2400000
  104. ToolTip, AUTO EAT, 10, 80, 5
  105. }
  106. else
  107. {
  108. toggle_eat = 0
  109. SetTimer, arkAutoEat, off
  110. Tooltip, , , , 5
  111. }
  112. return
  113.  
  114. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  115. ;; Auto E macro
  116. ;; Press F4 to toggle on/off
  117.  
  118. arkAutoE:
  119. IfWinActive ARK: Survival Evolved
  120. {
  121. Send, e
  122. }
  123. else
  124. {
  125. SetTimer, arkAutoE, off
  126. }
  127. return
  128.  
  129. F4::
  130. if toggle_e = 0
  131. {
  132. toggle_e = 1
  133. SetTimer, arkAutoE, 100
  134. ToolTip, AUTO E, 10, 30, 4
  135. }
  136. else
  137. {
  138. toggle_e = 0
  139. SetTimer, arkAutoE, off
  140. Tooltip, , , , 4
  141. }
  142. return
  143. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  144.  
  145.  
  146. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  147. ;; Harvestt stack of cropplots macro
  148. ;; Press F7 to start
  149.  
  150. F7::
  151. ToolTip, HARVEST A STACK, 10, 30, 7
  152. Send {Down down} ; Press down the up-arrow key.
  153. Sleep 4000 ; Keep it down for one second.
  154. Send {Down up} ; Release the up-arrow key.
  155. Sleep 500
  156. Send {Up down}
  157. Loop, 500
  158. {
  159. PixelSearch, Px, Py, 750, 450, 1250, 700, 0xFAFB06, 13, Fast
  160. if ErrorLevel
  161. sleep 10
  162. else
  163. {
  164. PixelSearch, Px, Py, 750, 450, 1250, 700, 0xFE5E44, 13, Fast
  165. if ErrorLevel
  166. sleep 10
  167. else
  168. {
  169. Send {Up up}
  170. break
  171. }
  172. }
  173. }
  174. Loop, 12
  175. {
  176. Send, f
  177. Sleep, 1300
  178. PixelGetColor,Color,1260,104 ; Return / Get the color of the pixel at the X and Y coordinates / at the X and Y location
  179. If Color=0xFFE780 ; 0xFFFFFF is the color White, you need to modify this color to your desired color
  180. {
  181. MouseClick, left, 1322, 177
  182. Sleep, 50
  183. send, trap
  184. Sleep, 50
  185. MouseClick, left, 1475, 189
  186. Sleep, 75
  187. Send, {esc}
  188. Sleep, 350
  189. Send {Up down} ; Press down the up-arrow key.
  190. Sleep 295 ; Keep it down for one second.
  191. Send {Up up} ; Release the up-arrow key.
  192. }
  193. Else
  194. break
  195. }
  196. Send {a down}
  197. sleep 1100
  198. Send {a up}
  199. sleep 100
  200. Tooltip, , , , 7
  201. return
  202.  
  203. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  204. ;; Harvest 6 sttacks of cropplots moving left. May need to adjust things
  205. ;; Press F9 to start
  206.  
  207. F9::
  208. ToolTip, HARVEST 6 STACKS - %stack_number% / 6 - START, 10, 30, 9
  209. Loop, 6
  210. {
  211. ToolTip, HARVEST 6 STACKS - %stack_number% / 6 - Plot %harvest_number% / 12 - ALIGNING FOR FIRST STACK, 10, 30, 9
  212. Send {Down down} ; Press down the up-arrow key.
  213. Sleep 4000 ; Keep it down for one second.
  214. Send {Down up} ; Release the up-arrow key.
  215. Sleep 500
  216. Send {Up down}
  217. Loop, 500
  218. {
  219. PixelSearch, Px, Py, 750, 450, 1250, 700, 0xFAFB06, 13, Fast
  220. if ErrorLevel
  221. sleep 10
  222. else
  223. {
  224. PixelSearch, Px, Py, 750, 450, 1250, 700, 0xFE5E44, 13, Fast
  225. if ErrorLevel
  226. {
  227. ToolTip, HARVEST 6 STACKS - %stack_number% / 6 - Plot %harvest_number% / 12 - ALIGNING FOR FIRST PLOT, 10, 30, 9
  228. sleep 10
  229. }
  230. else
  231. {
  232. Send {Up up}
  233. break
  234. }
  235. }
  236. }
  237. Loop, 12
  238. {
  239. ToolTip, HARVEST 6 STACKS - %stack_number% / 6 - Plot %harvest_number% / 12 - OPENING PLOT, 10, 30, 9
  240. Send, f
  241. Sleep, 1650
  242. PixelGetColor,Color,1260,104 ; Return / Get the color of the pixel at the X and Y coordinates / at the X and Y location
  243. If Color=0xFFE780 ; 0xFFFFFF is the color White, you need to modify this color to your desired color
  244. {
  245. ToolTip, HARVEST 6 STACKS - %stack_number% / 6 - Plot %harvest_number% / 12 - HARVESTING PLOT, 10, 30, 9
  246. MouseClick, left, 1322, 177
  247. Sleep, 75
  248. send, trap
  249. Sleep, 75
  250. MouseClick, left, 1475, 189
  251. Sleep, 75
  252. Send, f
  253. Sleep, 450
  254. ToolTip, HARVEST 6 STACKS - %stack_number% / 6 - Plot %harvest_number% / 12 - MOVING TO PLOT ABOVE, 10, 30, 9
  255. Send {Up down} ; Press down the up-arrow key.
  256. Sleep 295 ; Keep it down for one second.
  257. Send {Up up} ; Release the up-arrow key.
  258. }
  259. Else
  260. {
  261. ToolTip, HARVEST 6 STACKS - %stack_number% / 6 - Plot %harvest_number% / 12 - NO MORE PLOTS FOUND - MOVING ON, 10, 30, 9
  262. break
  263. }
  264. harvest_number++
  265. }
  266. harvest_number := 1
  267. stack_number++
  268. ToolTip, HARVEST 6 STACKS - %stack_number% / 6 - Plot %harvest_number% / 12 - NO MORE PLOTS FOUND MOVING ON TO NEXT STACK, 10, 30, 9
  269. Send {a down}
  270. sleep 1100
  271. Send {a up}
  272. sleep 100
  273. }
  274. stack_number := 1
  275. Tooltip, , , , 9
  276. return
  277.  
  278. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  279. ;; Move left, to test distatnces
  280. ;; Press F10 to start
  281.  
  282. F10::
  283. Send {a down}
  284. sleep 900
  285. Send {a up}
  286. sleep 100
  287. return
  288.  
  289. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  290.  
  291. ^!z:: ; Control+Alt+Z hotkey.
  292. MouseGetPos, MouseX, MouseY
  293. PixelGetColor, color, %MouseX%, %MouseY%
  294. MsgBox The color at the current cursor position %MouseX% %MouseY% is %color%.
  295. return
  296.  
  297. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  298. ;; Kill app if tthings go wrong
  299. ;; Press F11
  300.  
  301. F11::ExitApp ;Escape key will exit... place this at the bottom of the script
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement