• Check out the relaunch of our general collection, with classic designs and new ones by our very own Pissog!

Ask simple questions here! [READ ORIGINAL POST before posting]

I recently started working on Technical Machine again. I am following the instructions to implement the protocol. I have logged into the server, I have received the challstr and sent the HTTP POST request, and then received the response from the authorization server. However, when I send
Code:
/trn USERNAME,0,ASSERTION
on the websocket channel, nothing seems to happen (I get no further messages until I join the lobby and start seeing people's chat). My user does not show up in the list of users when I join the lobby, I cannot PM my bot (it says the user is not online), and when I try to send a message from my bot, I get a response of
You must choose a name before you can talk.

What am I doing wrong?
 
I don't think you're doing anything wrong per-se, but you've missed a part of the documentation (I think). Every message needs to be prefixed with a room id when sending it to the server from a client, even if the message is "logging in" and you're not actually in any room yet. So the reason you're not getting an accepted assertion is because you're sending
Code:
/trn username,0,assertion
and not what the server expects; which would be
Code:
|/trn username,0,assertion
See my own example of this here.
 
Thank you. It's so obvious now that you point it out. :) I guess I just assumed that this message was special. Technical Machine is now online and ready to defeat puny humans. :)
 
Here's a question; how come alolan raticate still doesn't have a backsprite?
It does, I made a replacement recently, but it has not been uploaded to the server, as it’s planned to upload them all at once. which, iirc, will happen soon enough
 
I'm starting to get into the pet mods community and for some things I want to do I'm required to submit code. Could anyone point me to some resources where I could find example code or tutorials? I have coded for games before so it's not a huge stretch, but I've never coded for PS so I need to familiarize myself with it.
 
Hello i made a pokemon showdown account a while back i remember the username its HectorFG but i forgot my password i remember making a few teams on there with a friend, it would be greatif someone can help me recover my passwrd soi can start playing again
 
Heyo, I just saw a different 3D model for Gardevior skin than I normally see. Why did this happen?
Q.png

EDIT: I got it again with a different mon, this time mega Absol and i got some replays http://replay.pokemonshowdown.com/gen7randombattle-785779309
https://replay.pokemonshowdown.com/gen7ou-785787295
 
Last edited:
Hey, this is more of a technical question and I'm not sure if anyone will be able to answer, but I figured I might ask anyway...

I've been wanting to make my own Showdown Battle API for a while, but I have no idea where to start. I don't need it to do much, just start a battle and then send progress updates back to my server where I'll send back commands to make specific moves etc...

  • How does authentication work? Is there a way to authenticate outside the client?
  • I heard that Showdown uses sock.js for WebSockets, is this correct?
  • Has anyone made something similar before?
Worst case I'll just use Selenium, but I'd prefer to remain browser-free since I'll want to run 5-6 games at once.

I'm assuming this is best done with NodeJS, but I can use Python 3 as well.
 
Quite a time ago now, a friend of mine has been auto lock for posting a screamer. So I was currious about this rule since I didn’t find out where it was written.
I’m not contesting such things, as it’s obviously bad to post screamers but I believe it should be shown on the rule page of showdown.
If it’s include in « respect the US law » I apologies but not totally as this sentance is an exemple of how fuzzy rules are (at least half showdown users ain’t from US so don’t know US law)
 
Its not a direct rule, but It can fall under
Global:
1. Be nice to people. Respect people. Don't be rude or mean to people.
5. Moderators have discretion to punish any behaviour they deem inappropriate, whether or not it's on this list. If you disagree with a moderator ruling, appeal to a leader (a user with & next to their name) or Discipline Appeals.

Chat:
1. Do not spam, flame, or troll. This includes advertising, raiding, asking questions with one-word answers in the lobby, and flooding the chat such as by copy/pasting logs in the lobby. (trolling specifically)

As for global rule 5, its not really appropriate to post something thats meant to shock/scare other people. We filter them to prevent trolls from randomly posting them in chats.
 
So I've noticed Gallade, Gardevoir and Mega-Absol have new animations, I was wondering a few things:
-are there any more new animations?
-why are there are new animations?
-who made them?
 
So I've noticed Gallade, Gardevoir and Mega-Absol have new animations, I was wondering a few things:
-are there any more new animations?
-why are there are new animations?
-who made them?
There’s also typhlosion, snorlax and espeon for new ones. they were added since staff liked them better iirc. And DJTHED made them
(Here’s the link to his display thread if you so desire to see)
 
Last edited:
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?
 
Last edited:
Sorry I haven't had the time to read through this whole thread so I don't know if a question like the one I have now has been answered so I apologize in advance, but anyway:

If I wanted to do something like bring down Mew from Ubers into Gen 4 OU and play on a private server/room/whatever it is called, would this be possible? If so, what would be the steps to make it happen? I'm not super well known in Smogon or anything so I don't particularly know the power hierarchy here and who controls what. Just curious on whether or not things like this are possible and happen here.
 
What's the maximum number of Pokemon that you can bring to a Custom Battle?
24 pokemon is the maximum.
Sorry I haven't had the time to read through this whole thread so I don't know if a question like the one I have now has been answered so I apologize in advance, but anyway:

If I wanted to do something like bring down Mew from Ubers into Gen 4 OU and play on a private server/room/whatever it is called, would this be possible? If so, what would be the steps to make it happen? I'm not super well known in Smogon or anything so I don't particularly know the power hierarchy here and who controls what. Just curious on whether or not things like this are possible and happen here.
from what I’m reading, no it isn’t, since Mew is Ubers in Gen 4. though you could play Custom Game with a gen 4 team, that’s as close as you could get.
 
Sorry I haven't had the time to read through this whole thread so I don't know if a question like the one I have now has been answered so I apologize in advance, but anyway:

If I wanted to do something like bring down Mew from Ubers into Gen 4 OU and play on a private server/room/whatever it is called, would this be possible? If so, what would be the steps to make it happen? I'm not super well known in Smogon or anything so I don't particularly know the power hierarchy here and who controls what. Just curious on whether or not things like this are possible and happen here.
You could do it in a tour, with the command /tour rules +mew. That would require a roomdriver / mod (depending on per issions) from a room to agree. Ruins of Alph would probably be your best bet.

Alternatively, you could ask for a match in such a metagame, and simply play in ubers witha gentlemans agreement.
 
Hey, this is more of a technical question and I'm not sure if anyone will be able to answer, but I figured I might ask anyway...

I've been wanting to make my own Showdown Battle API for a while, but I have no idea where to start. I don't need it to do much, just start a battle and then send progress updates back to my server where I'll send back commands to make specific moves etc...

  • How does authentication work? Is there a way to authenticate outside the client?
  • I heard that Showdown uses sock.js for WebSockets, is this correct?
  • Has anyone made something similar before?
Worst case I'll just use Selenium, but I'd prefer to remain browser-free since I'll want to run 5-6 games at once.

I'm assuming this is best done with NodeJS, but I can use Python 3 as well.

Is there any answer for this guy? I want to know too.
 
Hey, this is more of a technical question and I'm not sure if anyone will be able to answer, but I figured I might ask anyway...

I've been wanting to make my own Showdown Battle API for a while, but I have no idea where to start. I don't need it to do much, just start a battle and then send progress updates back to my server where I'll send back commands to make specific moves etc...

  • How does authentication work? Is there a way to authenticate outside the client?
  • I heard that Showdown uses sock.js for WebSockets, is this correct?
  • Has anyone made something similar before?
Worst case I'll just use Selenium, but I'd prefer to remain browser-free since I'll want to run 5-6 games at once.

I'm assuming this is best done with NodeJS, but I can use Python 3 as well.
Is there any answer for this guy? I want to know too.
Didn't see the question till now sorry.

I'm not an expert in the area of authentication for PS, but I have written a bot with NodeJs.

When you connect to showdown, PS sends you a chalstring in the form of |chalstr|str. You'll want to make a HTTP GET or HTTP POST request to http://play.pokemonshowdown.com/action.php depending on what exactly your trying to do. (You can also use a HTTPS request).
  • If your trying to login to an unregistered name, you'll want to make a GET request with ?act=getassertion&userid=userid&challstr=chalstr where userid is the userid of the username you want to login to (all lowercase letters/numbers, no spaces, no symbols), and chalstr is your chalstring.
  • If your trying to login to a registered name, you'll want to make a POST request with act=login&name=userid&pass=password&challstr=chalstr where userid is the userid of the username you want to login to, password is the password (case sensetive of course), and chalstr is the your chalstring.
  • If your trying to login to a name you have session cookies for, use ?act=upkeep&challstr=chalstr where chalstr is your chalstring.
After sending the chalstr, you should get a response from the login server. This could be a number of things including:
  • ; meaning the name you chose is registered, and you did not provide a password, or provided an incorrect password.
  • A message explaining why the login failed.
  • If you made a POST login request: A JSON object starting with ] that contains what you need to login. You'll want to parse it and access the assertion property since youll need it to login.
  • If you made a GET login to an unregistered name request: A string of characters that you will need to use to login (your assertion).
