Subj : JS Commission?
To : echicken
From : Android8675
Date : Wed Jul 15 2020 09:40 am
> You might try:
> const story = format('stories/%s', argv[0]);
> const save_dir = backslash(format('%sif/%s', system.data_dir, story));
> const save_file = format('%s%d', save_dir, user.number);
> and then adjust your script to use save_file instead of save_dir.
> Or you could condense it to:
> const save_file = backslash(format('%sif/stories/%s', system.data_dir,
> argv[0])) + user.number;
frotz needs a folder for saves. I wonder if I could put all the saves in one
folder. Gotta check what frotz uses for save filenames. If the filename
contains a story marker then I could probably use:
const story = format('stories/%s', argv[0]);
const save_dir = backslash(format('%sif/saves/%s', system.data_dir,
user.number));
That'd dump all saves for one user in /sbbs/data/if/saves/(user.number)/
Next question how do I take a const from 1-4 and pass 4 different results based
on the number?
Basically
> const colors = console.getnum(4, 1);
then pass different strings based on the answer like..
> bbs.exec(
> 'frotz ' +
> '-h ' + console.screen_rows +
> '-w ' + console.screen_columns +
> '-f ' + (colors ? 'green' : 'white' : 'white' : 'yellow') + // <---
> these bits here
> '-b ' + (colors ? 'black' : 'black' : 'blue' : 'black') +
> '-R ' + save_dir +
> story
> );
Final final... why doesn't the background on this line switch to blue? Ctrl-A
"4" should be blue background.
> console.putmsg(" 3.\1h\14 White on Blue\1n");
--
Android8675@ShodansCore
---
� Synchronet � Shodan's Core @ ShodansCore.com