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.
 
Thanks for your help - I'll try the choiceAdventureScript tomorrow and see how it goes.

[Edit: Just to note, you did it beautifully. Thank you!]
 
Last edited:
I did not like using a choice adventure script for this because I did not want to edit my current script nor create some kind of container that managed the spade or called the current script.

Code:
    while ( get_property("_archSpadeDigs").to_int() < 11 ) {
        string url = "inv_use.php?&which=3&whichitem=12184";
        string ignore = visit_url(url);
        run_choice(2);
        run_choice(4);
    }

The above snippet works for me, so far. It is part of my script for managing the spade that will eventually be part of my login or logout process.

I used a while loop because I just wanted to dig everything, but I have tested it where I only wanted to dig once, and that worked. I can imagine a case where a post adventure script checks to see whether the last location has desirable drops or skeletons and uses a variation on this to dig once.
 
Back
Top