After getting your assertion, go ahead and send /trn Username,0,assertion where Username is your Username (case sensetive), and assertion is the assertion you got from your HTTP(S) request.
An example implementation that I use can be seen below:
JavaScript:
            this.challstr = parts.join('|');
            const reqOptions = {
                hostname: "play.pokemonshowdown.com",
                path: "/~~showdown/action.php",
                agent: false,
            };

            let loginQuerystring;
            if (!Config.pass) {
                reqOptions.method = 'GET';
                reqOptions.path += `?act=getassertion&userid=${toId(Config.nick)}&challstr=${this.challstr}`;
            } else {
                reqOptions.method = 'POST';
                loginQuerystring = `act=login&name=${toId(Config.nick)}&pass=${Config.pass}&challstr=${this.challstr}`;
                reqOptions.headers = {
                    'Content-Type': 'application/x-www-form-urlencoded',
                    'Content-Length': loginQuerystring.length,
                };
            }
            debug(`Sending login to ${reqOptions.path}${loginQuerystring ? ` | Data: ${loginQuerystring}` : ''}`);

            const req = https.request(reqOptions, res => {
                res.setEncoding('utf8');
                let data = '';
                res.on('data', chunk => {
                    data += chunk;
                });
                res.on('end', () => {
                    if (data === ';') {
                        console.log(`LOGIN FAILED - The name ${Config.nick} is registered and ${Config.pass ? 'an invalid' : 'no'} password was provided.`);
                        process.exit(1);
                    }
                    if (data.length < 50) {
                        console.log(`LOGIN FAILED - ${data}`);
                        process.exit(1);
                    }
                    if (data.indexOf('heavy load') > -1) {
                        console.log(`LOGIN FAILED - The login server is experiencing heavy load and cannot accommodate the bot's connection right now.`);
                        process.exit(1);
                    }
                    try {
                        data = JSON.parse(data.slice(1));
                        if (data.actionsuccess) {
                            data = data.assertion;
                        } else {
                            console.log(`Unable to login; the request was unsuccessful\n${JSON.stringify(data)}\n`);
                            process.exit(1);
                        }
                    } catch (e) {}
                    // Autojoining should be handled before sending /trn; since only
                    // eleven rooms can be autojoined at a time, leave any extras to
                    // be joined manually. (This allows the server to remember the first
                    // eleven if you happen to cut back on rooms)
                    if (Config.autojoin.length) {
                        const [autojoin, extra] = [Config.autojoin.slice(0, 11), Config.autojoin.slice(11)];
                        this.send(`|/autojoin ${autojoin.join(',')}`);
                        if (extra.length) this.extraJoin = extra;
                    }
                    this.send(`|/trn ${Config.nick},0,${data}`);
                });
            });
            req.on('error', e => {
                console.error(`Error while logging in: ${e.stack}`);
                return;
            });
            if (loginQuerystring) req.write(loginQuerystring);
            req.end();
See also: https://github.com/Zarel/Pokemon-Showdown/blob/master/PROTOCOL.md#global-messages (chalstr)
Let me know if there are any other questions.
 
Last edited:
Back
Top