Stuck on TT Imp Farm - hya1221 - 04-16-2015
Ive got all my pickup and drop positions accurate and color vaules from AHK Spy... and its still failing on dropping Alphinaud bottom right.
I believe it has to do with ratdo's line:
PixelGetColor, color, 1097, 707, RGB ; Put a color with respective coords from empty bottom right
I'm not sure where his values 1097,707 are coming from.
EDIT: Still tweaking, Yoshola isnt grabbing properly and it only did two matches then my screen seemed all turned sideways. is everyone running 1st or 3rd person viewing when running AHK TT?
Code: #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
WinGet, programid, List, FINAL FANTASY
CoordMode, ToolTip, Screen
;
;
; Please read!
; When you modify the script for you setup, be sure
; to leave the "RGB" at the end of the PixelGetColor
; as well as the "0x" before the RGB values
; AHK uses BGR by default, but the Window Spy gives RGB values, so I made it easier to use
;
; I used and modified brooklynbase's script, so huge thanks to him
; Feedback would be appreciated @ http://www.mmominion.com/Thread-Gold-Saucer (script's posted on page 13)
;
; Deck is: Alphinaud, Urianger, Thancred, Y'shtola, Papalymo
;
; -ratdo
;
; Win Z to Start
#Z::
tooltip, `nCurrent Game # : %A_Index%`n, 0, 0, 1
; Create Window Tool Tip to show # of Games
sleep 1500
ControlSend,,{Numpad0}, ahk_id %programid1%
Sleep 1500
ControlSend,,{Numpad0}, ahk_id %programid1%
Sleep 1500
ControlSend,,{Numpad0}, ahk_id %programid1%
Sleep 1500
ControlSend,,{Numpad0}, ahk_id %programid1%
Sleep 2000
ControlSend,,{Numpad0}, ahk_id %programid1%
Sleep 1500
ControlSend,,{Numpad0}, ahk_id %programid1%
Sleep 1500
ControlSend,,{Numpad0}, ahk_id %programid1%
Loop
{
tooltip, `nCurrent Game # : %A_Index%`n, 0, 0, 1
Sleep 12000
; Game started, Alphinaud
{
Sleep 1500
PixelGetColor, color, 982, 660, RGB ; Put a color with respective coords from empty bottom right
if color = 0x0C8C9C1
{
Click, 345, 525 ; Pick up Alphinaud
Sleep 1
Click, 979, 658 ; Drop Alphinaud bottom right
}
else
{
PixelGetColor, color, 655, 848, RGB ; Put a color with respective coords from empty middle bottom
if color = 0xC6BEAD
{
Click, 345, 525 ; Pick up Alphinaud
Sleep 1
Click, 655, 848 ; Drop Alphinaud middle bottom
}
else
{
Click, 345, 525 ; Pick up Alphinaud
Sleep 1
Click, 706, 655 ; Drop Alphinaud bottom left
}
}
}
Sleep 6000 ; Imperial turn
; Our turn, Urianger
{
Sleep 1500
PixelGetColor, color, 837, 522, RGB ; Put a color with respective coords from empty middle
if color = 0xC8C9C1
{
Click, 453, 519 ; Pick up Urianger
Sleep 1
Click, 837, 522 ; Drop Urianger middle
}
else
{
PixelGetColor, color, 978, 522, RGB ; Put a color with respective coords from empty middle right
if color = 0xD6D6CB
{
Click, 453, 519 ; Pick up Urianger
Sleep 1
Click, 978, 522 ; Drop Urianger middle right
}
else
{
Click, 453, 519 ; Pick up Urianger
Sleep 1
Click, 848, 655 ; Drop Urianger middle bottom
}
}
}
Sleep 6000 ; Imperial turn
; Our turn, Thancred
{
Sleep 1500
PixelGetColor, color, 975, 386, RGB ; Put a color with respective coords from empty top right
if color = 0xBEB8AD
{
Click, 561, 520 ; Pick up Thancred
Sleep 1
Click, 975, 386 ; Drop Thancred top right
}
else
{
PixelGetColor, color, 842, 388, RGB ; Put a color with respective coords from empty top middle
if color = 0xD6D3C8
{
Click, 561, 520 ; Pick up Thancred
Sleep 1
Click, 842, 388 ; Drop Thancred top middle
}
else
{
Click, 561, 520 ; Pick up Thancred
Sleep 1
Click, 708, 395 ; Drop Thancred top left
}
}
}
Sleep 6000 ; Imperial turn
; Our turn, Yshtola
{
Sleep 1500
PixelGetColor, color, 706, 653, RGB ; Put a color with respective coords from empty bottom left
if color = 0xC1C1B7
{
Click, 400, 654 ; Pick up Yshtola
Sleep 1
Click, 706, 653 ; Drop Yshtola bottom left
}
else
{
PixelGetColor, color, 823, 571, RGB ; Put a color with respective coords from empty middle left
if color = 0xDEDFD6
{
Click, 400, 654 ; Pick up Yshtola
Sleep 1
Click, 823, 571 ; Drop Yshtola middle left
}
else
{
Click, 400, 654 ; Pick up Yshtola
Sleep 1
Click, 708, 395 ; Drop Yshtola top left
}
}
}
Sleep 6000 ; Imperial turn
; If Imperial played first, we won't be playing Papalymo, we will set up next game
; Else we will play our last Papalymo card
; 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)
PixelGetColor, color, 511, 653, RGB
if color = 0xC8C9C1
{
Click, 655, 848 ; Select Papalymo then place him in final spot
Sleep 1500
ControlSend,,{Numpad0}, ahk_id %programid1%
Sleep 1500
ControlSend,,{Numpad0}, ahk_id %programid1%
Sleep 1500
ControlSend,,{Numpad0}, ahk_id %programid1%
Sleep 5000
ControlSend,,{Numpad0}, ahk_id %programid1%
Sleep 1500
ControlSend,,{Numpad0}, ahk_id %programid1%
Sleep 1500
ControlSend,,{Numpad0}, ahk_id %programid1%
Sleep 1500
ControlSend,,{Numpad0}, ahk_id %programid1%
Sleep 1500
}
else
{
ControlSend,,{Numpad0}, ahk_id %programid1%
Sleep 1500
ControlSend,,{Numpad0}, ahk_id %programid1%
Sleep 1500
ControlSend,,{Numpad0}, ahk_id %programid1%
Sleep 1500
ControlSend,,{Numpad0}, ahk_id %programid1%
}
}
RE: Stuck on TT Imp Farm - zonk - 04-23-2015
Those values are the coordinates of the empty square for bottom right. They're different for everyone. I don't think the camera perspective matters but I'm in 3rd person and it works. But I am still tweaking as well, it works perfectly for a few games but I just had it bug out after game 10. I think AHK itself can be a bit finicky.
|