Archaeologist's Spade

I think I've made this way more complicated than it needs to be, and it doesn't really work very well. Any tips?

Code:
if ( get_property("_archSpadeDigs").to_int() < 11 ) {
    set_property( "choiceAdventure1596", "2" );
    cli_execute( "use archaeologist's spade" );
    while ( get_property("_archSpadeDigs").to_int() < 11 ) {
        catch {
            run_choice(2);
        }
    }
    set_property( "choiceAdventure1596", "4" );
    catch {
        run_choice(4);
    }
}

I know someone already asked about a cli command to use the spade, and were told to just use the standard choice adventures, but despite my best efforts I seem to be having trouble with that. If a cli command is thoroughly non-trivial, it would be much appreciated.
 
You can put this in your choiceAdventureScript:
Code:
        case 1596: // archaeologist's spade
                while (get_property("_archSpadeDigs").to_int() < 11) {
                    run_choice(2); // dig up something ancient
                }
                run_choice(4); // i'm done digging
                break;

Then just use the spade.
 
I don't actually have a choiceAdventureScript, although I suppose there's nothing stopping me making one; thank you for providing a solution.

Thing is, I had what you've put in my logout script, but I was getting errors about there being no such choice, so I ended up putting in the catch {} parts, then in desperation the set_property parts. Of course, by that time I'd run out of spade digs to test it with.

How can I just run the choices as part of my normal logout script?
 
I was also having trouble with it until I use the choiceAdventureScript solution. One alternative might be to exclusively use visit_url instead of run_choice. But I'm probably missing something obvious.
 
Back
Top