Cheating on My Colony for Fun and Profit? pt.2 – Topping up your Resources

Hey G33ks,

So if you didn’t notice it yet, I started building my own cheating script for My Colony.
If you didn’t read part 1, then I definitely recommend to go read that first, as it will give you a great insight on what I’ve been doing so far.
In this part, I will top up the resources.
First, I’ll tackle the non-limited resources (ones that – unlike food for example – do not need storage, like gold).
Then, I’ll handle the other resources later.


This post is intended for educational use only.
I am in no way or shape responsible for any damages done!
Please make sure you made adequate preperations before proceeding.

and again: I do not endorse cheating!


Reading Parts list

Because this is a multi-part research, here are the links to all parts:


Learning the resource data

First, ofcourse, I had to learn how the resource data works.
I did expect it to look similar to the buildings data, and I was right!
Unfortunately for me, each and every building that could hold resources was in there as well.
But then again, I wanted to tackle the non-limited resources first.


Editting the Money

So I started with the money first.
I started by dumping the array containing the money data.
Doing so made me able to read out the JSON a lot easier.
Again, here is it’s structure in the save file:

					"Gold Mint":95382,
					"Mass Driver":700
					"Civic Center":1222,
					"Gold Mint":42

So now that we have that, I could edit the amount with relative ease (Yes, I am aware of function names jumping all around lol).
However, this doesn’t look legit at all.
So, I added the difference to the Gold Mintinflow and the allCurrent & allTime inflow! 🙂

However, just setting it to a static 9999999999 isn’t fun.
So I added a new input for the money-total, and added the needed code to the script as well 🙂

I added some more code, for example, for the toggle to finish buildings or not before I gave it another shot.

So, I imported my game again,


But after a little while, something rather funny happened 😛

Oh crap..

The game started to take adding $14 to the balance a bit too literally 😛
So, back to the drawing board it was 🙂

After a bit of troubleshooting, I figured out that the values in the JSON where no longer integers.
Which meant that instead of doing 1 + 1 = 2, it did "1" + 1 = "11" (or something like it).

So I editted the code a little to make integer values of it again,



Editting the Other Unlimited Resources

With the money changer finished, I could do the same with all the other unlimited resources.
This was as easy as copy-pasting the code, changing some values and done 🙂 (it actually took me quite some time to do this lol)
Unfortunately for some, I didn’t bother about wood, clay etc, just the resources you can find on the Red Planet map (it’s very easy to adapt to other planets so).
However, the code is quite unoptimized, but it’s fine for now 🙂


Making it look more legit

In case you noticed: you can get Uranium without even having Uranium unlocked.
To prevent these cases, I updated the code some more to make it look slightly more legit 🙂

Did my usual import stuff,

Wohoo, it works!

Yes, Uranium doesn’t show up there because I don’t have Uranium unlocked yet (I can unlock it already, but I was too lazy) 🙂


Editting the limited Resources

Next up was topping up the resources that do require storage (for example, food).
This was relatively easy to do as well now that I know the JSON structure of the save file better.

I added another checkbox to the form, made a function to top off all the other resources (This is where I realized Microchips are limited), did my usual import stuff,


Yes, the inflows aren’t correct, but I think you can figure that out on yourself 🙂

So that basically means we can now complete all buildings, get unlimited resources, and still (sorta) look legit 🙂
How cool!

Well, that’s it for this part 🙂
I hope you guys enjoyed!
I think next part will be “making” a better relationship with the United Earth, and make my colonists less angry at me 🙂
But until then…

G33k Out!

Comments ( 12 )

  1. Avatarpgsx
    FinlayDaG33k, Could you verify this is still working? I've set up the script on a LAMP stack and it appears functional. But when I actually try to upload a file the only output I get back is: bnVsbA== I'm wondering if the save file is still base64 encoded. I'm using My Colony 0.39.0, and it appears you were using 0.28.0 when this was written. Thanks, pgsx
    • AvatarFinlayDaG33k
      Hii There, I've looked into the issue, and found that while they do still use base64, they seem to combine it with something else. It seems they have patched this cheat. I am not looking into making it work again at this time, but maybe later. who knows?
    • Avatarpgsx
      Just a quick note. bnVsbA== is null encoded to base64. :)
      • AvatarFinlayDaG33k
        I know :) (but that was so obvious that I didn't mention it) Try decoding the text in your file from base64, you'll get gibberish (atleast, so did I), meaning there is *some kind* of encryption.
  2. AvatarTimo Beutlin
    ok so heres the error im getting: Warning: file_get_contents(): Filename cannot be empty in C:\xampp\htdocs\index-script.php on line 119 Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\index-script.php on line 18 bnVsbA== i think i will tinker around a bit and see whats going on
    • AvatarFinlayDaG33k
      Try using a Linux based webserver instead. I didn't test it with Windows.
  3. AvatarTimo Beutlin
    Thanks for your reply! I think i just want to test the game in singleplayer-mode because im not that into this multiplayer-feature of my colony, so i think this is fine :D i will give this process a try and i will reply if everythings working =)
  4. AvatarTimo Beutlin
    Aloha :O I dont quite understand how to reproduce this on my own save :s im kinda confused and did a lot of research about this topic (my colony-editing) and this thread is the only one ive found so far which is useful haha. anyway.. how do i do this on m own save ? i tried to analyze what you have done here, and i klicked all the links, but it doesnt make sense to me (for now). i would appreciate any suggestions from you :D sorry for my bad grammar, english is not my native language =)
    • AvatarFinlayDaG33k
      Hii Timo, First of all, I do want you to remember that I do not endorse cheating. So all the consequenses (getting banned, hated by the community etc. etc.) are for you if you decide to do so. With that out of the way, we can continue. The reason that you couldn't find anything on this, is because as far as I know, I'm the only one who legitimately looked into it (the other hits on google just want to scam you lol) :p Have you already read part 1? if not, I highly suggest you doing so, as it contains the most crucial information (namely how the save itself works)! If you don't know how to use PHP, JSON or program at all, then I'd highly reccommend not cheating, as there is a lot to cover about the save file that I didn't explore myself. But all you need to use the cheating script is a webserver with PHP5.6 or higher. just upload the script, then access it through your webbrowser. the script: Basically to use the script: 1. you download and "install" the script onto your webserver (can be local, can be on a webhost, doesn't matter that much) 2. you open the script on your webserver in your webbrowser (so for example 3. you upload your file, and enter the rest of the info 4. paste the output of the script into the save file (this has to be done manually, I was a bit too lazy to automatically output the file again lol) 5. upload savefile back to the game I hope you can continue with this information, if not, please let me know where exactly you are stuck, so I can help you a bit more specifically :) G33k Out!
    • AvatarChin Shou (肥肥熊)
      Hello Timo Beutlin maybe you can try this: set Game save compression off that should work :)
      • AvatarFinlayDaG33k
        That might actually work :p will report back later.
        • AvatarFinlayDaG33k
          Jepp, turning compression of seems to work :)

Leave a reply