• 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?".
  • Forum moderator applications are now open! Click here for details.
  • 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.

GTS system to v17 + Online Panel

tutoriando

Manoel Afonso
17
Posts
6
Years
Good evening guys, after many requests I finally decided to get my hands on the GTS code to upgrade it to version 17 of Pok?mon Essentials.

Apparently the original creator is no longer updating the code, so I did this update, and fixed some bugs he had left too.

I'm going to put the script here, but I highly recommend that you access the Online Panel to have a complete documentation about this script, there you can register several games and download the versions of GTS for v16 as well.

The Online Panel has also been updated, before it only existed in Portuguese, now it's all in English to make it easier for non-brazilians to read, but if you prefer Portuguese, you can change the language in the account settings.

In Portuguese now:
O Online Panel tamb?m foi atualizado, antes ele s? existia em portugu?s, agora ele est? todo em ingl?s para facilitar a leitura de n?o-brasileiros, mas voc? que tem a for?a do Hu3 BR no cora??o pode ir nas configura??es da conta e trocar a linguagem para portugu?s de novo ( ' u ' )


Here is the Online Panel link: http://gts.hillstech.co

So here's the code:

Spoiler:

The GTS code was not created by me, it's Hansiec's creation with the help of Saving Raven, and the credits for the original code are entirely theirs.
 
Last edited by a moderator:
423
Posts
13
Years
  • Age 37
  • Seen Aug 31, 2023
kool thanks for this how easy would it be to add more attributes such as compatability with familytree and birthsigns?
 
423
Posts
13
Years
  • Age 37
  • Seen Aug 31, 2023
think might be easier to figure out adding birthsigns over family tree at least to start with since a birthsign is just a number rather than however family tree records the parent data
 
66
Posts
5
Years
  • Age 23
  • Seen May 2, 2020
I swear this post is the best thing ever! It made my day :D
But there is one annoying bug, when you try to deposit a pokemon it shows your party in the box screen but u cant select any of them until you go down to where the party button is meant to be and press enter on it.

Edit: Rip now im getting this error:
Spoiler:
 
Last edited:
1
Posts
5
Years
  • Age 35
  • Seen May 17, 2018
I am getting the same error as Seedonator. This happens when I am trying to search "by wanted" and "by pokemon". I have not been able to make a successful trade yet.
 
1
Posts
5
Years
  • Age 28
  • Seen Jun 10, 2019
I have a problem with the GTS script - Pokémon Essetials 17.2

unknown.png


unknown.png
 
Last edited:
37
Posts
6
Years
Would anyone know how to call the GTS scene through an app in PokéGear?
I've already tried using the "GTS.open" method directly and also:
scene = Scene_GTS.new
scene.main
However, the screen is frozen with the last graph displayed and the GTS is called, but its graphs do not appear or are not updated.
Could anyone help?
 
46
Posts
4
Years
  • Age 28
  • Seen Mar 22, 2024
I'm getting a 400 when making a POST request to get the online ID, as soon as I try to call the GTS.open script within the game, but I don't believe that I've actually missed any steps. The URL is not malformed, and I followed the tutorial exactly. Any suggestions?

Code:
Interpreter:243:in `pbExecuteScript'
Sockets:562:in `pbPostData'
GTS_MainSystem:1186:in `execute'
GTS_MainSystem:1191:in `getOnlineID'
GTS_MainSystem:1353:in `onlineID'
GTS_MainSystem:1204:in `hasPokemonUploaded?'
GTS_MainSystem:805:in `initialize'
GTS_MainSystem:72:in `new'
GTS_MainSystem:72:in `open'
(eval):1:in `pbExecuteScript'

