- 220
- Posts
- 8
- Years
- Seen Apr 18, 2025
Where's link for ver. 1.4?
require 'sockets'
pbChangeOnlineTrainerType
to have a premade method that works with the ONLINE_TRAINER_TYPE_LIST
array. It uses the text that the Psychic in DPPt had.HOST = X.X.X.X
line, and a PORT = XXXX
line. Technically you can have more, but only the last HOST and PORT will work. These override the settings in the script. You don't need to define both in the file either.host=127.0.0.1
port=9999
port=9998
# Pretend this is empty
Hello,
I still encounter a few issues with v17.2 of Essentials.
1. Sometimes, I crit with an attack on my game, but in the game of my opponent, I dont.
2- When I use attacks that hit multiple times (for example fury swipe), it is possible that I attack 3 times in my game but only 2 times at my opponents game.
Is there any way to fix this, because this makes the plugin unplayable.
Awesome plugin regardless, I realy want to fix this issue somehow to use it without problems.^^
Oh sorry. I commented out a method that didn't seem like it was working properly a couple of versions ago, which would affect v16 and 17 projects. def pbPriority.
You can't miss it, big block of green half way down, just delete the =begin and =end.
I tried this out and it seems to work for the second problem. I need to test a little bit more to see, if the problem with the crits is also fixed by this, thank you.^^
I also found another problem: If you use a attack that repeats itself for multiple rounds, for example Petal Dance and you opponent switches the Pokémon for another one, then the switch does not appear for the Petal Dance user and the battle goes out of sync.
Doesnt know, why this happens. If you switch the Pokémon in any other situation, then it works without problem.
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:
- 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 theHOST
andPORT
constants at the top to be the address and port of your server.- 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 theHOST
andPORT
constants at the top. You also need to setEBDX_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.
The v19 version of the script requires at least mkxpz 2.2.3. You do not need the std folder, just the included files.
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).
Newly added in v2.1, a online trainer type that is used in online battles, kind of like how you can appear as different sprites in the Union Room. Call pbChangeOnlineTrainerType to have an easy preset event that allows the player to change using the contents of ONLINE_TRAINER_TYPE_LIST.
ONLINE_TRAINER_TYPE_LIST is an array containing either length 2 arrays (for gender locked trainer types) or a single Trainer Type ID.
Also new in v2.1, an optional serverinfo.ini file, for if you want to let your players set up their own servers. Of course, they will still need the PBS files, same as any server. The ini file contains up to 2 lines, a "HOST = X.X.X.X" line, and a "PORT = XXXX" line. Technically you can have more, but only the last HOST and PORT will work. These override the settings in the script. You don't need to define both in the file either.
Makes testing easier too.
Google Cloud instructions:
- Set up the desired port in the python script, and set the host to "0.0.0.0"
- Sign up for Google Cloud (this requires a credit card, even for the free trial).
- In the side bar, hover "Compute Engine" and select "VM Instances".
- Select "Create Instance".
- Under Machine Configuration, select E2-micro (one of the options supported by Google's free tier).
- Under Boot Disk, select Change, and make it a Ubunto 18.04 (this comes with python 3.6).
- Click Create.
- In the side bar, hover "VPC Networks" and select "External IP Addresses".
- The IP address for the VM we just created should show here. Select CHANGE to reserve it as a static address and give it a name. Copy this address and put it in the ruby script file as the HOST.
- In the side bar, select "Firewall" and create a new Firewall rule, an Ingress rule for all ips (0.0.0.0/0) on TCP port 9999 (or whatever you have it in the script).
- Return to the VM Instances, and press the SSH button to enter the terminal for the VM.
- You are now in the home folder of the VM. You can use the gear to manually upload files one at a time. You need to upload the python script, and the PBS files it requires. (You can also use git to clone the files into the VM.)
- To test, you can run "python3 cable_club.py"
- The server auto shuts down when the ssh session is closed but at that point you have to set up boot scripts for the VM.
Boot Scripts for Google Cloud VMs
- You need to change the python script's PBS property to "./home/YOUR_USERNAME_HERE". YOUR_USERNAME_HERE is the green part of the name before the @. This sets it to the home folder that you log into, adjust further if the PBS files are in a sub folder.
- In "VM Instances", click the name of your VM instance, and select Edit.
- Scroll down to the Custom Metadata section.
- Set the key to "startup-script" (no quotes), and the value to
If your server is in a sub folder, adjust the second line to it's proper location.Bash:#! /bin/bash nohup python3 /home/YOUR_USERNAME_HERE/cable_club.py &
- Save the edits, and stop and reboot the VM.
Version 2.1: https://www.mediafire.com/file/3akzs1os67mktr2/cable_club_port.zip/file
oh i didn't understand a lot if i need to pay something or not, i really wanted a lot to get online features in my fan game of my dreams that i always wanted and wished to finish.
Ah, well, it's kind of yes and no? Like the free tier for google cloud doesn't charge you for 1 vm, the external IP that goes with it, and 1 GB of network traffic, but if you exceed those limits you start getting charged. Plus you need a credit card.
I suppose you can always find a different hosting provider, or even host yourself, with port forwarding, but that's beyond the scope of this script, and I only know how to work it locally or with google cloud.
Hello,
I still encounter a few issues with v17.2 of Essentials.
1. Sometimes, I crit with an attack on my game, but in the game of my opponent, I dont.
2- When I use attacks that hit multiple times (for example fury swipe), it is possible that I attack 3 times in my game but only 2 times at my opponents game.
Is there any way to fix this, because this makes the plugin unplayable.
Awesome plugin regardless, I realy want to fix this issue somehow to use it without problems.^^
I tried this out and it seems to work for the second problem. I need to test a little bit more to see, if the problem with the crits is also fixed by this, thank you.^^
I also found another problem: If you use a attack that repeats itself for multiple rounds, for example Petal Dance and you opponent switches the Pokémon for another one, then the switch does not appear for the Petal Dance user and the battle goes out of sync.
Doesnt know, why this happens. If you switch the Pokémon in any other situation, then it works without problem.
First, thanks! I was Searching functions like this since Aegisrox and Markz show us an implementation of Essentials with Blizzard's RMXOS! Keep going this is just fantastic!
Otherwise, I'm here because I found some "Sync Problems", if you use "Sand Attack" to decrease ACC of Pokemons you can test it, sometimes a Hit Counts on a Player Screen decreasing Pokemon HP, but this didn't happen on the other player Screen, because it counts as a Missed Attack.
Sorry for my english, and Thank you again!
alias __real__rand rand
def rand(*args)
ret = __real__rand(*args)
File.open("errorlog.txt", "a") { |f|
f.write(_INTL("{1} => {2}", args[0], ret)+ "\n")
}
return ret
end
class HandlerHashBasic
from v20, and the respective 005_RecordMixer.rb file, you could still implement the record mixer by referencing def self.connect_to