Reload Addon?

Author Topic: Reload Addon?  (Read 1335 times)

Is there a quick way to reload an addon from the console?
Like If I had modified a file and want to test out the changes?

exec it and transmitdatablocks();?

depends if its just a script or not
if it is:
Code: [Select]
exec("file/path/here/starts/at/blockland/dir");im not sure if it will work but its worth a shot

depends if its just a script or not
if it is:
Code: [Select]
exec("file/path/here/starts/at/blockland/dir");im not sure if it will work but its worth a shot
Correct; but it must be in the blockland folder.

** = Either config, base, add-ons, or screenshots.
* = File name
***  = Main folder path

exec("**/***/*.extension");

example:

exec("add-ons/Server_Visolator/server.cs");

You can also make a function and just do that function everytime.

function reloadMe()
{
   discoverfile("add-ons/FileName.zip"); //Discover it if you made any changes whatsoever
   exec("add-ons/FileName/server.cs"); //Exec it a faster way using the function
}
« Last Edit: December 12, 2013, 07:17:23 PM by Advanced Bot »

If it's just a script with no datablocks,

either discoverFile("path/to/file.zip"); or setModPaths(getModPaths()); (latter one probably takes longer in most cases but might be less cumbersome to type). This only applies if it's in a .zip file though, if it's just in a folder this isn't necessary.

and then exec("path/to/script.cs"); (e.g. exec("Add-Ons/Script_Mouse/server.cs"); )


If it has datablocks, then you run into a few more issues. It's generally a better idea to just restart the server in that case, as datablocks aren't meant to be modified like that. Though there are workarounds.
« Last Edit: December 12, 2013, 07:17:31 PM by otto-san »

Thanks for the replies guys, will definitely try these out!