Page 3 of 4 FirstFirst 1 2 3 4 LastLast
Results 21 to 30 of 39

Thread: MONSTERID in fights.

  1. #21

    Default

    I think people just don't realise. I added current_round() a while ago just to give you what mafia believes the current round is, I see if I'm in a flight by checking if it is 0

  2. #22
    Developer fronobulax's Avatar
    Join Date
    Feb 2009
    Location
    Central Virginia, USA
    Posts
    4,695

    Default

    Because run_combat() didn't always exist. I'm still in the habit of telling mafia to adventure somewhere when I should say run_combat(). I use a place which I can't get to (and mafia doesn't know that), because I don't want to accidentally waste a turn in the noob cave.
    Originally Posted by Crowther View Post
    I have a similar recollection. bccasend dates back to 2010 and my recollection is that it used the technique and somewhere there was a comment and documentation that said appearing to adventure in the Noob Cave but not really doing so was normal and expected. Looking at SVN annotation, I'd argue that run_combat() was finalized in 2015 so there is a potential of 5 years when run_combat() didn't exist.
    Well, thank you.
    Originally Posted by Veracity View Post

  3. #23
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    13,308

    Default

    Looking at SVN annotation, I'd argue that run_combat() was finalized in 2015 so there is a potential of 5 years when run_combat() didn't exist.
    Originally Posted by fronobulax View Post
    I don't know what "finalized" means, but the oldest SVN commit not that mentions run_combat is this:

    Code:
    r8994 | veracity0 | 2011-02-01 18:02:16 -0500 (Tue, 01 Feb 2011) | 4 lines
    
    Adjust with of Monster category in Fax Request Frame.
    Allow run_combat to finish combat even when the CCS has a consult script which
    didn't finish the combat.
    I also notice this:

    Code:
    r15235 | lostcalpolydude | 2015-01-19 13:23:44 -0500 (Mon, 19 Jan 2015) | 3 lines
    
    Add buffer run_choice( int ) command.  When in a choice adventure, use this to submit the selected option. 
    With -1 as imput, it will automate the rest of the choice using existing settings.
    
    Also add run_turn(), which will work as run_combat() or run_choice( -1 ) depending on whether you are in combat or in a choice.
    Nice job, lost! I've never actually used run_turn(), but there it is.

    THere are a few things to be done.

    1) Strip off random modifiers and save in array for later use before checking MONSTERID
    2) If there is no MONSTERID, run encounter through consequence manager and attempt to look up the monster by name. This does not have all the special little hoops we used to have to jump through.
    3) Report bug/suggestion to KoL to put MONSTERID onto the fight page you get when you "twiddle your thumbs".
    4) Do not log a new adventure/encounter if we are currently in a fight.

    Revision 20168 does 1 & 2. With that, I did the following in the Relay Browser:

    - Started a fight in Barf Mountain
    -- used seal tooth
    - Clicked on The Goatled in the adventure locations in the char pane
    -- used seal tooth
    -- finished fight

    Code:
    [9850] Barf Mountain
    Encounter: angry tourist
    Round 0: Veracity wins initiative!
    Round 1: Veracity uses the seal tooth!
    Round 2: angry tourist takes 1 damage.
    Round 2: angry tourist drops 3 attack power.
    Round 2: angry tourist drops 4 defense.
    
    [9850] The Goatlet
    KoLmafia thinks it is round 3 but KoL thinks it is round 2
    Round 2: Veracity uses the seal tooth!
    Round 3: angry tourist takes 1 damage.
    Round 3: angry tourist drops 4 attack power.
    Round 3: angry tourist drops 3 defense.
    Round 3: You lose 1 hit point
    Round 3: Veracity attacks!
    Round 4: angry tourist takes 1261 damage.
    Round 4: angry tourist drops 2 attack power.
    Round 4: angry tourist drops 3 defense.
    Round 4: Veracity wins the fight
    Notice that it was able to figure out the monster from name, even in absence of MONSTERID.

    When we get #4, the following lines will not be there, we will not have to figure out the monster, the adventure location will remain unchanged, and so on:

    Code:
    [9850] The Goatlet
    KoLmafia thinks it is round 3 but KoL thinks it is round 2
    Ph'nglui mglw'nafh Cthulhu
    R'lyeh wgah-nagl fhtagn.

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

    Default

    I think people just don't realise. I added current_round() a while ago just to give you what mafia believes the current round is, I see if I'm in a flight by checking if it is 0
    Originally Posted by gausie View Post
    Yeah, this is nice. My God Lobster script I posted was written several years ago and looks for fight.php or choice.php in the result from visit_url. I could modernize it to use current_round() and handling_choice() to do the same thing without doing string searches.
    Ph'nglui mglw'nafh Cthulhu
    R'lyeh wgah-nagl fhtagn.

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

    Default

    I submitted a bug report to KoL, asking for MONSTERID in "you twiddle your thumbs" fight redirections. (#3)
    And revision 20169 will not register requests (other than fight.php) if you are in the middle of a fight. (#4)

    Code:
    [9851] Barf Mountain
    Encounter: garbage tourist
    Round 0: Veracity wins initiative!
    Round 1: Veracity uses the seal tooth!
    Round 2: garbage tourist takes 1 damage.
    Round 2: garbage tourist drops 3 attack power.
    Round 2: garbage tourist drops 3 defense.
    KoLmafia thinks it is round 3 but KoL thinks it is round 2
    KoLmafia thinks it is round 3 but KoL thinks it is round 2
    Round 2: Veracity uses the seal tooth!
    Round 3: garbage tourist takes 1 damage.
    Round 3: garbage tourist drops 3 attack power.
    Round 3: garbage tourist drops 3 defense.
    KoLmafia thinks it is round 4 but KoL thinks it is round 3
    Round 3: Veracity uses the seal tooth!
    Round 4: garbage tourist takes 1 damage.
    Round 4: Veracity attacks!
    Round 5: garbage tourist takes 1260 damage.
    Round 5: Veracity wins the fight!
    Each of those "KoLmafia thinks it is round X but KoL thinks it is round X-1" lines was a redirection:

    - I clicked on the Last Adventure link
    - I clicked on the "Last Adventure" heading, which goes to the container document
    - I clicked on campground in the top menu.

    In every case, I "twiddled my thumbs" and we remained in the same round of the fight.

    I still want MONSTERID in the thumb twiddling redirections, since we would like to use it when you log in and are redirected immediately into a fight, but hopefully this change takes care of the Noob Cave situation - as well as not changing your adventure location to the Noob Cave and messing up the logging.

  6. #26

    Default

    Just want to add that CDM will implement MONSTERID in each combat round. I don't know when, but I'm hoping Monday or before.

  7. #27
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    13,308

    Default

    Revision 20175 sets the last_monster() at the time it creates the MonsterData from MONSTERID and responseText. And when you use CLEESH, it transforms the monster appropriately.

    Looking at Monster Changing on the WIki, there are nine different ways to do that. Near as I can tell, we only recignize CLEESH in-battle and transformed it in-place. I'm going to experiment more with this once MONSTERID is in every combat round.

    I also tried CLEESH while wearing dice gear. It changes the monster in place, but you get new OCRS modifiers which are not visible until the next round.

    Code:
    You're fighting <span id='monname'>a tiny, shaky, restless, askew, stingy, ticking wailing mushroom guy</span>
    <script>var ocrs = ["tiny","shakes","zoom","askew","stingy","ticking"];</script>
    <script>newpic("https://s3.amazonaws.com/images.kingdomofloathing.com/adventureimages/salamander.gif", "a salamander",100,100);</script>
    You cast CLEESH at your opponent. It turns into a salamander.
    KoL uses Javascript to transform the monster picture, but the new set of modifiers are not set, the new picture uses the old modifiers, and the new monster is simply "a salamander", rather than "a this, that, other thing salamander". If you force a twiddle, you will see the monster with the new random modifiers and image.

    It would probably be pointless to submit a KoL bug report about this - although it affects regular browser play (I tested that); it's not a KoLmafia issue.

    Next round:

    Code:
    You're fighting <span id='monname'>a tiny, short, turgid, artisanal, American, cloud-based salamander</span>
    <script>var ocrs = ["tiny","short","turgid","artisanal","patriotic","cloud"];</script>
    You scratch your opponent with your seal tooth, doing 1 damage.
    No MONSTERID, although there will be, by and by. But this monster has the new monster name and the new OCRS variables.

    Which is to say, unless KoL changes, you don't get to see the new OCRS variables until the round after the monster was transformed.

    We don't currently extract the MonsterData from the fight HTML, but we'll need to do that the following round after the you transform a monster.
    I'll look more at this once MONSTERID is in every round.

  8. #28

    Default

    Should be live on each round, now!

  9. #29
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    13,308

    Default

    Thanks! I had a workaround in place for twiddling thumbs, but logging out/in during a fight needed my "look up monster by name" kludge.
    I tested that case with "the Angels of Avalon" (which are really "Angels of Avalon"), which was an issue before.
    I also reinstated dumping the fight responseText to the DEBUG log if we get a fight with no MONSTERID that is not "the darkness".
    It all worked as desired; we identified te monster at login using the MONSTERID.

    Revision 20187.

  10. #30
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    13,308

    Default

    I just submitted the following Bug Report to KoL. I'm not sanguine they'll do anything about it. It is a user-visible bug, but is pretty niche, at this point. Maybe if it'd been reported during OCRS.
    Something I noticed is that in the round when you transform the monster, they DO give you the new Atk/Def/HP.
    We could use that even if we don't reparse new random modifiers - which are not yet provided, during that round.

    Code:
    There is an issue when you transform a monster with random modifiers.
    The random modifiers are rerolled for the new monster.
    In the response to the transformation:
    It displays the original monster with original modifiers
    Manuel lists the new Atk/Def/HP but the original phylum/element/init
    It changes the monster name and image in-place with Javascript.
    --> The new name does not include the new modifiers
    --> The new image is rendered using the old modifiers.
    --> Manuel already had the new Atk/Def/HP, but still displays the old phylum/element/init
    If you reload the page (twiddle), you get to see the new monster with the new modifiers.
    Alternatively, you can just do a combat action and will see them next round.
    
    That's not really advised; you'd prefer to choose your combat action based on the new modifiers.
    
    -------
    I equipped six pieces of dice gear and an Intergnat.
    I adventured in The Hippy Camp (Bombed back to the Stone Age)
    
    You're fighting an Australian, floating, broke, drunk, turgid, narcissistic caveman hippy NAMED NEIL
    (Atk = 241 Def = 321 HP = 1,403 Hippy Stinky 20% Init)
    cast Macrometeorite
    (Atk = 250 Def = 207 HP = 260 Hippy Stinky 20% Init)
    You're fighting a cavewomyn hippy
    (Reload page - twiddle my thumbs)
    You're fighting a left-handed, bouncing, askew, wet, American, frozen cavewomyn hippy WITH BACON!!!
    (Atk = 250 Def = 207 HP = 260 Hippy Cold 25% Init)
    cast CLEESH
    (Atk = 3 Def = 2 HP = 3 Hippy Cold 25% Init)
    You're fighting a newt
    (Reload page - twiddle my thumbs)
    (Atk = 3 Def = 2 HP = 3 Beast No element Never wins initiative)
    You're fighting a tiny, cartwheeling, twirling, short, narcissistic, obscene newt WITH BACON!!!
    -------
    
    Looking at the HTML of those requests, here is what happens when I transform a monster:
    
    fight.php?action=skill&whichskill=7290
    You're fighting <span id='monname'>an Australian, floating, broke, drunk, turgid, narcissistic caveman hippy NAMED NEIL</span><!-- MONSTERID: 471 -->
    <script type="text/javascript">var monsterstats = {"hp":"260","def":"207","off":"250"};</script>
    <script>var ocrs = ["flip","floating","broke","drunk","appendimg:adventureimages\/ol_drunk.gif:0:0","turgid","narcissistic"];</script>
    <script>newpic("https://s3.amazonaws.com/images.kingdomofloathing.com/adventureimages/cavewomyn.gif", "a cavewomyn hippy",100,100);</script>
    You quickly step to the side, and the massive meteorite that was about to hit you instead hits your opponent, knocking them out of the way.  You wander off to fight something else.
    
    postwarisland.php
    redirect to: fight.php
    You're fighting <span id='monname'>a left-handed, bouncing, askew, wet, American, frozen cavewomyn hippy WITH BACON!!!</span><!-- MONSTERID: 472 --
    <script type="text/javascript">var monsterstats = {"hp":"260","def":"250","off":"341"};</script>
    <script>var ocrs = ["mirror","bouncing","askew","wet","appendimg:adventureimages\/water5.png:0:0","patriotic","frozen","appendimg:adventureimages\/ice_overlay.png:0:0"];</script>
    You twiddle your thumbs.
    
    fight.php?action=skill&whichskill=15
    You're fighting <span id='monname'>a left-handed, bouncing, askew, wet, American, frozen cavewomyn hippy WITH BACON!!!</span><!-- MONSTERID: 472 -->
    <script type="text/javascript">var monsterstats = {"hp":"3","def":"2","off":"3"};</script>
    <script>var ocrs = ["mirror","bouncing","askew","wet","appendimg:adventureimages\/water5.png:0:0","patriotic","frozen","appendimg:adventureimages\/ice_overlay.png:0:0"];</script>
    <script>newpic("https://s3.amazonaws.com/images.kingdomofloathing.com/adventureimages/newt.gif", "a newt",100,100);</script>
    You cast CLEESH at your opponent. She turns into a newt.
    
    postwarisland.php
    redirect to: fight.php
    You're fighting <span id='monname'>a tiny, cartwheeling, twirling, short, narcissistic, obscene newt WITH BACON!!!</span><!-- MONSTERID: 333 -->
    <script type="text/javascript">var monsterstats = {"hp":"0","def":"2","off":"1"};</script>
    <script>var ocrs = ["tiny","spinning","rotate","short","narcissistic","obscene","appendimg:adventureimages\/ol_censored.png:0:0"];</script>
    You twiddle your thumbs.
    
    ----
    
    Notice the issues, as the user sees them (until twiddle or next round)
    
    Started out with an Australian, floating, broke, drunk, turgid, narcissistic caveman hippy NAMED NEIL
    (Hippy, Stinky, Init 20)
    
    Replaced with a left-handed, bouncing, askew, wet, American, frozen cavewomyn hippy WITH BACON!!!
    --> The new random modifiers are not displayed
    --> Says it is a Hippy - which is still true
    --> Says it is Stinky, but it's really Cold
    --> Says Init is 20% but is really 25%
    
    Replaced with a tiny, cartwheeling, twirling, short, narcissistic, obscene newt WITH BACON!!!
    --> The new random modifiers are not displayed
    --> Says it is a Hippy, but it's really a Beast
    --> Says it is Cold, but it's really (no element)
    --> Says Init is 25% but is really (never wins initiative)

Posting Permissions

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