Faerie Solitaire

Faerie Solitaire

124 ratings
Collect all eggs quickly with AutoHotkey
By Glodenox
Inspired by DeniskaboY's guide to automizing the game for the last two achievements, I went ahead and created a script that can be used in AutoHotkey.
   
Award
Favorite
Favorited
Unfavorite
Introduction
The last two achievements had been eating up quite a bit of my time already and I was starting to get annoyed with the game as I wasn't seeing any progress being made. Luckily DeniskaboY made the following guide to automate the gathering of eggs:
http://cs2bus.com/sharedfiles/filedetails/?id=162424942
This inspired me to write this guide and what I feel to be a big improvement on his script.

I tried the application DeniskaboY was referring to, but sadly enough I couldn't get it to work properly and it also seemed to be having problems whenever your screen resolution is different from his. As a programmer, I felt like I had to be able to find a better solution, which I found in AutoHotkey.

I like getting achievements and I don't mind spending a bunch of time on them. But I don't like it if there is no progress to be seen and all is down to pure luck. Therefore, I feel that achievements like All Grown Up and Hatch 'em All are just begging to be automated.

AutoHotkey
AutoHotkey is an application purely focused on automizing actions. It allows you to write scripts that perform actions that would normally require a lot of manual labour. You could for example bind the script to a certain hotkey combination and then let it perform a whole bunch of actions almost instantly (which is sadly enough sometimes done to cheat in games).

AutoHotkey can however be used in practically whichever way you want, so I've written a script for Faerie Solitaire that attempts to solve the first level of "Red Reef" ad infinitum. The nice thing about AutoHotkey scripts is that they can be structured and readable instead of just being a list of random click locations. These scripts can even be turned into an executable file to make it even more accessible (from the quick launch bar for example).

AutoHotkey can be obtained from http://www.autohotkey.com/ and should be installable on all platforms. I will let you figure out yourself which way you want to configure AutoHotkey. I simply replaced the contents of the AutoHotkey.ahk file that gets generated on the first start-up of the application.
Preparation and installing the script
Preparation
There are a couple of things you should do keep in mind before you start the script:
  • The script assumes you are running the game in window modus, not in fullscreen modus. This should solve the issue of different screen resolutions.
  • The script works at its best on the first level of the Red Reef section. It will continually restart this level as well.
  • You can always stop the script by pressing the Escape button. It is set to run until the end of times unless you tell it to stop.
  • You can't perform any other tasks on the same computer while the script is running, I'm afraid. You can keep other windows open or watch a movie if you want to, but the script will require focus on the game window to work. I've been looking into the ClickControl command of AutoHotkey, but so far I haven't managed to get it running that way. ClickControl would allow the click events to be sent to the game even while the window isn't visible.
  • The script will activate from the moment you make the Faerie Solitaire window active. (thanks to Wondy aka Sh1tt1ng Master! for this method!)

Installation
After installing AutoHotkey, the program should ask whether you want to generate an example script. When you select Yes, the application will open notepad with the contents of the script. If you replace the contents there with the script in the next section, you'll automatically start the script when you start AutoHotkey.
The script
I've tried to add comments where useful, but I think the code should speak for itself. Feel free to modify, share, etc. This script is so small, I'm not even going to care one second if someone claims they wrote this...

