03-19-2015, 08:09 PM
(This post was last modified: 03-19-2015, 08:13 PM by brooklynbase.)
Hey guys, I've tried my hand at scripting a flawless MGP farm with the Imperial NPC in Mor Dhona. I'm still an amateur at scripting but I can understand what's happening when something works. Here's what I've come up with so far using this deck in this order (make sure this deck is deck #1 in your saved deck list):
Here is the script I've come up with (note it's currently far from perfect):
I'm not too worried about the card placement and strategy at this point, although I do know a 100% win rate with this deck. I would like the script to run uninterupted first with all possible placements covered.
Currently it seems to work up until after the Y'shtola placement, depending on if the NPC went first or not. It probably needs a few if/else placements in there I'm guessing but I do need a fresh eye to look over it.
I'm running these tests in 1024x768 windowed mode, so you might have to adapt the coordinates and colour info to match your own.
So I'm essentially looking for people willing to help me perfect this script (or give it an overhaul if needed). The MGP farm is cruel right now so it would be nice to have some guaranteed overnight MGP income!
Here is the script I've come up with (note it's currently far from perfect):
PHP 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
; Win Z to Start
#Z::
Loop
{
tooltip, `nCurrent Game # : %A_Index%`n, 0, 0
; 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 1500
ControlSend,,{Numpad0}, ahk_id %programid1%
Sleep 1500
ControlSend,,{Numpad0}, ahk_id %programid1%
Sleep 1500
ControlSend,,{Numpad0}, ahk_id %programid1%
Sleep 12000
; Game started, Alphinaud
{
PixelGetColor, color, 182, 416
if color = 0x7d5c3d
{
Click, 180, 430 ; Pick up Alphinaud
Sleep 1500
Click, 650, 425 ; Drop Alphinaud bottom right
Sleep 1500
Click, 180, 430 ; Pick up Alphinaud
Sleep 1500
Click, 510, 425 ; Drop Alphinaud middle bottom
}
}
Sleep 7000 ; Imperial turn
; Our turn, Urianger
{
PixelGetColor, color, 157, 284
if color = 0x785638
{
Click, 125, 300 ; Pick up Urianger
Sleep 1500
Click, 510, 280 ; Drop Urianger middle
Sleep 1500
Click, 125, 300 ; Pick up Urianger
Sleep 1500
Click, 650, 280 ; Drop Urianger middle right
Sleep 1500
Click, 125, 300 ; Pick up Urianger
Sleep 1500
Click, 510, 425 ; Drop Urianger middle bottom
}
}
Sleep 7000 ; Imperial turn
; Our turn, Thancred
{
PixelGetColor, color, 203, 288
if color = 0x785638
{
Click, 235, 300 ; Pick up Thancred
Sleep 1500
Click, 650, 145 ; Drop Thancred top right
Sleep 1500
Click, 235, 300 ; Pick up Thancred
Sleep 1500
Click, 510, 145 ; Drop Thancred top middle
Sleep 1500
Click, 235, 300 ; Pick up Thancred
Sleep 1500
Click, 375, 145 ; Drop Thancred top left
}
}
Sleep 7000 ; Imperial turn
; Our turn, Yshtola
{
PixelGetColor, color, 43, 469
if color = 0x725432
{
Click, 70, 430 ; Pick up Yshtola
Sleep 1500
Click, 375, 425 ; Drop Yshtola bottom left
Sleep 1500
Click, 70, 430 ; Pick up Yshtola
Sleep 1500
Click, 375, 280 ; Drop Yshtola middle left
Sleep 1500
Click, 70, 430 ; Pick up Yshtola
Sleep 1500
Click, 375, 145 ; Drop Yshtola top left
}
}
Sleep 7000 ; Imperial turn
; Our turn, Papalymo
{
ControlSend,,{Numpad4}, ahk_id %programid1%
Sleep 1500
ControlSend,,{Numpad4}, ahk_id %programid1%
Sleep 1500
ControlSend,,{Numpad4}, ahk_id %programid1%
Sleep 1500
ControlSend,,{Numpad4}, ahk_id %programid1%
Sleep 1500
ControlSend,,{Numpad0}, ahk_id %programid1%
Sleep 1500
ControlSend,,{Numpad0}, ahk_id %programid1%
Sleep 7000
}
}
I'm not too worried about the card placement and strategy at this point, although I do know a 100% win rate with this deck. I would like the script to run uninterupted first with all possible placements covered.
Currently it seems to work up until after the Y'shtola placement, depending on if the NPC went first or not. It probably needs a few if/else placements in there I'm guessing but I do need a fresh eye to look over it.
I'm running these tests in 1024x768 windowed mode, so you might have to adapt the coordinates and colour info to match your own.
So I'm essentially looking for people willing to help me perfect this script (or give it an overhaul if needed). The MGP farm is cruel right now so it would be nice to have some guaranteed overnight MGP income!