Skip to content
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.

Teleport capabilites bug #758

Open
drallcom3 opened this issue May 10, 2022 · 2 comments
Open

Teleport capabilites bug #758

drallcom3 opened this issue May 10, 2022 · 2 comments

Comments

@drallcom3
Copy link
Contributor

Is it really a Bug report?
Yes.

Botty Version
0.7.3 non-compiled fresh from master

Describe the bug
The bot decides to have teleport charges only from setting the teleport hotkey in the config. It skips the test if teleport can be selected or has charges.

To Reproduce
Steps to reproduce the behavior:

  1. Use Non-Sorc class
  2. Unequip any teleport. Enigma, amulet, etc.
  3. Grab fresh copy from master
  4. Set only type=hammerdin and teleport=r (or whatever your usual teleport hotkey is under [Paladin]). Don't change anything else.
  5. Start the bot.
  6. Observe: INFO Capabilities: CharacterCapabilities(can_teleport_natively=False, can_teleport_with_charges=True)

The bot claims to have teleport charges, even though we removed any and all teleport items.

Expected behavior
The bot should not claim to have teleport charges, if no teleport charges items are equipped.

Screenshots / Video

Logs

Additional info
The problem is here:

def _discover_capabilities(self) -> CharacterCapabilities:
        override = Config().advanced_options["override_capabilities"]
        if override is None:
            if self._skill_hotkeys["teleport"]:
                if self.select_tp():
                    if self.skill_is_charged():
                        return CharacterCapabilities(can_teleport_natively=False, can_teleport_with_charges=True)
                    else:
                        return CharacterCapabilities(can_teleport_natively=True, can_teleport_with_charges=False)
                return CharacterCapabilities(can_teleport_natively=False, can_teleport_with_charges=True) #here
            else:
                return CharacterCapabilities(can_teleport_natively=False, can_teleport_with_charges=False)
        else:
            Logger.debug(f"override_capabilities is set to {override}")
            return CharacterCapabilities(
                can_teleport_natively="can_teleport_natively" in override,
                can_teleport_with_charges="can_teleport_with_charges" in override
            )

The bot returns true for teleport charges if the teleport hotkey has been set. He skip all other checks if the character doesn't actually have teleport and just (incorrectly) returns true.
Changing the second can_teleport_with_charges=True to =False fixes the bug and (at least the Hammerdin) functions at expected with Enigma, teleport amulet or nothing at all.

There should only be one case where can_teleport_with_charges=True.

@p0w3rD
Copy link

p0w3rD commented May 12, 2022

Will this fix the Vigor issue ?

@p0w3rD
Copy link

p0w3rD commented May 13, 2022

And also, what if we use Staff with teleport charges on the second hand?
The bot is not switching the hands :(

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants