Ulysses
Ulysses Stuff => Suggestions => Topic started by: lpha on September 26, 2007, 01:14:32 AM
-
Hello all,
I just want to add something on my server which can be useful for other persons.
At the moment, it is possible to add a windows for the motd by entering !motd in chat.
A lot of people add all their mod list in this motd.
I want to create something that when you enter !addons or !mod in chat, you have a similar windows that open the content of your installed_addons.txt (new file) in \addons\ulx.
Another thing would be the possibility of having a !rules command that open rules.txt in \addons\ulx
Thanks for your help ;D
-
Your looking for something like UMotd, I'm not sure if it's still working though. I think it's still broken. http://forums.ulyssesmod.net/index.php/topic,658.0.html (http://forums.ulyssesmod.net/index.php/topic,658.0.html)
I haven't had the chance to test out anything as my PC is dead but anyone else have any input in this?
-
Umotd is in a coma for now.
I won't say it's dead, because it may be revived again some day.
But, for now, it's in a deep coma. Not on life support, brain activity is there, just very little. :)
-
Why not just make it? It's not some crazy GUI thing he's asking for, all he wants is a simple system.
I can't make it because my computers dead right now, and I don;t have gmod installed.
Could even just at the simplest have it read the folder names in /addons for the list.
-
Time, patience, mood.
For any projects I do, I really have to be in a programming mood.
For various reasons I don't wish to share, I just haven't been in the mood to update/remake Umotd.
As for actual technical challenge of reading the addons..No, it's not that difficult.
I'd already made unreleased Umotd code (before the Garry Gmod HTML update/our ULX release that outdated Umotd) that would read the addon name and author.
It was part of my Umotd Todo list.
--ToDo: Get Addon list
function Umotd_GetAddons(Ufmt,Usep) -- fmt = long = Mod Name(version) description, short = Mod Name(version). sep = what to use as seperator.
local U_aloc = "../addons/"
local U_AddonDirs = file.FindDir(U_aloc .. "*")
local UAddRslt = false
for Uaid, Udir in pairs(U_AddonDirs) do
if file.Exists(U_aloc..Udir.."/info.txt") then
local UAddInfo = util.KeyValuesToTable(file.Read(U_aloc..Udir.."/info.txt"))
if not UAddRslt then
UAddRslt = UAddInfo["name"] .. "("..UAddInfo["version"]..")"
else
UAddRslt = UAddRslt..Usep..UAddInfo["name"] .. "("..UAddInfo["version"]..")"
end
if Ufmt == "long" then UAddRslt = UAddRslt .. " by [" ..UAddInfo["author_name"].."]"
end
end
end
return UAddRslt
end
local UAddons_long = Umotd_GetAddons("long",Umotd_AddOnSep1)
local UAddons_short = Umotd_GetAddons("short",Umotd_AddOnSep2)
The above code example is raw, and can't be used without modification to adjust.
It has no error checking either. Feel free to use it in your own code. Try to give me a little credit if you do.
-
How does this work, where do i have to add it ?
If i understand, this code check the folders in /addons/ so the addons list is automaticaly up to date.
-
As stated, this is raw code and not meant for 'works as is'.
Sorry.
-
The code for gathering a list of addons is also in the new "ulx debuginfo" command.
-
Spbogie, hehe, yeah.
Meg told me this after I'd made my post.
I'd written this bit of code back in February.
Not difficult, but a nice feature just the same.
I told Meg his was probably fewer lines of code than mine.
His code is much more polished.