Changes to plugin loading functions
New functions: getPluginsFiles getCondition unloadByRegexp unloadPlugins loadByRegexp loadPlugins reloadByRegexp reloadAll reloadPlugins
Also changed Commands.pm accordingly
@Henrybk Can you explain why these changes were made and how they should be tested? :+1:
I made these changes based on the files loading functions, they can be tested by just loading, unloading and reloading some plugins, I tested it and found no errors.
Alright, hold the phone on this one. @Henrybk It looks like there's a bug in your code which prevents plugins from being loaded manually. Using the current code in the master branch, I can force load a plugin even if it's not enabled in sys.txt.
This is the current behavior:
plugin
-------------------------- Currently loaded plugins ---------------------------
# Name Description
0 macro allows usage of macros
1 profiles Profiles Selector
2 breakTime Automatically disconnect and reconnect at certain time
-------------------------------------------------------------------------------
plugin load plugins/buffplease.pl
Loading plugin plugins/buffplease.pl...
plugin
-------------------------- Currently loaded plugins ---------------------------
# Name Description
0 macro allows usage of macros
1 profiles Profiles Selector
2 breakTime Automatically disconnect and reconnect at certain time
3 Buff Please? Buff people when they ask
-------------------------------------------------------------------------------
As you can see, the 3 plugins defined in sys.txt are loaded by default and I can load other plugins manually.
However, when I try to do the same thing using your branch, this happens:
plugin load plugins/buffplease.pl
Selectively loading plugins...
plugin
-------------------------- Currently loaded plugins ---------------------------
# Name Description
0 macro allows usage of macros
1 profiles Profiles Selector
2 breakTime Automatically disconnect and reconnect at certain time
-------------------------------------------------------------------------------
@Henrybk will you have time to address @itsrachelfish concerns?
Yeah, next week I'll be on vacation and will take a look at it.
@Henrybk do you have free time to fix the error reported?
@Henrybk do you have free time to fix the error reported?
I fixed it:
start.exe --no-connect
plugin
-------------------------- Currently loaded plugins ---------------------------
# Name Description
0 macro allows usage of macros
-------------------------------------------------------------------------------
plugin load event
Loading plugin plugins/eventMacro/eventMacro.pl...
plugin
-------------------------- Currently loaded plugins ---------------------------
# Name Description
0 macro allows usage of macros
1 eventMacro allows usage of eventMacros
-------------------------------------------------------------------------------
Updated documentation: https://openkore.com/wiki/plugin
Automatic load - ok:

Manual load - ok:

Manual reload - ok:

Manual unload - ok:

Manual reload all - ok:

Manual unload all - ok:

manual load all - ok:
