Created
June 27, 2017 10:38
-
-
Save fanthos/2db2ea4260459dd96b76d974ff672598 to your computer and use it in GitHub Desktop.
Plants vs Zombie keyboard shortcut
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #IfWinActive, Plants vs. Zombies | |
| CoordMode, Mouse, Client | |
| SetMouseDelay, 0 | |
| SetDefaultMouseSpeed, 0 | |
| ClickAndRet(x) { | |
| MouseGetPos, xold, yold | |
| MouseMove, x*60+60, 40 | |
| MouseClick | |
| MouseMove, xold, yold | |
| MouseClick | |
| } | |
| 1::ClickAndRet(1) | |
| 2::ClickAndRet(2) | |
| 3::ClickAndRet(3) | |
| 4::ClickAndRet(4) | |
| 5::ClickAndRet(5) | |
| 6::ClickAndRet(6) | |
| 7::ClickAndRet(7) |
Author
@Goldentaco11797
You are right.
The numbers are calculated by actual mouse position for left most and right most buttons and calculated by hand.
I got my numbers by only a few of calculate.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I don't use this site so i hope this isn't poor etiquette for a reply section but here's what i came up with that works. It's for 1920x1080 fullscreen. You can use AHK window spy which is installed with AHK by default to find the coordinates and make the calculations to adjust in
xpos := x * 106 + 332.xis the number of the column106is the horizontal distance between centers of columns and+ 332is the offset from the left edge of the screen to the center of the first column minus 106. I'm not sure why the formula was structured like that in the initial post but I just ran with it, it's probably optimal and I just don't understand it. Basically find the center of the first column (cofc), the center of the second column, third, fourth, and more if you'd like, then average it out to find106then take the cofc (which is 438) - 106, that is your332. I also added the rest of the missing columns and a kill script code even if its a bit pointless. I removed the second mouseclick because it seemed to grab the plant and then plant it when it returns automatically.#IfWinActive, Plants vs. Zombies
CoordMode, Mouse, Client
SetMouseDelay, 0
SetDefaultMouseSpeed, 0
ClickAndRet(x) {
MouseGetPos, xold, yold
MouseMove, x*106+332, 80
MouseClick
MouseMove, xold, yold
}
1::ClickAndRet(1)
2::ClickAndRet(2)
3::ClickAndRet(3)
4::ClickAndRet(4)
5::ClickAndRet(5)
6::ClickAndRet(6)
7::ClickAndRet(7)
8::ClickAndRet(8)
9::ClickAndRet(9)
f12::exitapp