Page 2 of 2 FirstFirst 1 2
Results 11 to 20 of 20

Thread: Pocket Familiars and fambattle.php

  1. #11
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    11,274

    Default

    I'm going to do this for fambattle.txt

    Code:
    Name	1/3	2/3	3/3	Sting	Howl	Violent Shred	Spiky
    Name - familiar type, from familiars.txt
    1/3 - the power/hp seen at levels 2, 3, (4 or 5), respectively
    Sting, Howl - moves #1 and #2
    Violent Shred - the ULTIMATE move
    Spiky - attribute.

    If we have not seen the familiar at levels 2, 3, (4 or 5), x/x
    If we have not seen the familiar at level 5, ULTIMATE move is Unknown
    If we have not seen the familiar at all, Move #1 and #2 and the attribute are also Unknown

    I'll finish filling out this file with the data that is known from the spreadsheet and my own records this evening and will submit it.

    Given that, in FightRequest on round 1 of a fambattle - before either side has moved - parse name, level, power, hp, move 1, move 2, [move 3], attribute and register with FamiliarDatabase (which will have read fambattle.txt). If it disagrees with previously known data - either missing or incorrect! - updata database and return a string to be logged to the session log, just as we do for unknown items, etc.

    This will let KoLmafia automatically collect unknown fambattle attributes.

    And those 7 things - three power/hp pairs, three moves, and attribute - can all be familiar proxy fields.

    Now, the above is "unknown data" type logging, which will happen regardless of user settings.

    We could also have "pretty" logging of His Team vs. Your Team at the beginning of the battle, for the "who's on a monster's team" data collection you mentioned.

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

    Default

    I committed my current version of fambattle.txt in 18521.

    There are a lot of easily spaded things: Pokefam familiar things from somebody who owns that familiar. I am such a person; there are a fair number of intermediate L2/L3 things I did not record that automated logging would have caught.

    Next steps:

    - Parse this file and make the data available via familiar proxy values
    - parse the (first) fambattle page and register fambattle parameters with FamiliarDatabase, which will log to the session log if there is something new (or corrected) from this file
    - Log the fambattle familiars in the session log in a "pretty" way for people who want to see what the initial setup is.

    (And eventually, we could log the effects of enemy familiar actions (and our familiar actions) to allow tracking the whole battle. If anyone cares. Sort of like Alice's Army...)

    Comments and suggestions - and updates - are welcome. I'll get some more myself tomorrow, although manually checking if I have new data is not all that fun...

  3. #13
    Developer
    Join Date
    Apr 2010
    Posts
    4,296

    Default

    Put some updates in fambattle.txt. I have a low level alt going to various out of the way places with varying ML.

  4. #14
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    11,274

    Default

    Revision 18530 adds familiar proxy fields.

    Code:
    > ash $familiar[ Smashmoth ]
    
    Returned: Smashmoth
    hatchling => Smashmoth
    image => pokefam39.gif
    ...
    attributes => pokefam
    poke_level => 0
    poke_level_2_power => 1
    poke_level_2_hp => 3
    poke_level_3_power => 1
    poke_level_3_hp => 4
    poke_level_4_power => 2
    poke_level_4_hp => 4
    poke_move_1 => Bonk
    poke_move_2 => Swoop
    poke_move_3 => Owl Stare
    poke_attribute => None

  5. #15
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    11,274

    Default

    Regarding walking the HTML of a fambattle, here is the parse tree of a familiar on your foe's team:

    Code:
      <table class="">
        <tbody>
          <tr>
            <td rowspan="2">
              <img src="https://s3.amazonaws.com/images.kingdomofloathing.com/itemimages/frankengnome.gif">
            <td class="tiny" width="150">
              Vincentenstein
            <td rowspan="2" width="120">
              <img src="https://s3.amazonaws.com/images.kingdomofloathing.com/itemimages/blacksword.gif">
              <img src="https://s3.amazonaws.com/images.kingdomofloathing.com/itemimages/blacksword.gif">
            <td rowspan="2" align="center" width="60">
            <td rowspan="2" width="150">
              <img src="https://s3.amazonaws.com/images.kingdomofloathing.com/itemimages/blackheart.gif">
              <img src="https://s3.amazonaws.com/images.kingdomofloathing.com/itemimages/blackheart.gif">
              <img src="https://s3.amazonaws.com/images.kingdomofloathing.com/itemimages/blackheart.gif">
              <img src="https://s3.amazonaws.com/images.kingdomofloathing.com/itemimages/blackheart.gif">
          <tr>
            <td class="tiny">
              Lv. 5 Reagnimated Gnome
          <tr>
            <td height="10">
          <tr>
            <td>
            <td colspan="5" class="small" valign="center">
              <b>
                Skills:
              <span title="Deal [power] damage to the frontmost enemy and reduce its power by 1.">
                [Punch]
              &nbsp;&nbsp;
              <span title="Heal the frontmost ally by [power].">
                [Hug]
              &nbsp;&nbsp;
              <span title="Deal 5 damage to the frontmost enemy.">
                [ULTIMATE: Deluxe Impale]
              &nbsp;&nbsp;
    And here is one from your team:

    Code:
      <table class="">
        <tbody>
          <tr>
            <td rowspan="2">
              <img src="https://s3.amazonaws.com/images.kingdomofloathing.com/itemimages/familiar7.gif">
            <td class="tiny" width="150">
              Boney Grrl
            <td rowspan="2" width="120">
              <img src="https://s3.amazonaws.com/images.kingdomofloathing.com/itemimages/blacksword.gif">
            <td rowspan="2" align="center" width="60">
              <img src="https://s3.amazonaws.com/images.kingdomofloathing.com/itemimages/whiteshield.gif" alt="Armor:  This familiar will take 1 less damage from attacks (minimum of 1)." title="Armor:  This familiar will take 1 less damage from attacks (minimum of 1).">
            <td rowspan="2" width="150">
              <img src="https://s3.amazonaws.com/images.kingdomofloathing.com/itemimages/blackheart.gif">
              <img src="https://s3.amazonaws.com/images.kingdomofloathing.com/itemimages/blackheart.gif">
              <img src="https://s3.amazonaws.com/images.kingdomofloathing.com/itemimages/blackheart.gif">
          <tr>
            <td class="tiny">
              Lv. 2 Spooky Pirate Skeleton
          <tr>
            <td height="10">
          <tr>
            <td>
            <td colspan="5" class="small" valign="center">
              <form style="display: inline" action="fambattle.php" method="post">
                <input type="hidden" name="pwd" value="xxx">
                <input title="Deal [power] damage to the frontmost enemy and reduce its power by 1." class="button skb" type="submit" value="Punch" name="famaction[punch-7]">
                &nbsp;
                <input title="Knock the frontmost enemy to the back." class="button skb" type="submit" value="Tackle" name="famaction[tackle-7]">
                &nbsp;
    HTMLCleaner is handy; KoL is known for sloppy HTML, but it regularizes it.

    Easy to see how to count the power images, the hp images, the attribute image, where to find the moves, and so on.

    But it's probably a big enough project that I'd prefer to wait until the weekend.

    I have a function which is called six times (one per table) with the "table" node, when we are parsing the fambattle page. Will I be able to resist continuing to work on it tonight? We'll see.

  6. #16
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    11,274

    Default

    Revision 18533 parses the teams on round 1 of a fambattle and extracts everything interesting. Doesn't do anything with it yet. Next up:

    1) Pass that data to FamiliarsDatabase to update PokefamData for familiars, as needed. And log a discovery line in the session log and gCLI, much as we do for items.
    2) Log something pretty in the session log showing the teams.
    3) Parse the Team Management page and pass what we find to FamiliarDatabase to update data if needed.
    4) Given that, I can look at my own appropriately leveled familiars to discover all of KoL's "short names" for them. For example, ULTIMATE: Spiky Burst is "ult_crazyblast". We'll need those if we want to provide a function to ask a particular familiar to do a particular move.

    I suppose next will be parsing the state of the teams every round and keeping track of everything in settings, so that consult scripts can do something sensible. And then adding CCS actions (which are used in Combat Filters, too) and a function that a consult script can use.

  7. #17
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    11,274

    Default

    Revision 18535 will print a line to the gCLI and the session log when previously unknown - or previously incorrect - pokefam data is seen.

  8. #18
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    11,274

    Default

    In the final turns of my latest pokefam run, when I was trying to determine all the "short" skill names (as used in URLs for submitting skills for familiars), I wanted to level up one of my L3 familiars whose ULTIMATE skill was Vulgar Display, since I had none at the level. So I spent 5 pokedollars and bought the "add Smart to a familiar" thing.

    Next battle, I got a "this familiar is incorrect" update line.

    Seems like we might want to track which familiars have been augmented this ascension with which perma-boost. You can only have one per familiar, if I understand. Given that, I'll compensate when parsing familiars.

    I wish I'd saved a DEBUG log for applying the potion to the familiar. I'll ascend into another Pokefam run tomorrow, and, by and by, will boost a familiar. It'll be easiest to reproduce once I add code to parse the Team Management page, where it shows you all of your familiars at their current level - Power/HP - but also shows you all of the skills they will have at level 5.

    I have a LOT of familiars. I'm only missing 2 of the Pokefam-only familiars, because I spent about 1.5 million before I ascended. 600K of which was for a Slotter, since I really wanted it. I'll buy at least a Cornbeefadon before I ascend this time, since I need the short name for the Pepperscorn move...

    (I wonder what Mu has? No way, no how, will I buy it at anywhere close to its current price. Maybe at a tenth of that price.)

  9. #19
    Senior Member
    Join Date
    Feb 2010
    Posts
    945

    Default

    Thank you for your continued efforts. I posted to the New Content thread for the path with some new/updated Pokefam data from encounters.

  10. #20
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    11,274

    Default

    Thanks for helping!

    Anotother observation: Familiars can have multiple "attributes". They only ever start with one, but you can feed one a potion to add another, and various battle moves can grant an attribute. The column has room to show two attributes without wrapping. (Just as the Power has room to show 4 without wrapping - but if you power up the familiar, the fifth sword will wrap.)

    For the purpose of looking at 1st round teams, need to parse all the attributes - and ignore the "added" one, if present. But if I make this parse subsequent rounds of fambattles, will need to save multiple attributes in the "current" state of the familiar.

Posting Permissions

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