Author Topic: Easier way to reload add-ons  (Read 591 times)

I get tired of having to restart my blockland with all my add-ons. I want to just reload them while I am playing Blockland since I have a chatbot. I usually use exec(); but it won't work at all for me. Please help me find an easier way to reload add-ons without (hopefully) having to restart Blockland all the time.

since you seem to be using these in an add-on form

discoverFile("path/to/zip.zip"); exec("path/to/zip/script.cs");

or, alternatively

setModPaths(getModPaths()); exec("path/to/zip/script.cs");

since you seem to be using these in an add-on form

discoverFile("path/to/zip.zip"); exec("path/to/zip/script.cs");

or, alternatively

setModPaths(getModPaths()); exec("path/to/zip/script.cs");
um, can you explain what they do


If you update a file in a zip, then attempt to execute said file, it'll forget up

This is due to the resource manager caching where the files are in the zip, if the length changes it will read the wrong section of the zip and get an incomplete file, hence why this is necessary when working out of a zip

Code: [Select]
function _r(%name,%mode)
{
   if(%name $= "")
      %name = getWord($r_last,0);
   if(%mode $= "")
      %mode = getWord($r_last,1);
   else %mode = strReplace(%mode," ","");
   %path = "Add-Ons/" @ %name;
   if(isFile(%path @ ".zip"))
   {
      discoverFile(%path @ ".zip");
   }
   if(striPos(%mode,"c") != -1 && isFile(%path @ "/client.cs"))
      exec(%path @ "/client.cs");
   if(striPos(%mode,"s") != -1 && isFile(%path @ "/server.cs"))
      exec(%path @ "/server.cs");
   $r_last = %name SPC %mode;
}
$r_last = "Weapon_Gun s";
$ _r("Weapon_stuffAddOn","s");
$ _r();


Easiest option is to just make a folder with the same name as your zip, and move the contents of your zip in there.

When you make the final zip, be sure to NOT zip it like this

Server_Blah.zip -> Server_Blah -> blah.cs

As opposed to this

Server_Blah.zip -> blah.cs