; This script expects to be started on the first level of Red Reef ; The objectives window will automatically be closed SetDefaultMouseSpeed,0 WinWaitActive, Faerie Solitaire™ by Subsoap™ ; Alternative solution: wait 10 seconds before starting the script: ;Sleep, 10000 Run() ; To stop the application at any time, simply press the Escape button Escape::ExitApp ;Run the whole application indefinitely Run() { RemoveObjectivesWindow() while true { ; Go through the first 12 deck cards only, more is usually a waste of time Loop 12 { ClickAllCardsSeveralTimes() GetNewCard() } ClickAllCardsSeveralTimes() ; Needed only for when we've had a perfect game ContinueFinishedGame() RemoveObjectivesWindow() RestartGame() } } ; Go to menu, Restart Game, Confirm, Wait for it to start RestartGame() { Click,127,582 Sleep,100 Click,740,562 Sleep,50 Click,329,409 Sleep,1500 RemoveObjectivesWindow() } ClickAllCardsSeveralTimes() { ; We try clicking all cards 4 times - arbitrary number that seems to work Loop 4 { ClickAllCards() } } ; Close the objectives window ; Not needed if you've disabled this window in the settings RemoveObjectivesWindow() { Click,408,418 Sleep,400 } ; Click all the cards, starting from top left to bottom right ClickAllCards() { Click,101,324 Click,101,284 Click,183,241 Click,274,260 Click,443,241 Click,611,241 Click,697,241 Click,189,394 Click,270,329 Click,352,356 Click,443,386 Click,528,347 Click,528,317 Click,609,383 Click,705,381 } ; Get a new card from the stack GetNewCard() { Click,307,557 Sleep,300 } ; Press the continue button if we've finished the game ContinueFinishedGame() { ; Long wait to cope with a possible perfect game animation Sleep,4000 Click,407,535 Sleep,1500 }
Performance
I've just been running this script for a whole day now and found 4 eggs this way (note that I have all but the last two achievements at this point), so I think it is safe to say that the script works fine. There are several improvements possible most likely.
Some examples:
  • I doubt it is actually useful to go through all the cards in the deck, so you could save some time there by only going through the first 10 or so cards.
  • There is currently a delay after getting a new card from the deck so that the first card clicked can actually be selected. I'm not sure whether this really matters seeing it can be picked up on the second time that all cards get clicked that round. It does feel slightly more natural in my opinion though.
As for actual numbers: I'm afraid I don't really have any. I think it takes about a minute to finish a game, which means 12 chances for an egg each minute (if you get a perfect each time, that is).
104 Comments
PsykaFreak 10 May, 2024 @ 3:50pm 
I know it's been awhile since anyone commented on this, but I have the script and am trying to get it to work. I'm not sure what I'm doing wrong. I copied and pasted the above code into a new notepad and saved it as .ahk. Then I have the game opened in window mode on Red Reef level 1 with the objectives box showing on screen. I start the script and focus the game window and then I see my cursor blinking but nothing happens in the game.
ChrisPhatt 8 Dec, 2021 @ 3:26am 
hi - hope you don't mind but after this proved so useful in Classic, I tweaked it to work for Remastered and posted the new version in a guide here.
just wanted to give credit where credit is due! :)
Schnell 12 Jun, 2021 @ 11:02pm 
Works well. Last two eggs obtained in 2 hours.
I had some trouble executing it. Not sure if it had to do with running the 2018 beta or not. I had to open to Red Reef map, then run AutoHotKey from Start, then run AutoHotKey again. After acknowledging only run instance can run at a time, the second one ran the script. Thank you!
kiphip 12 Mar, 2018 @ 9:37pm 
thanks for giving me my sanity back :100percent::100percent::100percent:
Jackaljacked 28 Dec, 2016 @ 2:01pm 
@Glodenox

Thank you very much! happy new year!
Glodenox  [author] 28 Dec, 2016 @ 5:01am 
@Jackaljacked: it's been several years since I made this script, but I think it works with Quick Play only. I seem to remember you get exp for your pets even if it restarts, I'm not sure about money.
Jackaljacked 27 Dec, 2016 @ 11:06pm 
@Glodenox

Should i play red reef on quick play or on campaign? also do you get money, exp for pets even if it restarts?
Nado 1 Sep, 2016 @ 8:29am 
I modified the script to finish the first level of Red Reef in 23 seconds. My modification has few sleep timers and digs 13 cards in the deck. At the beginning of the game, it click all cards 3 times, in middlegame it clicks twice, endgame it clicks just a single time. My modification handles fast Perfects and Objective Window.

; This script expects to be started on the first level of Red Reef
; The objectives window will automatically be closed

SetDefaultMouseSpeed,0
WinWaitActive, Faerie Solitaire™ by Subsoap™
Run()

; To stop the application at any time, simply press the Escape button
Escape::ExitApp

;Run the whole application indefinitely
Run() {
while true {
ClickAllCardsTwice()
RemoveObjectivesWindow()
Loop 3 {
ClickAllCards3Times()
GetNewCard()
ContinueFinishedGame()
}
Loop 7 {
ClickAllCardsTwice()
GetNewCard()
ContinueFinishedGame()
}
Loop 3 {
ClickAllCards()
GetNewCard()
ContinueFinishedGame()
}
RestartGame()
}
}

;it continues...
Nado 1 Sep, 2016 @ 8:06am 
;continuation

; Go to menu, Restart Game, Confirm, Wait for it to start
RestartGame() {
Sleep,200
Click,127,582
Sleep,100
Click,740,562
Sleep,50
Click,329,409
Sleep,500
}

; Click all the cards, starting from top left to bottom right
ClickAllCards() {
Click,101,324
Click,101,284
Click,183,241
Click,274,260
Click,443,241
Click,611,241
Click,697,241
Click,189,394
Click,270,329
Click,352,356
Click,443,386
Click,528,347
Click,528,317
Click,609,383
Click,705,381
}

ClickAllCardsTwice() {
Loop 2 {
ClickAllCards()
}
}

ClickAllCards3Times() {
Loop 3 {
ClickAllCards()
}
}

; Close the objectives window
RemoveObjectivesWindow() {
Click,408,418
Sleep,100
}

; Get a new card from the stack
GetNewCard() {
Click,307,557
Sleep,200
}

; Press the continue button if we've finished the game
ContinueFinishedGame() {
Click,407,535
}
DoomEager 3 Jul, 2016 @ 10:03am 
Thanks for this! Got the last 3 eggs with this method within 22 hours. I timed myself and the script and it's almost twice as efficient as I am, so it would have taken me about 44 hours to do by hand… with good luck. Gross!

I did have to make a couple modifications though. I added a Sleep,500 at the beginning of GetNewCard, because the animation for pulling a card onto your stack after a successful click sometimes blocked drawing the new card, making the next click cycle a waste. However, I gained back that speed loss by changing from 4 to 2 click-loops per card draw. It seems to work just as well because the likelihood of a card triggering a large combo in later hands is very, very low, so the extra 2 loops are, on average, useless. Changing to 2 loops almost halves the bottleneck in execution time.

@Shrodu Like T Fish my click coordinates also needed adjusting. Thanks for sharing your fix.