Ulysses Stuff > Releases for ULib v1.*
ULib v1.01 Modules Loader
(1/1)
fackelkind:
Okay, this is nothing big, but perhaps usefull. I added the old module function to ULib, allows you to execute scripte after ULib has loaded.
--- Code: ---if not ULib then
_OpenScript ("lua/ULib/init.lua")
end
if ULib then
if _file.Exists ("lua/ULib/modules") then
local files = _file.Find ("lua/ULib/modules/ulx_*.lua")
_Msg ("=== ULX Modul Loader =================================================\n")
_Msg ("= =\n")
for v in files do
_Msg ("= " .. files[v] .. string.rep (" ", 67 - string.len (files[v])) .. "=\n");
_OpenScript ("lua/ULib/modules/" .. files[v])
end
_Msg ("= =\n")
_Msg ("======================================================================\n")
end
end
--- End code ---
Put this into your lua/init folder (I called it ulx_modules.lua)
JamminR:
Nice job fackelkind! I was just wondering to myself last week that there was no similiar function for ULib
spbogie:
There is a reason that there is no modules loader function in ULib. It's because you simply use _OpenScript("ULib/init.lua") at the begining of your script instead. ULib automaticly checks to make sure it doesn't get loaded a second time.
JamminR:
Spbogie,
True, but I hate loading my init folder full of scripts, ULX related or not.
This way, I can put the scripts related to ULX into a subfolder of Ulib (or wherever else I might like and edit the original loader script)
But, I like to keep things as neat as possible, easier to know where stuff is
Navigation
[0] Message Index
Go to full version