Page 1 of 2 1 2 LastLast
Results 1 to 10 of 15

Thread: allow property choiceAdventureXXX=URL

  1. #1
    Senior Member ckb's Avatar
    Join Date
    Mar 2006
    Posts
    925

    Default allow property choiceAdventureXXX=URL

    Most choiceAdventures are a single choice option, so setting choiceAdventureXXX=N works fine.
    However, some choiceAdventures take multiple arguments and therefor are not handled by a single int.

    Could we allow some property choiceAdventureXXX=URL, so if the property is set to something that is not an int, Mafia would just follow that URL.
    So setting
    Code:
    choiceAdventure1391 = choice.php?whichchoice=1391&option=1&tossid=10320
    would allow users to set automated choices to anything when certain choice adventures come up. This could be generic enough to allow handling of many of these KoL choices with multiple parameters. The example above is for "Rationing_out_Destruction" in the Exploding Battlefield.

  2. #2
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    12,268

    Default

    Currently:

    Property: choiceAdventure1391=1
    ASH: run_choice ( 1 );

    How about:

    Property: choiceAdventure1391=1&tossid=10320[&this=that...]
    ASH: run_choice ( 1, "tossid=10320[&this=that...]" );

  3. #3
    Senior Member ckb's Avatar
    Join Date
    Mar 2006
    Posts
    925

    Default

    How about:

    Property: choiceAdventure1391=1&tossid=10320[&this=that...]
    ASH: run_choice ( 1, "tossid=10320[&this=that...]" );
    Originally Posted by Veracity View Post
    I like that even better, so that we get an ash version with adaptability!

  4. #4
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    12,268

    Default

    Got it.

    Code:
    > get choiceAdventure1391
    
    1&tossid=10320
    Set my Custom combat.
    Automated 7 adventures on the Exploaded Battlefield.

    Code:
    Validating adventure sequence...
    
    Request 1 of 7 (Exploathing: The Exploaded Battlefield) in progress...
    
    [362] The Exploaded Battlefield
    Encounter: War Hippy Green Gourmet
    ...
    2 hippies defeated; 160 down, 173 left.
    
    Request 2 of 7 (Exploathing: The Exploaded Battlefield) in progress...
    
    [363] The Exploaded Battlefield
    Encounter: War Hippy Fire Spinner
    ...
    2 hippies defeated; 162 down, 171 left.
    
    Request 3 of 7 (Exploathing: The Exploaded Battlefield) in progress...
    
    [364] The Exploaded Battlefield
    Encounter: War Hippy Baker
    ...
    2 hippies defeated; 164 down, 169 left.
    
    Request 4 of 7 (Exploathing: The Exploaded Battlefield) in progress...
    
    [365] The Exploaded Battlefield
    Encounter: War Hippy F.R.O.G.
    ...
    2 hippies defeated; 166 down, 167 left.
    
    Request 5 of 7 (Exploathing: The Exploaded Battlefield) in progress...
    
    [366] The Exploaded Battlefield
    Encounter: invader bullet
    ...
    
    Request 6 of 7 (Exploathing: The Exploaded Battlefield) in progress...
    
    [367] The Exploaded Battlefield
    Encounter: War Hippy Homeopath
    ...
    2 hippies defeated; 168 down, 165 left.
    
    Request 7 of 7 (Exploathing: The Exploaded Battlefield) in progress...
    
    [368] The Exploaded Battlefield
    Encounter: Rationing out Destruction
    You defeated 21 hippies with some space chowder
    
    Requests complete.
    I then automated 6 battles and went to the relay browser.
    I visited the Exploaded Battlefield and got the choice.

    Code:
    [375] The Exploaded Battlefield
    Encounter: Rationing out Destruction
    
    > get hippiesDefeated
    
    201
    
    > choice
    
    choice 1: Toss!
    choice 2: Never Mind
    
    > ashq run_choice( 1, "tossid=10320" );
    
    Submitting option 1 for choice 1391
    You defeated 21 hippies with some space chowder
    
    > get hippiesDefeated
    
    222
    I should probably test to make sure I didn't break anything else, but I'll submit this soon.

  5. #5
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    12,268

    Default

    Revision 19537

  6. #6
    Senior Member ckb's Avatar
    Join Date
    Mar 2006
    Posts
    925

    Default

    Cool! I am looking forward to testing out this new feature. Thanks.

  7. #7
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    12,268

    Default

    I'm reopening this because I want to add validation.

    Code:
    > test load selects.txt
    
    Read 2,659 bytes into a 2,659 character string
    
    > test visit-choice
    
    choice = 1391
    choice 1: Toss!
      select = tossid (24 options)
        0 --- select an item ---
        161 ghuol egg (2) (5 casualties)
        330 glass of goat's milk (5 casualties)
        471 hot wing (6) (5 casualties)
        669 ghuol guolash (18 casualties)
        672 cranberries (3) (5 casualties)
        1769 fricasseed brains (5 casualties)
        1776 stale baguette (5 casualties)
        1778 ancient frozen dinner (6 casualties)
        1952 desiccated apricot (5 casualties)
        1954 dehydrated caviar (5 casualties)
        2063 blackberry (2) (5 casualties)
        2843 dire fudgesicle (2) (5 casualties)
        3555 sea carrot (5 casualties)
        6416 mana curds (10 casualties)
        6422 vampire chowder (10 casualties)
        6705 jungle floor wax (6 casualties)
        7368 extra-flat panini (2) (8 casualties)
        7375 actual tapas (5 casualties)
        8412 succulent marrow (3) (6 casualties)
        8413 salacious crumbs (5) (6 casualties)
        8526 pink slime (2) (5 casualties)
        9953 PB&J with the crusts cut off (4) (5 casualties)
        10179 plain snowcone (12) (5 casualties)
    choice 2: Never Mind
    I want to change a bunch of things:

    1) "choice" prints choices. I want it to also print the selects.
    2) If selects are present, they are not optional. Therefore, I want to allow:

    choice 1 tossid=8412

    and have it validate: all selects must be supplied with a valid value
    3) When automating, if choiceAdventureXXX=1&tossid=YYYY, then validate:
    decision 1 is available and it requires tossid and YYYY is an available value
    If validation fails, go to Manual Control
    4) run_choice should also validate on supplied extra_fields and not submit the choice if it will be rejected by KoL. Probably. Signal caller by returning empty responseText? In any case, it's up to the script writer to either make sure correct extra parameters are passed or to recognize and abort if they fail.

  8. #8
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    12,268

    Default

    Yeah, I definitely have the technology. For choices with multiple required selects, it can be a bit verbose, though.

    Code:
    Visiting the Spacegate Terminal
    Using data override: relay/choice.1235.ash
    
    > choice
    
    choice 1: Open the gate using the dials
      select = letter1 (26 options)
        A => A
        B => B
        C => C
        D => D
        E => E
        F => F
        G => G
        H => H
        I => I
        J => J
        K => K
        L => L
        M => M
        N => N
        O => O
        P => P
        Q => Q
        R => R
        S => S
        T => T
        U => U
        V => V
        W => W
        X => X
        Y => Y
        Z => Z
      select = letter2 (26 options)
        A => A
        B => B
        C => C
        D => D
        E => E
        F => F
        G => G
        H => H
        I => I
        J => J
        K => K
        L => L
        M => M
        N => N
        O => O
        P => P
        Q => Q
        R => R
        S => S
        T => T
        U => U
        V => V
        W => W
        X => X
        Y => Y
        Z => Z
      select = letter3 (26 options)
        A => A
        B => B
        C => C
        D => D
        E => E
        F => F
        G => G
        H => H
        I => I
        J => J
        K => K
        L => L
        M => M
        N => N
        O => O
        P => P
        Q => Q
        R => R
        S => S
        T => T
        U => U
        V => V
        W => W
        X => X
        Y => Y
        Z => Z
      select = letter4 (26 options)
        A => A
        B => B
        C => C
        D => D
        E => E
        F => F
        G => G
        H => H
        I => I
        J => J
        K => K
        L => L
        M => M
        N => N
        O => O
        P => P
        Q => Q
        R => R
        S => S
        T => T
        U => U
        V => V
        W => W
        X => X
        Y => Y
        Z => Z
      select = letter5 (26 options)
        A => A
        B => B
        C => C
        D => D
        E => E
        F => F
        G => G
        H => H
        I => I
        J => J
        K => K
        L => L
        M => M
        N => N
        O => O
        P => P
        Q => Q
        R => R
        S => S
        T => T
        U => U
        V => V
        W => W
        X => X
        Y => Y
        Z => Z
      select = letter6 (26 options)
        A => A
        B => B
        C => C
        D => D
        E => E
        F => F
        G => G
        H => H
        I => I
        J => J
        K => K
        L => L
        M => M
        N => N
        O => O
        P => P
        Q => Q
        R => R
        S => S
        T => T
        U => U
        V => V
        W => W
        X => X
        Y => Y
        Z => Z
      select = letter7 (26 options)
        A => A
        B => B
        C => C
        D => D
        E => E
        F => F
        G => G
        H => H
        I => I
        J => J
        K => K
        L => L
        M => M
        N => N
        O => O
        P => P
        Q => Q
        R => R
        S => S
        T => T
        U => U
        V => V
        W => W
        X => X
        Y => Y
        Z => Z
    choice 2: Open the gate to a specific planet
    choice 3: Open the gate to a random planet

  9. #9
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    12,268

    Default

    Well, this worked, but there is a bug elsewhere:

    Code:
    Visiting the Spacegate Terminal
    Using data override: relay/choice.1235.ash
    
    > choice
    
    choice 1: Open the gate using the dials
    [As above]
    choice 2: Open the gate to a specific planet
    choice 3: Open the gate to a random planet
    
    > choice 1 letter1=P letter2=Q letter3=R letter4=S letter5=R letter6=Q letter7=P
    
    > vsg status
    
    Visiting the Spacegate Terminal
    Planet Name: (difficulty = 0)
    Coordinates: PQRSRQP
    
    Plant Life: none detected
    Animal Life: none detected
    Intelligent Life: none detected
    
    You have used 0 turns in the Spacegate today and have 20 turns available to adventure there.
    Notice that it executed the choice and visited the planet, but that KoLmafia did not log the visit nor parse the terminal output correctly.

    Code:
    Current planet: Planet Name: Mu Benedict IX
    Coordinates: PQRSRQP
    Environmental Hazards:
       irradiated
       high winds
       frigid zones
       scary noises
    Plant Life: primitive
    Animal Life: none detected
    Intelligent Life: detected (hostile)
    DANGER: Murderbot frequencies detected
    
    Spacegate Energy remaining: 20 Adventures
    
    Back to the Spacegate Facility
    I submitted the choice and visited the planet - but we did not successfully parse the terminal and extract the planet data.

    Or, perhaps, VSG didn't pick up the setting correctly.
    Last edited by Veracity; 09-12-2019 at 07:25 PM.

  10. #10
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    12,268

    Default

    Yeah, that was a bug in VSG. My session log has this:

    Code:
    Visiting the Spacegate Terminal
    Took choice 1235/1: Open the gate using the dials
    choice.php?whichchoice=1235&option=1&letter1=P&letter2=Q&letter3=R&letter4=S&letter5=R&letter6=Q&letter7=P&pwd
    Planet: Mu Benedict IX
    Coordinates: PQRSRQP
    Hazards: irradiated|high winds|frigid zones|scary noises
    Plant Life: primitive
    Animal Life: none detected
    Intelligent Life: detected (hostile)
    Spant chemical signature detected: false
    Murderbots frequencies detected: true
    Ancient ruins detected: false
    Spacegate turns left: 20
    OK, I am going to try this out on the battlefield now. If it works as expected - both via the "choice" command and via automation - I'll submit it.

    Although, I will still not be done. Spacegate is an example of another way to have extra fields: decision #2 requires "word=ABCDEFG", which is a text input field, not a select.
    I'll support that kind of thing next.

Posting Permissions

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