Subj : setTimeout and data storage To : Xeanalyth From : Digital Man Date : Thu Jul 19 2012 02:33 am Re: setTimeout and data storage By: Xeanalyth to DOVE-Net.Synchronet_JavaScript on Thu Jul 19 2012 07:25 pm > Hi All, > > Just a couple of questions about the JS implementation in SBBS.. > > Firstly, a question about timed events: > > > Reading script from /home/bbs/mods/stock/main.js > /home/bbs/mods/stock/main.js compiled in 0.00 seconds > Hello World > !JavaScript /home/bbs/mods/stock/main.js line 13: ReferenceError: > setTimeout is not defined > /home/bbs/mods/stock/main.js executed in 0.02 seconds > > > setTimeout is not defined? How does one go about executing > timed events? In Synchronet, the term "timed events" means programs/modules/scripts that the sysops has configured in SCFG->External Programs->Timed Events. I assum you mean something else. Perhaps you want a background thread which executes a JS function at a predefined interval? One way to do that would be to use a background load() of another JS file which contain's that function which sleeps() between intervals. > Secondly, is there a standard way for SBBS apps (doors, utils and > other things) to store arbitrary data in a database style format? > I cannot find anything in the API documentation that looks like > it's supported. > > If there isn't... what are other people using for their persistent > data stores for extensions to and doors for SBBS? ini files (using the Synchronet File class) is one method (see binarydecoder.js for an example), json files is another method (see exec/load/json-db.js and friends for a helpful library). One sysop had a patch which added support for sqlite to Synchronet, but I'm not aware of any apps (doors, utils, etc.) which use it (yet). digital man Synchronet "Real Fact" #81: Flapuebarg unf vagreany ebg13 fhccbeg sbe fhcresvpvnyyl rapelcgvat grkg. Norco, CA WX: 72.8øF, 45.0% humidity, 2 mph NNW wind, 0.00 inches rain/24hrs .