Interpreter:276:in `pbExecuteScript'
Interpreter:1606:in `command_355'
Interpreter:494:in `execute_command'
Interpreter:193:in `update'
Interpreter:106:in `loop'
Interpreter:198:in `update'
Scene_Map:163:in `follow_update'
Scene_Map:161:in `loop'
Scene_Map:170:in `follow_update'
Following Pokemon:1551:in `update'
[Pokémon Essentials version 17.2]
Exception: RuntimeError
Message: Script error within event 2 (coords 13,6), map 164 (Pokemon Web Services):
Exception: RuntimeError
Message: Sockets:596:in `pbHttpRequest'HTTP Error 400
***Full script:
GTS.open
 
46
Posts
4
Years
  • Age 28
  • Seen Mar 22, 2024
It's probably worth mentioning that this is version 17.2, and when I use the same information to simulate the request through Postman, the call returns a 200 with an online ID. Does anyone who has this script running experienced something like this?
 
46
Posts
4
Years
  • Age 28
  • Seen Mar 22, 2024
Probably going to have to drop this unfortunately, I absolutely cannot figure out why the server is seeing the request as invalid. My best guess is that this function within the Sockets class no longer works properly:

Code:
def pbPostData(url, postdata, filename=nil, depth=0)
  userAgent="Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.14) Gecko/2009082707 Firefox/3.0.14"
  if url[/^http:\/\/([^\/]+)(.*)$/]
    host=$1
    path=$2
    path="/" if path.length==0
    body = postdata.map {|key, value|
       keyString=key.to_s
       valueString=value.to_s
       keyString.gsub!(/[^a-zA-Z0-9_\.\-]/n) {|s| sprintf('%%%02x', s[0]) }
       valueString.gsub!(/[^a-zA-Z0-9_\.\-]/n) {|s| sprintf('%%%02x', s[0]) }
       next "#{keyString}=#{valueString}"
    }.join('&')
    request="POST #{path} HTTP/1.1\nUser-Agent: #{userAgent}\nPragma: no-cache\nHost: #{host}\nProxy-Connection: Close\n"
    request+="Content-Type: application/x-www-form-urlencoded\n"
    request+="Content-Length: #{body.length}\n"
    request+="\n"
    request+=body
    return pbHttpRequest(host, request, filename, depth)
  end
  return ""  
end

Even checking out the packet in wireshark, the request seems to look okay...

Mostly just curious at this point to see if anyone actually has this working currently with PE 17.2

Thanks.
 
46
Posts
4
Years
  • Age 28
  • Seen Mar 22, 2024
Apologies for the many posts, but I'm posting the solution here for anyone else wanting to run this on 17.2. I finally compared the HTTP of each request - Postman and the one coming from my game - using Wireshark, and then I changed the pbPostData function in the Sockets script section accordingly. Replace the existing pbPostData() with this:

Code:
def pbPostData(url, postdata, filename=nil, depth=0)
  userAgent="Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.14) Gecko/2009082707 Firefox/3.0.14"
  if url[/^http:\/\/([^\/]+)(.*)$/]
    host=$1
    path=$2
    path="/" if path.length==0
    body = postdata.map {|key, value|
       keyString=key.to_s
       valueString=value.to_s
       keyString.gsub!(/[^a-zA-Z0-9_\.\-]/n) {|s| sprintf('%%%02x', s[0]) }
       valueString.gsub!(/[^a-zA-Z0-9_\.\-]/n) {|s| sprintf('%%%02x', s[0]) }
       next "#{keyString}=#{valueString}"
    }.join('&')
    request="POST #{path} HTTP/1.1\r\n"
    request+="Host: #{host}\r\n"
    request+="Proxy-Connection: Close\r\n"
    request+="Content-Length: #{body.length}\r\n"
    request+="Pragma: no-cache\r\n"
    request+="User-Agent: #{userAgent}\r\n"
    request+="Content-Type: application/x-www-form-urlencoded\r\n"
    request+="\r\n"
    request+=body
    return pbHttpRequest(host, request, filename, depth)
  end
  return ""  
end

The difference being order of request headers and '\r' characters at the end of each line of the request.
 
55
Posts
4
Years
  • Age 34
  • Seen today
Hopefully this doesn't count as a necropost.

I've run into the same problem as Seedonator where the party window pops in front of the box window and is unusable until selected with the party button (conveniently located behind the party window).

I've tried calling 'pbHidePartyTab' every time the box scene is created but this seems to have no effect.

If someone has a solution or can help me find one, let me know. Otherwise the script works perfectly.
 
37
Posts
6
Years
Hopefully this doesn't count as a necropost.

I've run into the same problem as Seedonator where the party window pops in front of the box window and is unusable until selected with the party button (conveniently located behind the party window).

I've tried calling 'pbHidePartyTab' every time the box scene is created but this seems to have no effect.

If someone has a solution or can help me find one, let me know. Otherwise the script works perfectly.

In PScreen_PokemonStorage, change
Code:
@scene.pbStartBox(self,0)
, when "0" defines whether the party tab will start displaying or not. Credit Vendilly for fix that bug.
 
Back
Top