Choice adventure command being repeated

Zitim

New member
I have a script that goes to Spring Break Beach, part of which acquires and uses an Ultimate Mind Destroyer. It used to work just fine, but lately it appears to be repeating a command and giving me an error.

Here is the snippet of script:

print("Using it on Broden....","blue");
use(1,$item[Ultimate Mind Destroyer]);
visit_url("choice.php?whichchoice=920&option=3&pwd");

Here is the output from the Mafia window:

Using it on Broden....
Using 1 Ultimate Mind Destroyer...
Encounter: Eraser
Finished using 1 Ultimate Mind Destroyer.
Whoops! You're not actually in a choice adventure

Here is the output from the session log:

> Using it on Broden....
use 1 Ultimate Mind Destroyer
Encounter: Eraser
Took choice 920/3: reset Broden quests
choice.php?whichchoice=920&option=3&pwd
Took choice 920/3: reset Broden quests
choice.php?whichchoice=920&option=3&pwd

The script is only responding to the choice adventure (Eraser) once, which should be enough. The log indicates Mafia is trying to do it twice, and the second time triggers the error and stops the script. Is this a bug, or am I missing something? I swear this used to work with no problem.
 

Zitim

New member
If I type that into the CLI, it says "3".

Which is interesting, because I don't have a "set choiceAdventure920=3" anywhere in my script. Unless I did it manually at some point and then forgot.

So does that mean Mafia is automatically making that choice when I use the item, and then my manual choice causes the error? I guess I thought the automatic choice presets only applied when using adventure.php.
 
Last edited:

Veracity

Developer
Staff member
That is your issue.

When you "use" the item, it automates the choice for you.
And then you try to manually do the choice, but it is no longer in the choice.

You could leave it at 3 and remove the visit_url that does the choice.

Or, maybe, you could set it to 0 (which is the default for that property) and keep the visit_url - or, better, replace it with run_choice(3).
 

Zitim

New member
Thank you for the explanation. I wasn't familiar with run_choice() either; I've just been using visit_url. I learned something today.
 
Top