1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-12-12 03:00:30 +00:00
This commit is contained in:
Wilma456 (Jakob0815) 2019-05-13 17:54:19 +02:00 committed by SquidDev
parent 0ec3884e98
commit ad33acd7d1
4 changed files with 26 additions and 0 deletions

View File

@ -982,6 +982,8 @@ settings.set( "edit.default_extension", "lua" )
settings.set( "paint.default_extension", "nfp" )
settings.set( "lua.autocomplete", true )
settings.set( "list.show_hidden", false )
settings.set( "motd.enable", false )
settings.set( "motd.path", "/rom/motd.txt:/motd.txt" )
if term.isColour() then
settings.set( "bios.use_multishell", true )
end

View File

@ -0,0 +1,4 @@
View the source code at https://github.com/SquidDev-CC/CC-Tweaked
View the documentation at https://wiki.computercraft.cc
Visit the forum at https://forums.computercraft.cc
You can disable these messages by running "set motd.enable false"

View File

@ -0,0 +1,15 @@
local tMotd = {}
for sPath in string.gmatch(settings.get( "motd.path" ), "[^:]+") do
if fs.exists(sPath) then
for sLine in io.lines(sPath) do
table.insert(tMotd,sLine)
end
end
end
if #tMotd == 0 then
print("missingno")
else
print(tMotd[math.random(1,#tMotd)])
end

View File

@ -269,6 +269,11 @@ local function findStartups( sBaseDir )
return tStartups
end
-- Show MOTD
if settings.get( "motd.enable" ) then
shell.run( "motd" )
end
-- Run the user created startup, either from disk drives or the root
local tUserStartups = nil
if settings.get( "shell.allow_startup" ) then