Request: Queen Cookie farming script

Bale

Minion
I was under the impression that the exit; command didn't halt further automation? I'll see what I can find out.

The exit command will exit the script. Link for Great Justice!

Since fianor's script imports this one, his script will be exited when queen() uses the exit command, just as if it was a function in his script. I'd recommend that you use return instead.
 
Last edited:
Update v1.6

Fixed a bug causing an extra potion to be consumed in certain instances. Changed exits to returns. The queen function now has a boolean return and should return true if you actually got the number of cookies requested. I know, intuitive right!? New version.

The exit command will exit the script. Link for Great Justice!

Since fianor's script imports this one, his script will be exited when queen() uses the exit command, just as if it was a function in his script. I'd recommend that you use return instead.

Thank's for the clarification. For the record, I read the wiki, but it still wasn't clear to me. I thought that it exited the 'containing script' (the script containing the exit command), I failed to realize that when using import the script doing the importing becomes the containing script.
 

fianor

Member
and a ninja ninja's me on repairs to his own script twice in one day ... damn ninjas


:) thx for the updates ... look at me being all "bug"findery. Just to verify, it does indeed work well within and import and does not use the 2nd DRINK ME unnecessarily as it did before.
 
Last edited:
:) thx for the updates ... look at me being all "bug"findery. Just to verify, it does indeed work well within and import and does not use the 2nd DRINK ME unnecessarily as it did before.
You're welcome. ;) Thanks for the bug reports and even more for the follow up feedback.
 

PsyMar

Member
I've had a queen cookie script of my own writing (although I borrowed your "turn reflection-of-a-map into queen cookie" code), and it has one feature that I think you're missing -- lag protection. I had it happen once that I got a reflection of a map to drop, only Mafia didn't see the drop message due to lag, and so it used my remaining 250+ adventures without using another drink me potion. As such, my current version sets pendingMapReflections to 0 (and subsequently uses another drink me potion) if you've adventured for X (default 20) turns without a reflection of a map dropping. I've attached my script so you can compare if you wish.

Edit: I should also note that my script is based on "number of turns to use" rather than "number of cookies to get".
 

Attachments

  • queencookie-1.2.ash
    8.8 KB · Views: 52

fianor

Member
Has anyone else tried to use this to get more than 1 cookie in a day? I don't normally, but had a few spare drinkme's in inventory so I decided to farm all I could today. I was watching the gCLI and stopped the script after the 2nd map, because it looks like the script doesn't account for the "only 1 map per potion" bit. I run a lot of +item drop and normally get the map within 2 adv, when it didn't pick one up until the potion wore off I decided to drink all I need manually first then ran the script for 10 cookies. I farmed up the rest of the needed maps, taking no more than 3 adv each and then used the maps as it should.

Like I said, I don't normally do this and it could be just bad rng that one time, but doesn't look like it at first glance here. Just wanted to verify that the script doesn't just burn up what's left of the effect before drinking a new potion now.


[edit]
The script also just went kinda nutty on me. It started outputting something like "Unreasonably complex ... for snapdragon" sorry I don't have the exact phrasing it didn't output in my session as i expected it would and I just killed mafia to stop it from doing whatever it was doing. Every 20 or so of this odd message it output the next line of normal chess solving script, the "#:moves" output I think?

Is this your script or mafia's built in solver doing that bit? should I report this in bugs instead of to you?
[/edit]

[edit 2]

should line 24 be changed to something like this:
if(have_effect($effect[Down the Rabbit Hole]) > 0 && get_property("pendingMapReflections").to_int() > 0) return true;

[/edit2]
 
Last edited:
...it looks like the script doesn't account for the "only 1 map per potion" bit.

Like I said, I don't normally do this and it could be just bad rng that one time, but doesn't look like it at first glance here. Just wanted to verify that the script doesn't just burn up what's left of the effect before drinking a new potion now.

I cannot reproduce this. The script does account for the fact that you can only get 1 map per potion. The script should be using all the required potions before it even starts adventuring. That's what lines 80 - 91 are for.

[edit]
The script also just went kinda nutty on me. It started outputting something like "Unreasonably complex ... for snapdragon" sorry I don't have the exact phrasing it didn't output in my session as i expected it would and I just killed mafia to stop it from doing whatever it was doing. Every 20 or so of this odd message it output the next line of normal chess solving script, the "#:moves" output I think?

Is this your script or mafia's built in solver doing that bit? should I report this in bugs instead of to you?
[/edit]

I have no clue what you're talking about here. Before posting any type of bug report you should try and reproduce the problem and if you can reproduce the issue keep the cli output.

[edit 2]

should line 24 be changed to something like this:
if(have_effect($effect[Down the Rabbit Hole]) > 0 && get_property("pendingMapReflections").to_int() > 0) return true;

[/edit2]

This is unnecessary and will actually cause problems with the use_maps() function.
 
I've had a queen cookie script of my own writing (although I borrowed your "turn reflection-of-a-map into queen cookie" code), and it has one feature that I think you're missing -- lag protection. I had it happen once that I got a reflection of a map to drop, only Mafia didn't see the drop message due to lag, and so it used my remaining 250+ adventures without using another drink me potion. As such, my current version sets pendingMapReflections to 0 (and subsequently uses another drink me potion) if you've adventured for X (default 20) turns without a reflection of a map dropping. I've attached my script so you can compare if you wish.

Thanks for sharing! I've never experienced this sort of lag problem before!? I added in a sanity check. I'm not sure I like the idea of resetting the mafia property however.

Update v1.7

@fianor: Just for good measure I re-factored the potion using logic and adding a few more print statements. Let me know if it works better for you.

Added a sanity redrink to the map farming adventure loop that will drink another potion if pendingMapReflections is zero or if you spend 20 or more adventures trying to get one map.
Also, instead of just buying the required potions it will now try to retrieve them.
Download new version.
 
Last edited:

stannius

Member
I only used this script to turn maps into cookies, but it worked beautifully and saved me mindless clicking. Thanks!
 

Theraze

Active member
This updates version 1.7 of the script to have the drink-me potion to use " rather than the quotation marks, making it validate happier.
 

Attachments

  • queen_cookie.ash
    4.2 KB · Views: 109
Top