Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 28

Thread: Combat Filter weirdness with Funkslinging

  1. #1
    Senior Member
    Join Date
    Oct 2014
    Posts
    131

    Default Combat Filter weirdness with Funkslinging

    I was going through my logs recently and noticed that in some combats when I wanted to use a single item, I actually used 2 of that item (if I had it) via a combat filter, even though I did not use the format for funkslinging.

    I wrote a script that verifies the situation by getting 2 gauze garters, going into combat, trying to use 1 but ultimately using both in combat:

    Code:
    Visit to Manor1: The Haunted Pantry in progress...
    
    [482] The Haunted Pantry
    Encounter: fiendish can of asparagus
    Round 0: cheesecookie wins initiative!
    Round 1: You lose 1 hit point
    You have 2 gauze garters.
    
    Round 1: cheesecookie uses the gauze garter and uses the gauze garter!
    Round 2: You gain 95 hit points
    Round 2: You gain 81 hit points
    Round 2: Casablanca Jones whips your opponent in the arm, dealing 36 damage.
    Round 2: fiendish can of asparagus takes 36 damage.
    Sorry, I can't figure out what "gauze garter" means. Perhaps you have 0.
    
    Used Gauze Garter for testing, done
    The script that generates this:
    Code:
    script "filtertest.ash"
    
    string combatTest(int round, string opp, string text)
    {
        static int didGauze = 0;
        if(didGauze == 1)
        {
            cli_execute("/count gauze garter");
            didGauze = 0;
            abort("Used Gauze Garter for testing, done");
        }
    
        cli_execute("/count gauze garter");
        if(item_amount($item[Gauze Garter]) > 0)
        {
            didGauze = 1;
            return "item gauze garter";
        }
    
        return "fail";
    }
    
    void main()
    {
        take_storage(2 - item_amount($item[Gauze Garter]), $item[Gauze Garter]);
        take_closet(2 - item_amount($item[Gauze Garter]), $item[Gauze Garter]);
    
        print("Gauze garters: " + item_amount($item[Gauze Garter]), "blue");
        cli_execute("/count gauze garter");
    
        adv1($location[The Haunted Pantry], 1, "combatTest");
    }
    The actual combat result I am getting is as if I returned "item gauze garter, gauze garter", which is the funkslinging usage format for combat filters.

  2. #2
    Senior Member
    Join Date
    Apr 2009
    Posts
    1,750

    Default

    I think the correct format for using only 1 of an item, even if you have 2+ and funkslinging, is
    Code:
    item gauze garter,
    (note the extra comma)

  3. #3
    Senior Member
    Join Date
    Oct 2014
    Posts
    131

    Default

    I think the correct format for using only 1 of an item, even if you have 2+ and funkslinging, is
    Code:
    item gauze garter,
    (note the extra comma)
    Originally Posted by xKiv View Post
    I thought that would probably work and was about to ask if that was safe to use if you don't have funkslinging. It didn't work though. I tried "item gauze garter," and "item gauze garter, " (with a trailing space) and still used both of them.

  4. #4
    Senior Member
    Join Date
    Apr 2009
    Posts
    1,750

    Default

    OK, parsing FightRequest.getCurrentKey() (I think - it's a long method ...) leads me to suggest to also try "item ,gauze garter" (leave out the *first* item, not the second).

  5. #5
    Senior Member
    Join Date
    Oct 2014
    Posts
    131

    Default

    OK, parsing FightRequest.getCurrentKey() (I think - it's a long method ...) leads me to suggest to also try "item ,gauze garter" (leave out the *first* item, not the second).
    Originally Posted by xKiv View Post
    Nope again. The ambiguity, or rather unexpected behavior, is the major issue. I can always wrap item usage up with funkslinging checks and seal teeth. There is just something wrong here.

  6. #6

    Default

    I feel like this behavior is intentional (to save server hits, I guess), but I have no idea where the thread I'm thinking of would be at (from years ago).

  7. #7
    Senior Member
    Join Date
    Oct 2014
    Posts
    131

    Default

    I feel like this behavior is intentional (to save server hits, I guess), but I have no idea where the thread I'm thinking of would be at (from years ago).
    Originally Posted by lostcalpolydude View Post
    I suppose it would have had to be deliberate since it isn't the simple pass-through case. I'll just wrap around it I guess.

  8. #8
    Senior Member
    Join Date
    Oct 2014
    Posts
    131

    Default

    An update on this:

    When using an item that ends the combat, such as Louder Than Bomb, this causes Mafia to think it used 2 of them up even though it only used up one (assuming you have at least 2, of course). refresh inv fixes this but it is not ideal (in terms of server hits) to do so after every combat.

  9. #9

    Default

    1: Mafia doesn't have any good way of knowing that the second item isn't actually used. However, it checks KoL's combat item list in combat to update those values. I don't really remember how that is handled at end of combat (probably exactly how it should be, I'm just not sure), but the start of the next combat should update things regardless.

    2: If things are getting that far out of sync, then KoL isn't updating that list properly for some reason, and that is a KoL bug. Maybe it's based on how mafia is submitting the macro, I really wouldn't know where to start with checking on that though.

  10. #10
    Developer
    Join Date
    Apr 2010
    Posts
    4,082

    Default

    KoL isn't updating that list properly, for some things at any rate. I think it updates during the combat based on what is used, not at the start of combat rounds. It is why when using red buttons, which actually use more, the number is wrong in the next round/fight. It is why when you hand back the military grade nailtrimmers outside combat, they are shown in the item dropdown in the next combat. Have reported it for those two examples, months ago.

Posting Permissions

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