• 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
    Posts
    1
    Years
    • Seen Oct 24, 2023
    Any tips or tutorial to host for myself? I dont have a credit card, so I need to look for alternatives OR use something called Port Forward that I dont know what it means, I only saw that on my router config one time. Thank you!
     
  • 1,682
    Posts
    8
    Years
    • Seen yesterday
    Any tips or tutorial to host for myself? I dont have a credit card, so I need to look for alternatives OR use something called Port Forward that I dont know what it means, I only saw that on my router config one time. Thank you!

    Sorry, the only tutorial I have is the one provided in the manual. I don't have any alternatives that don't require a credit card. Port forwarding depends on your specific router, so the most I can do is link a general tutorial for it.
    https://www.wikihow.com/Set-Up-Port-Forwarding-on-a-Router
     
  • 22
    Posts
    11
    Years
    • Seen Feb 10, 2024
    Hey I am pretty new to scripting but when I tryed the v18 version I get this error when starting the game.
    Seems to be this code block:

    Code:
    if @discard_records == 0
            begin
              yield record
            else
              raise ProtocolError.new("Unconsumed input: #{record}") if !record.empty?
            end
          else
            @discard_records -= 1
          end

    ebWBYuY.png

    ______
    Edit: Fixing it with chatgtb gives me now this error
    [v16/v17/v18/v19/v20/v21] Cable Club (Online Trades/Battles)
     
    Last edited:

    StCooler

    Mayst thou thy peace discover.
  • 9,320
    Posts
    4
    Years
    • Seen yesterday
    Hey I am pretty new to scripting but when I tryed the v18 version I get this error when starting the game.
    Seems to be this code block:

    Code:
    if @discard_records == 0
            begin
              yield record
            else
              raise ProtocolError.new("Unconsumed input: #{record}") if !record.empty?
            end
          else
            @discard_records -= 1
          end

    View attachment 153571

    ______
    Edit: Fixing it with chatgtb gives me now this error
    View attachment 153574
    Replace the "else" (the one after the "yield record") with "except".

    For the second error, we need to see the code before helping ^^
     
  • 22
    Posts
    11
    Years
    • Seen Feb 10, 2024
    @StCooler
    Replace the "else" (the one after the "yield record") with "except".
    Yeah, that did the trick.

    For the second error, we need to see the code before helping ^^
    It's the code from the script here inside the "cable_club.rb" from the v18. I didn't change anything in the logic of the code. So I can't realy say what is wrong there. You can look into the file yourself if you want to take a better look or here is the part where the error appears:
    (row 26 is @@onUpdateTrainerType = Event.new)

    Code:
    module CableClub
      HOST = "localhost"
      PORT = 9999
      
      ONLINE_TRAINER_TYPE_LIST = [
        [:POKEMONTRAINER_Red,:POKEMONTRAINER_Leaf],
        [:PSYCHIC_M,:PSYCHIC_F],
        [:BLACKBELT,:CRUSHGIRL],
        [:COOLTRAINER_M,:COOLTRAINER_F]
      ]
      
      ENABLE_RECORD_MIXER = false
      # If true, Sketch fails when used.
      # If false, Sketch is undone after battle
      DISABLE_SKETCH_ONLINE = true
      
      @@onUpdateTrainerType                 = Event.new
      
      # Fires whenever the online_trainer_type is changed
      # Parameters:
      # e[0] - the new online_trainer_type
      def self.onUpdateTrainerType;     @@onUpdateTrainerType;     end
      def self.onUpdateTrainerType=(v); @@onUpdateTrainerType = v; end
    end
     

    StCooler

    Mayst thou thy peace discover.
  • 9,320
    Posts
    4
    Years
    • Seen yesterday
    @StCooler

    Yeah, that did the trick.


    It's the code from the script here inside the "cable_club.rb" from the v18. I didn't change anything in the logic of the code. So I can't realy say what is wrong there. You can look into the file yourself if you want to take a better look or here is the part where the error appears:
    (row 26 is @@onUpdateTrainerType = Event.new)

    Code:
    module CableClub
      HOST = "localhost"
      PORT = 9999
     
      ONLINE_TRAINER_TYPE_LIST = [
        [:POKEMONTRAINER_Red,:POKEMONTRAINER_Leaf],
        [:PSYCHIC_M,:PSYCHIC_F],
        [:BLACKBELT,:CRUSHGIRL],
        [:COOLTRAINER_M,:COOLTRAINER_F]
      ]
     
      ENABLE_RECORD_MIXER = false
      # If true, Sketch fails when used.
      # If false, Sketch is undone after battle
      DISABLE_SKETCH_ONLINE = true
     
      @@onUpdateTrainerType                 = Event.new
     
      # Fires whenever the online_trainer_type is changed
      # Parameters:
      # e[0] - the new online_trainer_type
      def self.onUpdateTrainerType;     @@onUpdateTrainerType;     end
      def self.onUpdateTrainerType=(v); @@onUpdateTrainerType = v; end
    end

    Do you have the file "Event Handlers" (or 003_Event_Handlers)?
    You should have "class Event" somewhere, but not in a "module RPG". If not, you miss files.
    The other explanation is that you may have placed the Cable Club file before the file Event Handlers. The solution is just to place it before Main but after all the other files.
     
  • 22
    Posts
    11
    Years
    • Seen Feb 10, 2024
    Do you have the file "Event Handlers" (or 003_Event_Handlers)?
    You should have "class Event" somewhere, but not in a "module RPG". If not, you miss files.
    The other explanation is that you may have placed the Cable Club file before the file Event Handlers. The solution is just to place it before Main but after all the other files.
    You are right. Now it will find the events but I got another error. Where should be the pbEffect defined? I can only find the module PBEffects in my scripts.

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

    The code is following with 1537 being alias _cc_pbEffect pbEffect

    Code:
    #===============================================================================
      # This move permanently turns into the last move used by the target. (Sketch)
      #===============================================================================
      class PokeBattle_Move_05D
        alias _cc_pbEffect pbEffect
        def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
          if CableClub::DISABLE_SKETCH_ONLINE && [email protected]
            @battle.pbDisplay(_INTL("But it failed!"))
            return -1
          end
          return _cc_pbEffect(attacker,opponent,hitnum,alltargets,showanimation)
        end
      end
     

    StCooler

    Mayst thou thy peace discover.
  • 9,320
    Posts
    4
    Years
    • Seen yesterday
    You are right. Now it will find the events but I got another error. Where should be the pbEffect defined? I can only find the module PBEffects in my scripts.

    View attachment 153696

    The code is following with 1537 being alias _cc_pbEffect pbEffect

    Code:
    #===============================================================================
      # This move permanently turns into the last move used by the target. (Sketch)
      #===============================================================================
      class PokeBattle_Move_05D
        alias _cc_pbEffect pbEffect
        def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
          if CableClub::DISABLE_SKETCH_ONLINE && [email protected]
            @battle.pbDisplay(_INTL("But it failed!"))
            return -1
          end
          return _cc_pbEffect(attacker,opponent,hitnum,alltargets,showanimation)
        end
      end

    I don't have this code in my (editted) file. I have probably removed it because I found it useless ^^"
    "pbEffect" no longer exists in Essentials V18. The function signature should be "pbEffectAgainstTarget(user,target)" instead of "pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)". The valid code should be:

    Code:
    #===============================================================================
      # This move permanently turns into the last move used by the target. (Sketch)
      #===============================================================================
      class PokeBattle_Move_05D
        alias _cc_pbEffectAgainstTarget pbEffectAgainstTarget
        def pbEffectAgainstTarget(user,target)
          if CableClub::DISABLE_SKETCH_ONLINE && [email protected]
            @battle.pbDisplay(_INTL("But it failed!"))
            return -1
          end
          return _cc_pbEffectAgainstTarget(user,target)
        end
      end

    You will probably have similar issues in your script.
     
  • 22
    Posts
    11
    Years
    • Seen Feb 10, 2024
    Thanks. Game is working now.
    Also any idea why I get this error in the server python file? The tm.txt contains entries like "OM_URSARING". Thats normal right?

    Code:
    C:\Users\sirzento\Documents\RPGXP\Project1>python cable_club.py
    Traceback (most recent call last):
      File "C:\Users\sirzento\Documents\RPGXP\Project1\cable_club.py", line 557, in <module>
        Server(args.host, int(args.port), args.pbs_dir).run()
      File "C:\Users\sirzento\Documents\RPGXP\Project1\cable_club.py", line 34, in __init__
        self.valid_party = make_party_validator(pbs_dir)
      File "C:\Users\sirzento\Documents\RPGXP\Project1\cable_club.py", line 368, in make_party_validator
        pokemon_by_name[sname].moves.add(move)
    KeyError: 'OM'

    Code:
    with io.open(os.path.join(pbs_dir, r'tm.txt'), 'r', encoding='utf-8-sig') as tm_pbs:
            move = None
            for line in tm_pbs:
                line = line.strip()
                match = re.match(r'\[([A-Z]+)\]', line)
                if line.startswith('#'):
                    continue
                elif match:
                    move = moves_by_name[match.group(1)]
                else:
                    for name in line.split(','):
                        if name:
                            # TODO: Cheating here to get it to run
                            sname=name.partition('_')[0]
                            pokemon_by_name[sname].moves.add(move)
     
  • 1,682
    Posts
    8
    Years
    • Seen yesterday
    Cable Club 1.11/2.7/3.7 Patch Notes
    • Newly created UI
      • General Overhaul to be easier to add features to all versions, Team Preview
    • Added Rulesets feature and *.rules files
    • Added Developer defined win and lose texts for online battles
    • Added Triple battles to v18+
    • Prevented item duplication/deletion exploits by taking items off a mon mid battle or in a summary screen
    • Fixed Sketched moves appearing invalid
    • Overhauled server_pokemon.txt format, with conversion python script
    • Added compatibility with [MUI] Improved Mementos, Deluxe Battle Kit, [DBK] Z-Power, [DBK] Dynamax, and [DBK] Terastallization add-on
      • If bugs only happens online, it's a Cable Club issue. If it happens offline too, it's the other plugin's issue.
     
  • 1,682
    Posts
    8
    Years
    • Seen yesterday
    Bug Fixes for the Processor Script, DBK & Sketch online workaround
    Fixed the issues causing incorrect data for Pokémon with forms to be saved in the server_pokemon.txt file by the processor script.
    Also fixes the def moves= issue kind of technically caused by DBK if you allow Sketch to be used online.
     
  • 5
    Posts
    1
    Years
    • Seen Jun 1, 2024
    Hi sorry to ask your help for something maybe stupid but i got a problem with the key gender_ratio and i dont know what is the problem, i got this error and i use the cable link for Essential V21
    if someone can help me ?
     

    Attachments

    • [v16/v17/v18/v19/v20/v21] Cable Club (Online Trades/Battles)
      image_2024-03-22_115623793.png
      19 KB · Views: 4
  • 1,682
    Posts
    8
    Years
    • Seen yesterday
    Hi sorry to ask your help for something maybe stupid but i got a problem with the key gender_ratio and i dont know what is the problem, i got this error and i use the cable link for Essential V21
    if someone can help me ?
    Yeah i revised the server pbs format, you need to use the converter script. There are instructions in the manual on how to use it.
     
  • 5
    Posts
    1
    Years
    • Seen Jun 1, 2024
    i read the manual and im block at the part when my log say "invalid party" and i try the command py cable_club.py --log=DEBUG but nothing happen... so i dont know where from the error, its possible one of my plugin make this error ?
     
  • 1,682
    Posts
    8
    Years
    • Seen yesterday
    i read the manual and im block at the part when my log say "invalid party" and i try the command py cable_club.py --log=DEBUG but nothing happen... so i dont know where from the error, its possible one of my plugin make this error ?
    the command makes the server log more data inti the server.log file, which you can open in any text editor. if you tried to connect to the server in debug mode, it should log the exact reject reason.
    The most common cases is if you had one of the Essentials Deluxe/ DBK plugins installed, but didn't set the constants in the server correctly, because the game automatically detects if those plugins are installed.
     
  • 5
    Posts
    1
    Years
    • Seen Jun 1, 2024
    I change by true all plugin i got but i think is not that this is what my debug say when i tried to use it but i dont really understand :/ But thanks for your help ![v16/v17/v18/v19/v20/v21] Cable Club (Online Trades/Battles)
     
  • 1,682
    Posts
    8
    Years
    • Seen yesterday
    I change by true all plugin i got but i think is not that this is what my debug say when i tried to use it but i dont really understand :/ But thanks for your help !View attachment 156777
    You have to open the server.log file, if you run it in debug mode, it'll tell you exactly the issue it had with the party. You can even post it here if you want me to look over it, but without that file, I can only guess based on common issues.
     
  • 5
    Posts
    1
    Years
    • Seen Jun 1, 2024
    That what my server.log say when i try to connect online
     

    Attachments

    • [v16/v17/v18/v19/v20/v21] Cable Club (Online Trades/Battles)
      image_2024-03-26_124543924.png
      12.1 KB · Views: 5
  • 5
    Posts
    1
    Years
    • Seen Jun 1, 2024
    Oh okay i think i got it with the debug (i dont know why but before he didn't want to show me all but this time yes) and its saying me i got invalid move, i gonna try to change that by myself ! thanks for your help and sorry to bothering you !
     
    Back
    Top