Hiya gang...
When it's a user's birthday, I know Synch sends them a message wishing them Happy Birthday. That msg, must be within a text file somwhere. Can anyone tell me where to find the file or is it hardwired?
It's the "HappyBirthday" line in the ctrl/text.dat file.
When it's a user's birthday, I know Synch sends them a message wishing them Happy Birthday. That msg, must be within a text file somwhere. Can anyone tell me where to find the file or is it hardwired?
There is a '329 HappyBirthday' in text.dat which appears to be
colorized Happy Birthday text.
You can also set an external program to Execute on Event 'Birthday'
via scfg, so presumably that would get triggered (during logon?) on
the user's configured birthday.
Re: Birthday...
By: Digital Man to Bill McGarrity on Sat Apr 14 2018 22:42:26
Hiya Rob...
It's the "HappyBirthday" line in the ctrl/text.dat file.
OK.. great. So there is no way I can replace that with an ansi file... it's text based only?
Would something like this work?
var birthfile = user.birthday + format("birthday.asc",;
if(file_exists(birthfile))
console.printfile(birthfile)
When it's a user's birthday, I know Synch sends them a message wishing th Happy Birthday. That msg, must be within a text file somwhere. Can anyone tell me where to find the file or is it hardwired?
It's the "HappyBirthday" line in the ctrl/text.dat file.
echicken wrote to Bill McGarrity on 04-15-18 03:38 <=-
Re: Birthday...
By: Bill McGarrity to echicken on Sun Apr 15 2018 02:19:34
Would something like this work?
var birthfile = user.birthday + format("birthday.asc",;
^ This line would produce an error. 'format' isn't really needed here.
The trailing comma and lack of a closing bracket would make the script fail to compile.
if(file_exists(birthfile))
console.printfile(birthfile)
If you want to display a particular .asc/.ans file on the user's
birthday, then I think DM's suggestion (@-codes in text.dat to display
a file) would be best, and would take the place of these two lines of
JS.
If I wanted to do something more, I would create a script in my mods directory, then set it up as an external program via scfg, and have it Execute on Event - Birthday. Here we'll subtract the user's birthdate from the current date (in milliseconds), and then find out how many
years old they are:
console.printfile(system.text_dir + 'birthday.asc');
var now = new Date().getTime();
var ubd = new Date(user.birthdate).getTime();
var age = Math.floor((now - ubd) / (1000 * 60 * 60 * 24 * 365.25)); console.putmsg('You are ' + age + ' years old!');
(Date.getTime() returns a timestamp in milliseconds; 'age' is the
current time, minus the user's birthdate, divided by the number of milliseconds in a year.)
Digital Man wrote to Bill McGarrity on 04-14-18 22:42 <=-
Re: Birthday...
By: Bill McGarrity to All on Sun Apr 15 2018 01:22 am
Hiya gang...
When it's a user's birthday, I know Synch sends them a message wishing them Happy Birthday. That msg, must be within a text file somwhere. Can anyone tell me where to find the file or is it hardwired?
It's the "HappyBirthday" line in the ctrl/text.dat file.
Thanks for the input! I would like to do something more towards your example. Now, if and when I get this js project done, can I comment out (or remove) the Happy Birthday line in the text.dat file or will it play havoc?
Digital Man wrote to Bill McGarrity on 04-15-18 14:44 <=-
Re: Birthday...
By: Bill McGarrity to echicken on Sun Apr 15 2018 12:09 pm
Thanks for the input! I would like to do something more towards your example. Now, if and when I get this js project done, can I comment out (or remove) the Happy Birthday line in the text.dat file or will it play havoc?
You can't comment-out or remove lines from the text.dat (generally speaking), but setting the line to an emptry string ("") should do the trick. Your script can also change that text.dat item dynamically
(without touching the text.dat file) by using the bbs.replace_text() function. See http://synchro.net/docs/jsobjs.html for details - and load('text.js') to get the variable names for each text.dat line loaded into your script.
| Sysop: | Winzlo |
|---|---|
| Location: | Minnesota, USA |
| Users: | 11 |
| Nodes: | 16 (0 / 16) |
| Uptime: | 495937:20:16 |
| Calls: | 82 |
| Files: | 1,070 |
| D/L today: |
27 files (11,920K bytes) |
| Messages: | 286,956 |