Add lua function bbs_get_info

This commit is contained in:
Andrew Pamment
2016-08-04 17:27:52 +10:00
parent 82005fe9e2
commit ecf5e9faf8
2 changed files with 55 additions and 34 deletions

View File

@@ -12,7 +12,7 @@ local char = bbs_read_char();
local i = 0;
if char == "Y" or char == "y" then
if char == "Y" or char == "y" then
return;
end
@@ -25,18 +25,25 @@ while(true) do
else
break;
end
i = i + 1;
end
-- Display Info
local bbsname;
local sysopname;
local systemname;
local machinename;
bbsname, sysopname, systemname, machinename = bbs_get_info();
bbs_write_string("\027[1;37mSystem Information\r\n");
bbs_write_string("\027[1;30m----------------------------------------------\r\n");
bbs_write_string("\027[1;32mBBS Name : \027[1;37mCauldron BBS\r\n");
bbs_write_string("\027[1;32mSysOp Name : \027[1;37mAndrew\r\n");
bbs_write_string("\027[1;32mBBS Name : \027[1;37m" .. bbsname .. "\r\n");
bbs_write_string("\027[1;32mSysOp Name : \027[1;37m" .. sysopname .. "\r\n");
bbs_write_string("\027[1;32mNode : \027[1;37m" .. string.format("%d", bbs_node()) .. "\r\n");
bbs_write_string("\027[1;32mBBS Version : \027[1;37m" .. bbs_version() .. "\r\n");
bbs_write_string("\027[1;32mSystem : \027[1;37mA Banana PI!\r\n");
bbs_write_string("\027[1;32mSystem : \027[1;37m" .. systemname .. " (" .. machinename .. ")"\r\n");
bbs_write_string("\027[1;30m----------------------------------------------\r\n");
bbs_write_string("\027[0mPress any key to continue...\r\n");
bbs_read_char();
@@ -50,13 +57,13 @@ local ltime;
bbs_write_string("\r\n\027[1;37mLast 10 callers:\r\n");
bbs_write_string("\027[1;30m-------------------------------------------------------------------------------\r\n");
while (i < 10) do
user, location, ltime = bbs_read_last10(i);
if (user ~= nil) then
bbs_write_string(string.format("\027[1;37m%-16s \027[1;36m%-32s \027[1;32m%s\r\n", user, location, os.date("%H:%M %d-%m-%y" ,ltime)));
end
i = i + 1;
end
bbs_write_string("\027[1;30m-------------------------------------------------------------------------------\r\n");
@@ -76,5 +83,3 @@ end
bbs_mail_scan();
-- Done!