Advertisement
Guest User

ahk script

a guest
May 1st, 2015
506
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.24 KB | None | 0 0
  1. Code:
  2. #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
  3. SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
  4. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
  5. WinGet, programid, List, FINAL FANTASY
  6.  
  7. CoordMode, ToolTip, Screen
  8.  
  9. ;
  10. ;
  11. ; Please read!
  12. ; When you modify the script for you setup, be sure
  13. ; to leave the "RGB" at the end of the PixelGetColor
  14. ; as well as the "0x" before the RGB values
  15. ; AHK uses BGR by default, but the Window Spy gives RGB values, so I made it easier to use
  16. ;
  17. ; I used and modified brooklynbase's script, so huge thanks to him
  18. ; Feedback would be appreciated @ http://www.mmominion.com/Thread-Gold-Saucer (script's posted on page 13)
  19. ;
  20. ; Deck is: Alphinaud, Urianger, Thancred, Y'shtola, Papalymo
  21. ;
  22. ; -ratdo
  23. ;
  24.  
  25.  
  26. ; Win Z to Start
  27. #Z::
  28.  
  29. ; Create Window Tool Tip to show # of Games
  30. sleep 2000
  31. ControlSend,,{Numpad0}, ahk_id %programid1%
  32. Sleep 2000
  33. ControlSend,,{Numpad0}, ahk_id %programid1%
  34. Sleep 2000
  35. ControlSend,,{Numpad0}, ahk_id %programid1%
  36. Sleep 2000
  37. ControlSend,,{Numpad0}, ahk_id %programid1%
  38. Sleep 2500
  39. ControlSend,,{Numpad0}, ahk_id %programid1%
  40. Sleep 2000
  41. ControlSend,,{Numpad0}, ahk_id %programid1%
  42. Sleep 2000
  43. ControlSend,,{Numpad0}, ahk_id %programid1%
  44.  
  45. Loop
  46. {
  47. Sleep 10500
  48.  
  49. ; Game started, Alphinaud
  50.  
  51. {
  52. Sleep 2500
  53. PixelGetColor, color, 1115, 657, RGB ; Put a color with respective coords from empty bottom right
  54. if color = 0xC8C9C1
  55. {
  56. Click, 484, 526 ; Pick up Alphinaud
  57. Sleep 1
  58. Click, 484, 526 ; Pick up Alphinaud
  59. Sleep 1
  60. Click, 1115, 657 ; Drop Alphinaud bottom right
  61. }
  62. else
  63. {
  64. PixelGetColor, color, 980, 658, RGB ; Put a color with respective coords from empty middle bottom
  65. if color = 0xDEDFD6
  66. {
  67. Click, 484, 526 ; Pick up Alphinaud
  68. Sleep 1
  69. Click, 484, 526 ; Pick up Alphinaud
  70. Sleep 1
  71. Click, 980, 658 ; Drop Alphinaud middle bottom
  72. }
  73. else
  74. {
  75. Click, 484, 526 ; Pick up Alphinaud
  76. Sleep 1
  77. Click, 484, 526 ; Pick up Alphinaud
  78. Sleep 1
  79. Click, 844, 658 ; Drop Alphinaud bottom left
  80. }
  81. }
  82. }
  83.  
  84. Sleep 5500 ; Imperial turn
  85.  
  86. ; Our turn, Urianger
  87.  
  88. {
  89. Sleep 2500
  90. PixelGetColor, color, 980, 523, RGB ; Put a color with respective coords from empty middle
  91. if color = 0xB9B8AD
  92. {
  93. Click, 598, 521 ; Pick up Urianger
  94. Sleep 1
  95. Click, 598, 521 ; Pick up Urianger
  96. Sleep 1
  97. Click, 980, 523 ; Drop Urianger middle
  98. }
  99. else
  100. {
  101. PixelGetColor, color, 1117, 521, RGB ; Put a color with respective coords from empty middle right
  102. if color = 0xD6D6CB
  103. {
  104. Click, 598, 521 ; Pick up Urianger
  105. Sleep 1
  106. Click, 598, 521 ; Pick up Urianger
  107. Sleep 1
  108. Click, 1117, 521 ; Drop Urianger middle right
  109. }
  110. else
  111. {
  112. Click, 598, 521 ; Pick up Urianger
  113. Sleep 1
  114. Click, 598, 521 ; Pick up Urianger
  115. Sleep 1
  116. Click, 980, 658 ; Drop Urianger middle bottom
  117. }
  118. }
  119. }
  120.  
  121. Sleep 6000 ; Imperial turn
  122.  
  123. ; Our turn, Thancred
  124.  
  125. {
  126. Sleep 2500
  127. PixelGetColor, color, 1115, 387, RGB ; Put a color with respective coords from empty top right
  128. if color = 0xB9B8AD
  129. {
  130. Click, 703, 524 ; Pick up Thancred
  131. Sleep 1
  132. Click, 703, 524 ; Pick up Thancred
  133. Sleep 1
  134. Click, 1115, 387 ; Drop Thancred top right
  135. }
  136. else
  137. {
  138. PixelGetColor, color, 978, 385, RGB ; Put a color with respective coords from empty top middle
  139. if color = 0xD6D6CB
  140. {
  141. Click, 703, 524 ; Pick up Thancred
  142. Sleep 1
  143. Click, 703, 524 ; Pick up Thancred
  144. Sleep 1
  145. Click, 978, 385 ; Drop Thancred top middle
  146. }
  147. else
  148. {
  149. Click, 703, 524 ; Pick up Thancred
  150. Sleep 1
  151. Click, 703, 524 ; Pick up Thancred
  152. Sleep 1
  153. Click, 843, 385 ; Drop Thancred top left
  154. }
  155. }
  156. }
  157.  
  158. Sleep 5500 ; Imperial turn
  159.  
  160. ; Our turn, Yshtola
  161.  
  162. {
  163. Sleep 2500
  164. PixelGetColor, color, 980, 658, RGB ; Put a color with respective coords from empty middle bottom
  165. if color = 0xDEDFD6
  166. {
  167. Click, 537, 659 ; Pick up Yshtola
  168. Sleep 1
  169. Click, 537, 659 ; Pick up Yshtola
  170. Sleep 1
  171. Click, 980, 658 ; Drop Yshtola middle bottom
  172. }
  173. else
  174. {
  175. PixelGetColor, color, 844, 659, RGB ; Put a color with respective coords from empty bottom left
  176. if color = 0xB9B8AD
  177. {
  178. Click, 537, 659 ; Pick up Yshtola
  179. Sleep 1
  180. Click, 537, 659 ; Pick up Yshtola
  181. Sleep 1
  182. Click, 844, 659 ; Drop Yshtola bottom left
  183. }
  184. else
  185. {
  186. PixelGetColor, color, 845, 521, RGB ; Put a color with respective coords from empty middle left
  187. if color = 0xD6D6CB
  188. {
  189. Click, 537, 659 ; Pick up Yshtola
  190. Sleep 1
  191. Click, 537, 659 ; Pick up Yshtola
  192. Sleep 1
  193. Click, 845, 521 ; Drop Yshtola middle left
  194. }
  195. else
  196. {
  197. Click, 537, 659 ; Pick up Yshtola
  198. Sleep 1
  199. Click, 537, 659 ; Pick up Yshtola
  200. Sleep 1
  201. Click, 845, 385 ; Drop Yshtola top left
  202. }
  203. }
  204. }
  205. }
  206.  
  207. Sleep 8500 ; Imperial turn
  208.  
  209. ; If Imperial played first, we won't be playing Papalymo, we will set up next game
  210. ; Else we will play our last Papalymo card
  211. ; Here I used the timer bar in our side to know if we have to play or not, the color & coords are from around 30% of the bar (If it's yellow/green, then we can play, so we play. If not, we don't play)
  212.  
  213. PixelGetColor, color, 641, 619, RGB
  214. if color = 0x3A5A7A
  215. {
  216. PixelGetColor, color, 844, 659, RGB ; Put a color with respective coords from empty bottom left
  217. if color = 0xB9B8AD
  218. {
  219. Click, 625, 676 ; Pick up Papalymo
  220. Sleep 1
  221. Click, 625, 676 ; Pick up Papalymo
  222. Sleep 1
  223. Click, 844, 659 ; Drop Papalymo bottom left
  224. Sleep 6000
  225. }
  226. else
  227. {
  228. PixelGetColor, color, 845, 521, RGB ; Put a color with respective coords from empty middle left
  229. if color = 0xD6D6CB
  230. {
  231. Click, 625, 676 ; Pick up Papalymo
  232. Sleep 1
  233. Click, 625, 676 ; Pick up Papalymo
  234. Sleep 1
  235. Click, 845, 521 ; Drop Papalymo middle left
  236. Sleep 6000
  237. }
  238. else
  239. {
  240. PixelGetColor, color, 978, 385, RGB ; Put a color with respective coords from empty top middle
  241. if color = 0xD6D6CB
  242. {
  243. Click, 625, 676 ; Pick up Papalymo
  244. Sleep 1
  245. Click, 625, 676 ; Pick up Papalymo
  246. Sleep 1
  247. Click, 978, 385 ; Drop Papalymo top middle
  248. Sleep 6000
  249. }
  250. else
  251. {
  252. PixelGetColor, color, 1117, 521, RGB ; Put a color with respective coords from empty middle right
  253. if color = 0xD6D6CB
  254. {
  255. Click, 625, 676 ; Pick up Papalymo
  256. Sleep 1
  257. Click, 625, 676 ; Pick up Papalymo
  258. Sleep 1
  259. Click, 1117, 521 ; Drop Papalymo middle right
  260. Sleep 6000
  261. }
  262. else
  263. {
  264. Click, 625, 676 ; Pick up Papalymo
  265. Sleep 1
  266. Click, 625, 676 ; Pick up Papalymo
  267. Sleep 1
  268. Click, 845, 385 ; Drop Papalymo top left
  269. Sleep 6000
  270. }
  271. }
  272. }
  273. }
  274. }
  275. else
  276. {
  277. Sleep 1
  278. }
  279. PixelGetColor, color, 835, 289, RGB ; Rematch check
  280. if color = 0x474A47
  281. {
  282. Click, 889, 501 ; Rematch button
  283. Sleep 1
  284. Click, 889, 501 ; Rematch button
  285. Sleep 1
  286. Click, 889, 501 ; Rematch button
  287. }
  288. else
  289. {
  290. Sleep 1000
  291. Click, 889, 501 ; Rematch button
  292. Sleep 1
  293. Click, 889, 501 ; Rematch button
  294. Sleep 1
  295. Click, 889, 501 ; Rematch button
  296. }
  297. Sleep 2500
  298. PixelGetColor, color, 911, 578, RGB ; Match info check
  299. if color = 0x4E4E25
  300. {
  301. Click, 870, 644 ; Confirm button
  302. Sleep 1
  303. Click, 870, 644 ; Confirm button
  304. Sleep 1
  305. Click, 870, 644 ; Confirm button
  306. }
  307. else
  308. {
  309. Sleep 1000
  310. Click, 870, 644 ; Confirm button
  311. Sleep 1
  312. Click, 870, 644 ; Confirm button
  313. Sleep 1
  314. Click, 870, 644 ; Confirm button
  315. }
  316. Sleep 2500
  317. PixelGetColor, color, 1052, 387, RGB ; Deck screen check
  318. if color = 0xFEEED9
  319. {
  320. Click, 967, 377 ; First deck selected
  321. Sleep 1
  322. Click, 967, 377 ; First deck selected
  323. Sleep 1
  324. Click, 967, 377 ; First deck selected
  325. }
  326. else
  327. {
  328. Sleep 1000
  329. Click, 967, 377 ; First deck selected
  330. Sleep 1
  331. Click, 967, 377 ; First deck selected
  332. Sleep 1
  333. Click, 967, 377 ; First deck selected
  334. }
  335. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement