Optimization to bot customization

#1

Right now PhantomBot reminds me a bit of WordPress in the early days. Super powerful, and you can customize anything you want, but once you upgrade you lose all your customizations because they are spread out over a vast directory structure and difficult to track.

With the addition of the root “config” folder we now have a single place for most of the data we need to copy over to new versions, which makes upgrading a lot easier. But any custom code or modifications to language files is woven into the rest the directories. A good example would be the language files. Thankfully our modifications can live in the “custom” folder, but that is still nested within /scripts/lang/

It would be awesome if any modifications a user makes were isolated in a single location to make upgrading easier, and lower the possibility of an upgrade causing issues that may make users reluctant to upgrade.

For example, the “config” folder could have a scripts/lang/custom/ sub directory structure where language customizations could live. The same for custom addons, scripts, etc.

There are so many bits of custom functionality, modules, language modifications, etc I’ve been wanting to make, but I’ve been reluctant to do so because right now it would mean me maintaining a checklist of changes I’ve made so every time I upgrade I could individually copy over all my changes. I actually just discovered that my old modifications to some language files did not get copied over in my last upgrade, which is something I’m usually pretty attentive to.

#2

I know this doesn’t solve the problem completely, but you can create custom folders (and sub-folders) to separate the scripts (the non-lang portions). The bot recursively goes through any folders that exist when loading them.

#3

There’s quite a bit of tools out there that can read the differences in a file. I personally use one called WinMerge to check my files so I know what to change again.

For the most part, all custom scripts go under /scripts/custom/ and as you mentioned, all lang files are in /scripts/land/custom/. The only time I have issues updating is if I decided to modify the core code, which with how they’ve been updating the bot, I’ve actually had less and less need to do so.

There’s also a whole guide on language modification so you don’t actually have to modify the existing lang folder:

I know these aren’t end-all be-all solutions but they’re better than nothing.

#4

I’ll see what I can do, already have an idea on how to do this easily and not slowdown anymore while loading scripts at boot-up.

3 Likes