What is causing this "Stack overflow during ASH script"?

BigNinja

New member
Hi guys, Newbie coder here--

I wrote this small script to remove Cunctatitis automatically, and it used to work just fine. Recently after updating KoLmafia, I get a "stack overflow" error message whenever it gets to the 'else' clause. Any idea what's causing this problem?

Code:
if (to_int(get_property ("_hotTubSoaks")) < 5 && item_amount($item[clan vip lounge key]) > 0) 
 {
	cli_execute("hottub");
 }

else
 {
	print("Removing Cunctatitis","blue");
	cli_execute("uneffect cunctatitis");
 }

It visits the hottub just fine, but whenever it runs out of hottub uses it prints "Removing Cunctatitis" many times and crashes.
Also, when I disable this script and type "uneffect cunctatitis" in the CLI, it works fine.

Thanks,
BigNinja
 

holatuwol

Developer
Someone's reported this previously, but I haven't been able to reproduce it. The latest build should give us some more information on why the stack trace happens?
 

jasonharper

Developer
If you have this script in your current mood as the action for "when I gain an effect", "Cunctatitis", it becomes the action mafia will take for any request to uneffect Cunctatitis. Since the script makes such a request itself, an infinite recursion results. I don't have time to look into it further right now, will try to do so this evening if nobody's beaten me to it.
 

holatuwol

Developer
Oh, it was a totally different problem with the same symptom? I'll try to beat you to it with 10665!

Edit: Thought of another recursion that could result from my fix, so 10666!
 
Last edited:

BigNinja

New member
I downloaded the latest build and it works like a charm now. Thanks a lot!
I did indeed have the script trigger via moods, so the problem should be solved :)

Thanks,
BigNinja
 
Top