# \[Fixed in 2.2\] Autoplay endless loop

**URL:** https://community.puzzlequest3.com/t/fixed-in-2-2-autoplay-endless-loop/3371
**Category:** Bug Reports
**Created:** [April 7, 2023, 7:53pm UTC](https://community.puzzlequest3.com/t/fixed-in-2-2-autoplay-endless-loop/3371 "2023-04-07T19:53:52Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Spacejam](https://sea1.discourse-cdn.com/flex019/user_avatar/community.puzzlequest3.com/spacejam/32/3620_2.png) [@Spacejam](https://community.puzzlequest3.com/u/Spacejam)
#### Post date: [April 7, 2023, 7:53pm UTC](https://community.puzzlequest3.com/t/fixed-in-2-2-autoplay-endless-loop/3371/1 "2023-04-07T19:53:52Z")

</div>

![Screenshot_20230408_034330_Puzzle Quest 3](https://us1.discourse-cdn.com/flex019/uploads/puzzlequest3/original/2X/b/b97552661298280e0ba915a1e3756b620d75073f.jpeg)  
Not a big deal but… no moves available and autoplay tries to cast gravedigger over and over

---

<div class="post-metadata">

### Author: ![Thalinae](https://avatars.discourse-cdn.com/v4/letter/t/7feea3/32.png) [@Thalinae](https://community.puzzlequest3.com/u/Thalinae)
#### Post date: [April 8, 2023, 11:13pm UTC](https://community.puzzlequest3.com/t/fixed-in-2-2-autoplay-endless-loop/3371/2 "2023-04-08T23:13:37Z")

</div>

Let me also chime in for this bug report, as this was actually on my list for quite a while, though not with Gravedigger.

The problem with Autoplay and casting spells is that Autoplay does not check for secondary requirements of a spell. This means that only the spell’s mana requirement is checked when deciding to cast the spell. I noticed this with “Gold Sense”, which requires the presence of Big V gems. If casting this spell is available (enough mana) but no Big V gems are on the board, Autoplay will continuously spam the spell. This leads to: a) no progression and b) [after manual intervention] the error message “Cannot cast that spell” being printed even in the menus after the end of the fight.

Suggested fix for Autoplay:

1. check the mana requirement per spell
2. check the secondary requirements before attempting to cast a spell
3. check optional requirements to assess if casting a spell is valuable

The secondary requirements are:

- gems being present, e.g., for conversion spells or special spells like Gold Sense
- rows / columns / gems being valid as target

Optional requirements are:

- Ultimate Gems on board, e.g., for Spells like Divine Steed, Hellfire Gate, etc.
- Greed / Rage / etc. stacks present (e.g., for Wall of Anger or Greedy Rage)
- Status effect active, e.g., for Acid Cloud: enemy is poisoned / affected by Bad Juju
- …

While 3) would be a real benefit to the autoplay mode for the player, 2) is required to remove endless loops. The current “workaround” for me is to create a dedicated “Autoplay” loadout and manually remove all spells with secondary requirements.
