Is there a reason why bbs.menu_exist() does not allow using a directory before the file name like bbs.menu()?
bbs.menu("dir\file_base") works for when I want to specify an ansi outside of the menu directory (I use it with user.command_shell a lot) but bbs.menu_exists("dir\file_base") always comes back negative.
bbs.menu_exists() with a sub-directory specified should work fine. See xtrn_sec.js as an example which check for the existence (and displays) text/menu/xtrn/*.*.
Re: bbs.menu vs bbs.menu_exists
By: Digital Man to nolageek on Mon Jan 13 2020 02:26 pm
bbs.menu_exists() with a sub-directory specified should work fine. See xtrn_sec.js as an example which check for the existence (and displays) text/menu/xtrn/*.*.
I can't figure out why this code doesn't work then:
function mystMenu(file) {
// check for 'file' in current command shell menu dir and if not found use // 'mystique' menu directory
if (bbs.menu_exists(user.command_shell + '/' + file)) {
bbs.menu(user.command_shell + '/' + file);
} else {
bbs.menu('mystique/' + file);
}
}
If I then use mystMenu('mainmenu'); in my shell, it always shows the menu from the mystique directoy - even though they exist in both.
Does the file text/menu/<shell>/mainmenu.asc exist? The .msg or .asc version of a menu file must exist for bbs.menu_exists() to return true.
Does the file text/menu/<shell>/mainmenu.asc exist? The .msg or .asc version of a menu file must exist for bbs.menu_exists() to return true.
Re: bbs.menu vs bbs.menu_exists
By: Digital Man to nolageek on Tue Jan 14 2020 09:55 am
Does the file text/menu/<shell>/mainmenu.asc exist? The .msg or .asc version of a menu file must exist for bbs.menu_exists() to return true.
mainmenu.ans exists - does bbs.menu_exists() test for .msg or .asc but not .ans? That would explain it, but why would it not check for the same file types that bbs.menu() displays?
At minimum, a .asc or .msg menu display file is required. bbs.menu() first looks for the *most* applicable file format, not all file formats.
Are .msg and .asc faster or are they "more native" to synchronet? Just curious.
Re: bbs.menu vs bbs.menu_exists
By: Digital Man to nolageek on Tue Jan 14 2020 03:00 pm
At minimum, a .asc or .msg menu display file is required. bbs.menu() first looks for the *most* applicable file format, not all file formats.
But it will find .ans - I guess I expected bbs.menu() and bbs.menu_exists() to work with the same formats so they could work together.
I could convert I
gues (but then I'd have to always convert back and forth to edit them.)
Are
.msg and .asc faster or are they "more native" to synchronet? Just curious.
Sysop: | Tandy |
---|---|
Location: | New York, USA |
Users: | 15 |
Nodes: | 13 (0 / 13) |
Uptime: | 03:46:02 |
Calls: | 335 |
Messages: | 112,921 |