• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Script: [v16/v17/v18/v19/v20/v21] Cable Club (Online Trades/Battles)

1,682
Posts
8
Years
    • Online now
    Since the original script is abandonware, and I've been updating it, guess it's time to make my own thread for it.
    Original Thread: https://www.pokecommunity.com/showthread.php?t=447015

    Credits to mGriffin for the original script, and Khaikaa for commissioning it.

    Features
    • Online Battling, Trading, and Record Mixing [With Supporting Scripts]
    • User configurable Online Trainer Types
    • Compatibility with Essentials Deluxe, ZUD Mechanics, Terastal Phenomenon, Focus Meter System, and PLA Battle Styles [v20 only]
    • Compatibility with [MUI] Improved Mementos, Deluxe Battle Kit, [DBK] Z-Power, [DBK] Dynamax, and [DBK] Terastallization [v21 only]
    Read the included User Manual for instructions and more details.

    Version 3.7: https://www.mediafire.com/file/3akzs1os67mktr2/cable_club_port.zip/file

    Example RecordMixer entry of Gen 2's Mystery Gift
    https://pastebin.com/nvYRXNMk
     
    Last edited:
    107
    Posts
    3
    Years
    • Seen Apr 27, 2023
    Perfect Vendily! You are making many people's dreams come true. I hope this online script evolves more and more!
     
    1,682
    Posts
    8
    Years
    • Online now
    Updated the script again because clearly I've picked this to hyperfocus on for the next week.
    Included in this version is a QoL change that displays your Trainer ID in the text boxes before you connect with the other game, because scrambling with notepad so many times got annoying.

    Also mega evolutions were added, though I can only confirm that they work in v18. It won't crash the other versions, I just couldn't get the mega evolution prompt to appear, in theory they should also work, since the mega evo code didn't really change between versions.

    So... yeah, version 1.3.
    I changed the download link so I wasn't affecting the original thread every time I updated.
     

    Canal_do_Lontra

    Oshawott uses Razor Shell
    207
    Posts
    4
    Years
  • Since the original script is abandonware, and I've been updating it, guess it's time to make my own thread for it.
    Original Thread: https://www.pokecommunity.com/showthread.php?t=447015

    Credits to mGriffin for the original script, and Khaikaa for commissioning it.

    There's two parts:
    1. a plug and play script for Essentials in cable_club.rb. I call mine CableClub and put it directly above Main. You need to edit the HOST and PORT constants at the top to be the address and port of your server.
    2. a Python3 server in cable_club.py. It needs your PBS files to run, by default it looks in the directory you run it from, but you can pass --pbs_dir to change that. You can also pass --host and --port or alter the HOST and PORT constants at the top. You also need to set EBDX_INSTALLED to true if you have it, so the script can handle the extra data EBDX requires.

    Connections are established via Trainer IDs, which can be found on the trainer card screen. Think of them as a bit like friend codes.

    For hosting the server you could try free-tier on Google Cloud. It shouldn't use much processing power (but I'd recommend setting up some sensible limits, because there's nothing in the protocol to stop somebody DDOSing it).

    Please don't bother Luka with bugs from online EBDX battles.

    Version 1.3: https://www.mediafire.com/file/3akzs1os67mktr2/cable_club_port.zip/file

    Hello I liked so much that we can use it, thanks. But it is locally or ONline? And I don't know how to make these steps, I am not a scripter, because of this it is so hard, can you make a Tutorial in how to make it?
     
    27
    Posts
    4
    Years
    • Seen Jul 19, 2023
    I have a little issue, I dont know how to fix: When I changed my Pokémon, this doesnt showed up by my opponent. I switched my Golem out for a Dragonite and on the opponents side, I didnt. So the battle got async. Any ideas? My opponent also got an error message I attached to this post.
     

    Attachments

    • ErrorMessage.png
      ErrorMessage.png
      49.7 KB · Views: 52
    1,682
    Posts
    8
    Years
    • Online now
    I have a little issue, I dont know how to fix: When I changed my Pokémon, this doesnt showed up by my opponent. I switched my Golem out for a Dragonite and on the opponents side, I didnt. So the battle got async. Any ideas? My opponent also got an error message I attached to this post.

    Yeah, this is a known issue with EBDX, the peer player (the second to connect) does something weird when a mon is switched in, and the whole thing falls apart.
    I'm still looking into it. Sorry...

    Also released a minor Update to remove the walrus operators in the server side script so that it no longer requires python 3.8 because google cloud's tutorial set up gave me a Ubuntu VM that had version 3.6. so yeah. makes it easier to set up, I guess.

    EDIT: misread the error message, you're on ebs and v17.2, not ebdx and v18
     
    Last edited:
    27
    Posts
    4
    Years
    • Seen Jul 19, 2023
    Yeah, this is a known issue with EBDX, the peer player (the second to connect) does something weird when a mon is switched in, and the whole thing falls apart.
    I'm still looking into it. Sorry...

    Also released a minor Update to remove the walrus operators in the server side script so that it no longer requires python 3.8 because google cloud's tutorial set up gave me a Ubuntu VM that had version 3.6. so yeah. makes it easier to set up, I guess.

    EDIT: misread the error message, you're on ebs and v17.2, not ebdx and v18

    That's correct, I'm currently still using v17.2. So, does this make any difference to the known problem for EBDX? Or will your fix for EBDX work for me aswell, when you figured that out?^^
     

    DarrylBD99

    Content Creator and Game Developer
    321
    Posts
    3
    Years
  • Since the original script is abandonware, and I've been updating it, guess it's time to make my own thread for it.
    Original Thread: https://www.pokecommunity.com/showthread.php?t=447015

    Credits to mGriffin for the original script, and Khaikaa for commissioning it.

    There's two parts:
    1. a plug and play script for Essentials in cable_club.rb. I call mine CableClub and put it directly above Main. You need to edit the HOST and PORT constants at the top to be the address and port of your server.
    2. a Python3 server in cable_club.py. It needs your PBS files to run, by default it looks in the directory you run it from, but you can pass --pbs_dir to change that. You can also pass --host and --port or alter the HOST and PORT constants at the top. You also need to set EBDX_INSTALLED to true if you have it, so the script can handle the extra data EBDX requires.

    Connections are established via Trainer IDs, which can be found on the trainer card screen. Think of them as a bit like friend codes.

    For hosting the server you could try free-tier on Google Cloud. It shouldn't use much processing power (but I'd recommend setting up some sensible limits, because there's nothing in the protocol to stop somebody DDOSing it).

    Please don't bother Luka with bugs from online EBDX battles.

    Version 1.3: https://www.mediafire.com/file/3akzs1os67mktr2/cable_club_port.zip/file

    Well I wish I could use this script for online, but I am gonna have to wait for another 2 years for eligibility to own a credit card (cause I am only 16) to sign up to AWS or even Google Cloud... But, thanks anyway!
     
    1,682
    Posts
    8
    Years
    • Online now
    That's correct, I'm currently still using v17.2. So, does this make any difference to the known problem for EBDX? Or will your fix for EBDX work for me aswell, when you figured that out?^^

    Well, since one of the errors with EBDX is the same as this one, in which presumably some sort of desync causes one player to be able to send a choice instead of an expected switched pokemon index, a fix for one would fix the other at the same time. I... just need to figure out the cause. If you have a set up that causes it consistently, that'd do wonders for debugging.
     
    1,682
    Posts
    8
    Years
    • Online now
    Here's a big ol update to make version 1.4!
    No, there's still no v19 support.

    In this version, I fixed the :switch and :choice symbol being sent when not expected. The former was because the pokemon selection in the command phase also used switch in between, so it sends an unexpected symbol if you just open it at all. The latter is because the regular end of round switch would proc in a different order for both sides.
    I also fixed an issue with the server script, in that the --host and --port arguments didn't actually work. Now they do, yay!
    Did something a little experimental with the priority for v16 and v17 since it didn't seem to function in its current state? I just commented out pbPriority and also resend the seed from the host to be copied by the peer. Just in case.

    Still haven't fixed the wonky sendout for EBDX... sorry.

    In terms actual features, mail support! So now you can trade your pokemon holding a nice message for your friend. Also a QoL change, while Waiting for your opponent, it is harder to accidently forfeit as it is now a serious confirm box, so spamming buttons to mash text will cancel the prompt instead of your battle.

    You need to update your server's python script too.
     
    Last edited:
    1,682
    Posts
    8
    Years
    • Online now
    Thanks, that did help! That
    was kinda obvious.. Hahaha

    Im getting a NoMethod error when im trying to trade a fainted pokemon, but all in all its works very well.

    Thanks for the great script :-)

    Taking your post over here in my thread :3c

    I actually came across the source of this, I think. Are you by chance on v16? I left a fainted? call in a section of code that gets executed by v16 games too, and that method doesn't exist in that version, thus crash.

    If you aren't in v16, then yeah I need that full error message.
     
    1,682
    Posts
    8
    Years
    • Online now
    trade_update.gif
    So we have the an improvement to the trade, a confirmation screen that lets you view the summary of the mon traded and let you double check before trading, instead of sight unseen like before.

    With this, we also send more variables, and also stop sending stuff that isn't necessary, like we don't need to send gender if it can be calculated from the PID or overridden by the gender flag.
    This did require adding a new constant to the server, for if it's v18, as v18 sends a few more variables than the other two versions, specifically the nature for stats override, and the ivMaxed array to force a 31 in a particular iv.

    You have to replace the server python because all these new pokemon related variables have to be tracked and validated.

    (I was gonna do false trainer types in this update too, like you appear to other trainers as a regular trainer type like Lady or Bug Catcher, but Windows 10 wants to do a forced update and I don't trust it to not break something.)
     
    27
    Posts
    4
    Years
    • Seen Jul 19, 2023
    Discovered a few more bugs:
    1. There seems to be a problem with critical hits. I crited my opponent, but at my opponents side, i didn't. He had like 10% life left on my screen, but at my opponents screen, he had like 50% left. my opponent also got an error message.
    2. We disconnected from the battle and in the next battle, his Tyranitar was still mega evolved, without performing a mega evolution. When he then tried to mega evolve in the battle (he had the option) nothing happened, because he already was mega evolved.

    Using Essentials v17.2 and the Elite Battle System.


    EDIT: There also seem to be problems with moves that attack multiple times. For example, Rock Blast attacks 2-5 times, when I used this move in a battle, I attacked two times at my side of the screen, but at my opponents side of the screen, I attacked three times.
     

    Attachments

    • 9e4b9c05bb23f22f8b3b2cf81f937bcc.png
      9e4b9c05bb23f22f8b3b2cf81f937bcc.png
      13.7 KB · Views: 9
    1,682
    Posts
    8
    Years
    • Online now
    Discovered a few more bugs:
    1. There seems to be a problem with critical hits. I crited my opponent, but at my opponents side, i didn't. He had like 10% life left on my screen, but at my opponents screen, he had like 50% left. my opponent also got an error message.
    2. We disconnected from the battle and in the next battle, his Tyranitar was still mega evolved, without performing a mega evolution. When he then tried to mega evolve in the battle (he had the option) nothing happened, because he already was mega evolved.

    Using Essentials v17.2 and the Elite Battle System.


    EDIT: There also seem to be problems with moves that attack multiple times. For example, Rock Blast attacks 2-5 times, when I used this move in a battle, I attacked two times at my side of the screen, but at my opponents side of the screen, I attacked three times.

    It might be worth trying to uncomment the pbPriority method.
    while testing it didn't seem to be functioning for me, but perhaps it'll fix these issues for you.
     
    27
    Posts
    4
    Years
    • Seen Jul 19, 2023
    It might be worth trying to uncomment the pbPriority method.
    while testing it didn't seem to be functioning for me, but perhaps it'll fix these issues for you.

    Just tried it out, but sadly it does not change anything. :/
     
    2
    Posts
    3
    Years
    • Seen Nov 1, 2022
    Hi, I'm having some issues with both vanilla PE 17.2 and 18.1. When a pokemon faints, it's owner becomes stuck on 'Waiting....'. This also happens to be the case for the opponent on 17.2, but on18.1 the opponent is able to select moves (which fail due to having no target).
     
    2
    Posts
    3
    Years
    • Seen Nov 1, 2022
    Hi, I'm having some issues with both vanilla PE 17.2 and 18.1. When a pokemon faints, it's owner becomes stuck on 'Waiting....'. This also happens to be the case for the opponent on 17.2, but on18.1 the opponent is able to select moves (which fail due to having no target).

    I had some time to debug this, you just need to change line 1020 in the ruby script to:
    Code:
     battlers[i] = @battlers[order[i]]
     

    Boxply

    Decently Experienced Ruby Coder
    21
    Posts
    2
    Years
    • He
    • Seen Aug 27, 2021
    This thing is amazing! v19 needs to be made
     

    Boxply

    Decently Experienced Ruby Coder
    21
    Posts
    2
    Years
    • He
    • Seen Aug 27, 2021
    Who could update this to v19?
     
    Back
    Top