pmariglia / showdown

A Pokemon Showdown Battle Bot written in Python
GNU General Public License v3.0
261 stars 178 forks source link

challenge user mode not working? #39

Closed fleetwoodmac closed 4 years ago

fleetwoodmac commented 4 years ago

Trying to set up two bots to fight each other in gen8ou to get data for move accuracy.

Have each bot running in their own docker instance on two separate VMs. Confirmed that the bots work fine in ladder mode and accept_challenge mode. But neither can send challenges

Cases I tried:

  1. Sending challenge to human account (none received)
  2. sending challenge to another bot (not received)
  3. separate IPs for bot and human account (not received)
  4. same IPs for bot and human (not received)
  5. changing game mode to gen8randombattle for each of the above cases
  6. removing "Team_Name" line and trying above cases

Here is the ENV file I have set up image

pmariglia commented 4 years ago

That's odd. Just tried and CHALLENGE_USER definitely works. Here is the config I used.

BATTLE_BOT=safest
WEBSOCKET_URI=sim.smogon.com:8000
PS_USERNAME=NiceNameNerd
PS_PASSWORD=<redacted>
BOT_MODE=CHALLENGE_USER
USER_TO_CHALLENGE=Accelerock Ttar
POKEMON_MODE=gen8randombattle
RUN_COUNT=1

The only thing I'd think it could be is:

  1. The password is incorrect (I just noticed that even if the password is deliberately mistyped the log still says "Successfully logged in" - I'm going to fix that.
  2. The USER_TO_CHALLENGE is incorrect
pmariglia commented 4 years ago

9db58db makes it so that an incorrect username/password triggers an error.

Doesn't explain why you're having trouble though..

fleetwoodmac commented 4 years ago

Search Ladder and accept challenge work without changing the user/pass combo, so I definitely have the right password set,

user to challenge is set to the correct username

still not working unfortunately

maybe manually adding BOT_MODE to my env file will fix it? Will report back once I test. Thank you for the reply!

pmariglia commented 4 years ago

I re-added some logging for the websocket messages that I removed once upon a time. This is in 0b38325.

If you still have trouble, could you pull the latest code and post what the CHALLENGE_USER bot's logs say?

The logs shouldn't have any passwords but if you want to remove usernames then give it a glance before pasting it.

Also, maybe don't post any of the login secrets. These would be long segments of seemingly random characters like 4da06294f71131e282b1ffa5...

fleetwoodmac commented 4 years ago

Update: Problem seems to be on my end as per the websocket logs: image

Thank you for enabling extra logs and helping me get to the bottom of this!

fleetwoodmac commented 4 years ago

Hey so I've fixed a bunch of errors I had on my end, but now I'm getting a new error:

Situation: Bots set up in a gen8anythinggoes match, valid teams, battle initiates but then I get this error:

image

any idea of what i'm doing wrong now?

pmariglia commented 4 years ago

Another dumb oversight by me.

For niche tiers like anythinggoes there aren't always moveset files on the smogon stats pages, so in the past (during gen7) I hard-coded the bot to get information from all of the tiers if the bot plays a game where the file does not exist. Now that gen7 is over gen7ru doesn't exist anymore so the bot is erroring when trying to read the sets from that file.

The bot needs this information to make assumptions about what moves/spreads/items/abilities the opponent's pokemon could have.

I changed the hard-coded tiers to their gen8 counterparts in 9cd7590bbddf7e so you should be OK now.

pmariglia commented 4 years ago

Going to assume your problem has been resolved.

Feel free to reopen if it is not.