Find User here you can look for a user

API for reference?

6y
#1
Its been a while, buts its good to be back! I remember before I took a break from things my colony, I was attempting to somehow use a discord bot to look up things in the my colony reference. If any one has ideas about this let me know.

Thanks,

Orcinus
5y
#2
Well you would just use the game data file for the current version. You can find it using the following syntax:

https://www.apewebapps.com/apps/my-colony/0.60.0/game.js

whereby you just change the version number in the URL to reflect the latest release version of the game. The entire file is a JSON object so it should be easy enough to parse.
Owner of Ape Apps, LLC
5y
#3
OK, I think I was thinking about that but didn't know how to/where to start thanks @bastecklein
5y
#4
I have parts of it working now, but I'm not sure how to get the "description" of various things. It almost seems like its a link or something. Any ideas?
5y
#5
Oh yes, the Description field is a reference to a string in this file:
https://www.apewebapps.com/apps/my-colony/0.60.0/strings.js

I made this so I could localize My Colony at some point.
Owner of Ape Apps, LLC
3y
#6
bastecklein said:Well you would just use the game data file for the current version. You can find it using the following syntax:

https://www.apewebapps.com/apps/my-colony/0.60.0/game.js

whereby you just change the version number in the URL to reflect the latest release version of the game. The entire file is a JSON object so it should be easy enough to parse.

annoyingly, (using 1.5.0) this does not seem to be the case. if it was JSON I could use
$gamedata = json_decode(file_get_contents('https://www.apewebapps.com/apps/my-colony/1.5.0/game.js'),true)
to get a nice PHP array; as it is I have to use
<script src="https://www.apewebapps.com/apps/my-colony/1.5.0/game.js"></script>
<script>document.getElementById('data').value = JSON.stringify(window.ColonyGame);</script>
<input type="hidden" id="data" name="data">
submit the form and then
$gamedata = json_decode($_POST['data'],true);

Having an actual JSON file would be quite useful.
My Colony Discord Server - https://discord.gg/dvJSKBB
3y
#7
https://coloniae.space/static/json/gameversions/

hf

also klingon, these json files are made in python using a similar technique using the game.js, albeit less robust but working. I think your way is the best we have

the post was 2 years old though...
Creator of Coloniae
Admin of the MC2 translation project
3y
#8
Eventually the game data file is going to be a straight JSON file, as I have been working on a desktop application to edit and generate the game data file for me, so I do not have to make manual edits to it anymore. Don't ask me about a timeframe though!
Owner of Ape Apps, LLC
3y
#9
It almost is JSON. I tried treating it as such in PHP using json_decode. all I had to do was remove the commented out line, remove "window.ColonyGame = " and ";" and change some numbers from .1 to 0.1.
it worked, but it wasn't great.
My Colony Discord Server - https://discord.gg/dvJSKBB

Linkback References

My Colony





Welcome
Ape Apps, LLC is an independent software development company founded in 2010 by Brandon Stecklein. Over the years, Ape Apps has published over 400 apps and games across various platforms. You can get in touch with Brandon on Twitter or by leaving a post on his wall @bastecklein
App of the Day