Auto-update scripts from file (helper-script)
Posted: Mon Aug 02, 2021 4:42 pm
I made a small script that lets you auto-update your mudlet scripts from disk when the file content changes.
It's pretty straightforward, but keep in mind that it will not care if you have multiple scripts with the same name, so keep the script names unique if you decide to use this.
Also, a general disclaimer: This script will not ask any questions, so it will gladly overwrite any changes you made in the local editor if it detects that the corresponding file was updated.
To use it, add the script and update the scriptwatcher.scripts table to fit your needs.
Adjust scriptwatcher.infolevel to 0-2, the default (1) will show you what scripts are being loaded, 2 will probably show you show you more than you want, but is good to get an idea of how it works. Errors will always be shown, even at 0.
Sample output:
It's pretty straightforward, but keep in mind that it will not care if you have multiple scripts with the same name, so keep the script names unique if you decide to use this.
Also, a general disclaimer: This script will not ask any questions, so it will gladly overwrite any changes you made in the local editor if it detects that the corresponding file was updated.
To use it, add the script and update the scriptwatcher.scripts table to fit your needs.
Adjust scriptwatcher.infolevel to 0-2, the default (1) will show you what scripts are being loaded, 2 will probably show you show you more than you want, but is good to get an idea of how it works. Errors will always be shown, even at 0.
Sample output:
Here is the code, let me know if you discover any problems with it (besides the unique name requirement).Updating script [scriptwatcher] from file
No script with name [some test] found