Page 6 of 6 FirstFirst ... 4 5 6
Results 51 to 58 of 58

Thread: MONSTERID in fights.

  1. #51
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    13,379

    Default

    Whoah. Looking at VMF, here is how I automate the Witchess fights:

    Code:
    	while ( fights-- > 0 ) {
    	    monster fight = monsters[ index++ ];
    	    between_battle_checks();
    	    visit_url( "campground.php?action=witchess" );
    	    run_choice( 1 );
    	    visit_url( "choice.php?whichchoice=1182&option=1&piece=" + fight.id + "&pwd=" + my_hash(), false );
    	    string filter = choose_combat_filter( NO_LOCATION );
    	    run_combat( filter );
    
    	    // If we detected paranormal activity after that fight, may as well bust the ghost now.
    	    bust_ghost();
    	}
    Same thing your code does - except mine actually calls run_combat() after starting the fight, and yours does not. You are depending on the next iteration of your loop going to campground.php, which redirects to fight.php - with a twiddle - and automating the fight there.

    I consider that to be a bug.

    I'll see how my witchess fight function works tomorrow with eldritch free fights.
    I bet run_combat() will do the correct thing.

    Both you and I are submitting the choice via visit_url with a GET.
    run_choice() doesn't do that, so, the simple method to submit extra fields may not work.
    I'll experiment with that, too.

  2. #52
    Senior Member MCroft's Avatar
    Join Date
    Feb 2009
    Posts
    102

    Default Also getting a loop with latest build.

    I don't know if it's the same looping effect, but I'm also seeing a loop. I was using the Adventure tab of the main interface to automate the 3 items on the F'c'le and it went into a loop.
    Log: Partial_DEBUG_LOG_20200715_MC.txt

    Several Hundred of these gCLI entries before I declared World Peace. I wasn't scripting, just using the convenience buttons.

    339] The F'c'le
    Encounter: cleanly pirate

    Request 1 of 2 (Island: The F'c'le) in progress...

    [339] The F'c'le
    Encounter: cleanly pirate

    Request 1 of 2 (Island: The F'c'le) in progress...

    [339] The F'c'le
    Encounter: cleanly pirate

    Request 1 of 2 (Island: The F'c'le) in progress...

  3. #53
    Senior Member
    Join Date
    Oct 2013
    Posts
    253

    Default

    Wups, that was a bad cut-paste on my part. Corrected:
    Code:
    while(get_property("_witchessFights").to_int() < 5) {visit_url("campground.php?action=witchess");run_choice(1);visit_url("choice.php?option=1&pwd="+my_hash()+"&whichchoice=1182&piece=1936",false);run_combat();}run_combat();
    I've gotten too used to having IDE's watch for balancing brackets for me.

    So that uses the run_combat() after visit_choice() too. I can't remember now why I put one more run_combat() outside the loop. I think it handles one last eldritch fight that way. I've done the same thing for other areas (machine tunnels, neverending party). Those run later in the script.

  4. #54
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    13,379

    Default

    Yes. run_combat() does a single fight. If you are in a multi-fight, you have to run it again to handle the next fight.
    You script depends on visiting campground.php redirecting to a fight and, somehow, finishing it for you.
    As it happens, visiting campground.php twiddles.

    After eating an eldritch mushroom pizza and using a PYEC to end up with a total of 6 turns of Eldritch Attunement, I tested like this:

    Code:
    if ( get_property( "_witchessFights" ).to_int() < 5 ) {
        print( "Visiting Witchess Set in campground" );
        visit_url( "campground.php?action=witchess" );
        print( "Examining shrink ray" );
        run_choice( 1 );
        print( "Fighting a Witchess Knight" );
        visit_url( "choice.php?option=1&pwd="+my_hash()+"&whichchoice=1182&piece=1936", false );
        run_combat();
        while ( in_multi_fight() ) {
    	print( "In a multi-fight" );
    	run_combat();
        }
    }
    and got this:

    Code:
    > Visiting Witchess Set in campground
    
    [3746] Your Witchess Set
    > Examining shrink ray
    Took choice 1181/1: Examine the shrink ray
    Encounter: Play against the Witchess Pieces
    > Fighting a Witchess Knight
    Took choice 1182/1: Play against the Witchess pieces
    Encounter: Witchess Knight
    Round 0: Veracity wins initiative!
    Round 1: Veracity executes a macro!
    Round 1: Veracity attacks!
    Round 2: You lose 8 hit points
    Round 2: Witchess Knight takes 9 damage.
    Round 2: Veracity attacks!
    Round 3: Witchess Knight takes 7 damage.
    Round 3: Veracity wins the fight!
    After Battle: Hidden Edelweiss tiptoes out of her hiding place and gives you some meat.
    You gain 13 Meat.
    You acquire an item: jumping horseradish
    After Battle: You gain 30 Strengthliness
    After Battle: You gain 26 Magicalness
    After Battle: You gain 50 Cheek
    This combat did not cost a turn
    > In a multi-fight
    
    [3746] Eldritch Attunement
    Encounter: Eldritch Tentacle named Sssshhsssssssblrghblrg
    Round 0: Veracity wins initiative!
    Round 1: Veracity executes a macro!
    Round 1: Veracity tries to steal an item!
    You acquire an item: eldritch effluvium
    You gain 26 Meat.
    Round 2: Eldritch Tentacle takes 5 damage.
    Round 2: You lose 6 hit points
    Round 2: Veracity attacks!
    Round 3: Eldritch Tentacle takes 6 damage.
    Round 3: You lose 7 hit points
    Round 3: Veracity attacks!
    Round 4: Eldritch Tentacle takes 113 damage.
    Round 4: Eldritch Tentacle takes 6 damage.
    Round 4: Veracity wins the fight!
    After Battle: You glance in the direction of an inspiring meteor as it arcs across the sky, just as you predicted.
    After Battle: You gain 4 Beefiness
    After Battle: Hidden Edelweiss gives you some meat under the table.
    You gain 12 Meat.
    You acquire an item: eldritch effluvium
    After Battle: You gain 28 Fortitude
    After Battle: You gain 21 Mysteriousness
    After Battle: You gain 58 Smarm
    This combat did not cost a turn
    Fix your script; the previous version depended on a bug which the recent revision fixed.

  5. #55
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    13,379

    Default

    I don't know if it's the same looping effect, but I'm also seeing a loop. I was using the Adventure tab of the main interface to automate the 3 items on the F'c'le and it went into a loop.
    ...Several Hundred of these gCLI entries before I declared World Peace. I wasn't scripting, just using the convenience buttons.
    Originally Posted by MCroft View Post
    I looked at your log and see the adventure.php request redirecting to a twiddle.
    I cannot reproduce that; I did multiple automations through the GUI today and it always worked.

    Can you look in your session log, please, and find the combat just before the loop? Somehow it didnít complete, or something. (Iíd like the DEBUG log for that, but you certainly donít have it. )
    Ph'nglui mglw'nafh Cthulhu
    R'lyeh wgah-nagl fhtagn.

  6. #56

    Default

    Perhaps you did not know that you could do this:

    Code:
    run_choice( 1, "piece=1936" )
    I'll look at visit_url(). It submits a GenericRequest with the choice.php request, which redirects to fight.php, Near as I can tell, it follows the redirect but does not automate the fight.
    Originally Posted by Veracity View Post
    Probably because it's not documented anywhere (see https://wiki.kolmafia.us/index.php?title=Run_choice which only lists the 1 parameter version while ashref run_choice lists 3 more variants).
    If there was some method of find out what the arguments for functions such as this are, I would happily update the wiki.
    Autoscend. For when you want a robot to play a game, that you spend money on, for you.

  7. #57
    Senior Member MCroft's Avatar
    Join Date
    Feb 2009
    Posts
    102

    Default

    I looked at your log and see the adventure.php request redirecting to a twiddle.
    I cannot reproduce that; I did multiple automations through the GUI today and it always worked.

    Can you look in your session log, please, and find the combat just before the loop?
    Originally Posted by Veracity View Post

    Code:
    [338] Barrrney's Barrr
    Encounter: Arrr You Man Enough?
    Took choice 187/1: 62.50% chance of winning
    choice.php?pwd&whichchoice=187&option=1
    Insult: The streets will run red with yer blood when I'm through with ye!
    Retort: I'd've thought yellow would be more your color.
    Insult: Suck on <i>this</i>, ye miserable, pestilent wretch!
    Retort: That reminds me, tell your wife and sister I had a lovely time last night.
    Insult: Do ye hear that, ye craven blackguard?  It be the sound of yer doom!
    Retort: It can't be any worse than the smell of your breath!
    
    [339] The F'c'le
    Encounter: cleanly pirate
    Round 0: Darwinlet wins initiative!
    Round 1: Cubert slurps up some of your opponent's armor. He doesn't look nearly as impressive without pants. (Or pants-analogues.)
    Round 1: cleanly pirate drops 15 attack power.
    Round 1: cleanly pirate drops 15 defense.
    Round 1: Darwinlet attacks!
    Round 2: cleanly pirate takes 100 damage.
    Encounter: cleanly pirate
    
    [339] The F'c'le
    Encounter: cleanly pirate
    (repeat last 2 lines 600 times).

    Somehow it didnít complete, or something. (Iíd like the DEBUG log for that, but you certainly donít have it. )
    Originally Posted by Veracity View Post
    Yep, I didn't presciently turn on the debug log until after the problem happened...

    Looking at the steps, it's entirely possible that I did something like finish the bar in the relay browser and then attempted to automate the f'c's'le without looking at the flavor text, but I can't be sure that was the sequence of events. In any case, it did seem to fight round 1 at least.

  8. #58
    Senior Member
    Join Date
    Oct 2013
    Posts
    253

    Default

    Yep, adding "while ( in_multi_fight() ) { run_combat(); }" at the end of the loop (inside) fixed it - thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •