Hoopa used Nasty Plot on turn 9.
+2 252+ SpA Hoopa Focus Blast vs. 0 HP / 4 SpD Meloetta: 257-303 (75.3 - 88.8%) -- guaranteed 2HKO
Thank you, I'm an idiot!
Hoopa used Nasty Plot on turn 9.
+2 252+ SpA Hoopa Focus Blast vs. 0 HP / 4 SpD Meloetta: 257-303 (75.3 - 88.8%) -- guaranteed 2HKO
You can try looking at the server source code. https://github.com/Zarel/Pokemon-ShowdownHello, I have been part of some Pet Mods and looking to make some of my own moves or abilities. Is there a thread or possible site that will teach me to code for Pokemon Showdown?
See this issue https://github.com/Zarel/Pokemon-Showdown-Client/issues/1148Kind of a long story, but is it possible to run a headless instance of Showdown locally?
def on_message(ws, msg):
print(msg)
if msg[:10] == '|challstr|':
challstr = msg[10:]
login(challstr, ws)
def on_open(ws):
print('### opened ###')
def login(challstr, ws):
resp = requests.post('https://play.pokemonshowdown.com/action.php',
data={'act': 'login',
'name': creds['name'],
'pass': creds['password'],
'challstr': challstr})
data = json.loads(resp.text[1:])
assertion = data['assertion']
ws.send('/trn ' + creds['name'] + ',0,' + assertion)
client = websocket.WebSocketApp('ws://sim.smogon.com:8000/showdown/websocket',
on_message=on_message)
client.on_open = on_open
client.run_forever()
### opened ###
|updateuser|Guest 6879553|0|102
|formats|,1|{FORMATS HERE}
|queryresponse|rooms|null
|challstr|4|{CHALLENGE STRING HERE}
You're missing a part of the challstr for your POST-request. The challstr contain two parts, the actual challstr and a challstrid. In your example this challstrid is 4. A correct POST-request looks something like:Back with another question, or more of a problem. Also not sure if this counts as a simple question, if there's somewhere better to post this just let me know.
I'm trying to access Showdown via a websocket connection in Python; I can establish the connection and get the initial response just fine, but after that the server refuses to respond to me. This is what I have so far:
Python:def on_message(ws, msg): print(msg) if msg[:10] == '|challstr|': challstr = msg[10:] login(challstr, ws) def on_open(ws): print('### opened ###') def login(challstr, ws): resp = requests.post('https://play.pokemonshowdown.com/action.php', data={'act': 'login', 'name': creds['name'], 'pass': creds['password'], 'challstr': challstr}) data = json.loads(resp.text[1:]) assertion = data['assertion'] ws.send('/trn ' + creds['name'] + ',0,' + assertion) client = websocket.WebSocketApp('ws://sim.smogon.com:8000/showdown/websocket', on_message=on_message) client.on_open = on_open client.run_forever()
And the output is as such:
Code:### opened ### |updateuser|Guest 6879553|0|102 |formats|,1|{FORMATS HERE} |queryresponse|rooms|null |challstr|4|{CHALLENGE STRING HERE}
When I make the login request and send the '/trn' message manually it succeeds in logging in and sends back some message, but as you can see with this program I don't get back anything other than the initial messages sent when you establish a connection. Even if I send '/help' or another request it never responds. Can anybody more familiar with the Showdown api and/or websockets than me see what's going wrong here?
payload = { 'act':'login',
'name': username,
'pass': password,
'challengekeyid': challengekeyid, # 4 in your example above
'challenge': challenge # As you've already done
}
r = requests.post('http://play.pokemonshowdown.com/action.php', data=payload)
assertion = json.loads(r.text[1:])['assertion']
send('|/trn {},0,{}'.format(username, assertion))
You're missing a part of the challstr for your POST-request. The challstr contain two parts, the actual challstr and a challstrid. In your example this challstrid is 4. A correct POST-request looks something like:Python:payload = { 'act':'login', 'name': username, 'pass': password, 'challengekeyid': challengekeyid, # 4 in your example above 'challenge': challenge # As you've already done } r = requests.post('http://play.pokemonshowdown.com/action.php', data=payload) assertion = json.loads(r.text[1:])['assertion'] send('|/trn {},0,{}'.format(username, assertion))
You need to send message in the forme ofThanks, that solved the issue of logging in, so I'm now getting back the correct response for that. Unfortunately it still seems like the server won't listen to anything else. e.g. If I put a call to "send('/help')" at any point in the program, nothing ever comes back from the server (I know it is sending the request, so that's not the issue).
roomid|message
exclude the roomid when your sending to lobby or its not needed.|/join mafia
mafia|Hello World!
mafia|/roomban hoeenhero, stop helping him make me work
You need to send message in the forme ofroomid|message
exclude the roomid when your sending to lobby or its not needed.
EX:|/join mafia
mafia|Hello World!
mafia|/roomban hoeenhero, stop helping him make me work
/help
doesn't need a roomid. i.e. I can send just /help
in the Chrome console and it comes back as you'd expect:/join lobby
in my program and it didn't work either.window.app.send('/help') added the | by default. If you look at the next line of what was actually sent, you see that the message was |/helpThat doesn't seem to be the issue,/help
doesn't need a roomid. i.e. I can send just/help
in the Chrome console and it comes back as you'd expect:
View attachment 144511
Additionally, I tried sending/join lobby
in my program and it didn't work either.
You cant sorryis it possible to clear a ranking for a certain ladder from your user page?
like, i know you can if you click reset if your rating is 1000, but what if it's for some ladder that is no longer playable, so it's not like you could purposefully lose just to set your ranking to 1000. i'm just not big on extra clutter, or whatever.
window.app.send('/help') added the | by default. If you look at the next line of what was actually sent, you see that the message was |/help
Is it supposed to say "move description"?/itemsearch [move description] - finds items that match the given key words.
Command accepts natural language. (tip: fewer words tend to work better)
Searches with "fling" in them will find items with the specified Fling behavior.
Searches with "natural gift" in them will find items with the specified Natural Gift behavior.
This was probably asked already, but how did you guys get permission to make Showdown! and use copyrighted stuff?
Edit: What are all the soundtracks that Showdown! has now?
Why does "/ds gen=1,uber" not find mega Kangaskhan?
This isn't really the forum for this. Try asking in the Smogon Competitive Forums, probably OU given the Pokemon you've referenced. You'll probably want to include more details about your team, too.I have a question. Who should I use? Assault vest tyranitar or Gigalith? My team is troubled by Volcarona a lot and I need sandstorm for Excadrill.
Alright thank youThis isn't really the forum for this. Try asking in the Smogon Competitive Forums, probably OU given the Pokemon you've referenced. You'll probably want to include more details about your team, too.