• setTimeout and data storage

    From Xeanalyth@VERT/OGLAROON to DOVE-Net.Synchronet_JavaScript on Thu Jul 19 19:25:04 2012
    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?ããã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?ãããJaredã-- ãJared QuinnãOglaroon BBS - oglaroon.servebeer.comãã---ã þ Synchronet þ Currently Private BBS - Testingã
  • From Digital Man@VERT to Xeanalyth on Thu Jul 19 02:33:51 2012
    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ã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã
  • From echicken@VERT/ECBBS to Xeanalyth on Thu Jul 19 10:14:27 2012
    Re: setTimeout and data storageã By: Xeanalyth to DOVE-Net.Synchronet_JavaScript on Thu Jul 19 2012 19:25:04ãã > !JavaScript /home/bbs/mods/stock/main.js line 13: ReferenceError:ã > setTimeout is not definedãã > setTimeout is not defined? How does one go about executingã > timed events?ããCareful with that "timed events" term - it has its own meaning in Synchronetã(stuff that's been scheduled via SCFG.)ããWhile we don't have the setTimeout function that's present in many browsers, weãdo have exec/load/event-timer.js, which mcmlxxix wrote to provide a Timerãobject. More info is available in the comments at the top of event-timer.js,ãbut here's a rough example of how to use it:ããload("event-timer.js"); // Loads the libraryãvar t = new Timer(); // Instantiates a timer for your scriptãã// Add an event to your timer:ãt.addEvent(30000, true, console.print("LOLDONGS"));ãã/* As your script loops, you'll need to cycle the timer to have it run anyã pending events. */ãwhile(stuff is happening) {ã timer.cycle();ã}ããechickenãelectronic chicken bbs - bbs.electronicchicken.com - 416-273-7230ãã---ã þ Synchronet þ electronic chicken bbs - bbs.electronicchicken.comã
  • From Deuce@VERT/SYNCNIX to Xeanalyth on Thu Jul 19 10:58:32 2012
    Re: setTimeout and data storageã By: Xeanalyth to DOVE-Net.Synchronet_JavaScript on Thu Jul 19 2012 07:25 pmãã > setTimeout is not defined? How does one go about executingã > timed events?ããUsing the Timed Events section of the External Programs bit in scfg.ãã > 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.ããThere's the JSON DB (json-db.js) and RecordFile (recordfile.js)... though I'm
    not sure what you mean be "database style format". There's also the ini bits of the File class.ãã---ãhttp://DuckDuckGo.com/ a better search engine that respects your privacy.ã þ Synchronet þ My Brand-New BBS (All the cool SysOps run STOCK!)ã
  • From Xeanalyth@VERT/OGLAROON to echicken on Fri Jul 20 05:02:59 2012
    On 20/07/12 00:14, echicken wrote:ãã> ã> While we don't have the setTimeout function that's present in many browsers, weã> do have exec/load/event-timer.js, which mcmlxxix wrote to provide a Timerã> object. More info is available in the comments at the top of event-timer.js,ã> but here's a rough example of how to use it:ããThat sounds perfect for what I was after!ããcheers,ãJaredã-- ãJared Quinnã----------------------+-------------------------------------------O---O-ãjared@jaredquinn.info | Knowledge is knowing a tomato is a fruit; iã3:712/101@fidonet | Wisdom is not putting it in a fruit salad.\___/ã----------------------+-------------------------------------------------ãã---ã þ Synchronet þ Currently Private BBS - Testingã
  • From Xeanalyth@VERT/OGLAROON to Digital Man on Fri Jul 20 05:04:29 2012
    On 19/07/12 19:33, Digital Man wrote:ãã> 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).ããThe SQL patch is probably the most appropriate tool for what I'd like toãdo.. any pointers or where I may be able to find it?ããJaredã-- ãJared Quinnã----------------------+-------------------------------------------O---O-ãjared@jaredquinn.info | Knowledge is knowing a tomato is a fruit; iã3:712/101@fidonet | Wisdom is not putting it in a fruit salad.\___/ã----------------------+-------------------------------------------------ãã---ã þ Synchronet þ Currently Private BBS - Testingã
  • From Digital Man@VERT to Xeanalyth on Thu Jul 19 15:45:56 2012
    Re: Re: setTimeout and data storageã By: Xeanalyth to Digital Man on Fri Jul 20 2012 05:04 amãã > On 19/07/12 19:33, Digital Man wrote:ã >ã > > 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).ã >ã > The SQL patch is probably the most appropriate tool for what I'd like toã > do.. any pointers or where I may be able to find it?ããThe patch used to be hosted here:ãhttp://bbs.docksud.com.ar/~ragnarok/sync/js_sqlite/ãbut the file appears to be missing now... get ahold of Ragnarok (Synchronet ãsysop) and see if it's still available somewhere.ãã digital manããSynchronet "Real Fact" #26:ãRob Swindell (digital man) was born approximately 4 hours before the Unix epoch.ãNorco, CA WX: 90.7øF, 29.0% humidity, 15 mph WNW wind, 0.00 inches rain/24hrsã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã
  • From Xeanalyth@VERT/OGLAROON to Deuce on Fri Jul 20 07:58:20 2012
    On 20/07/12 03:58, Deuce wrote:ãã> > 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.ãã> There's the JSON DB (json-db.js) and RecordFile (recordfile.js)... though I'm ã> not sure what you mean be "database style format". There's also the ini bits ã> of the File class.ããby "database style format", I meant just anything that isn't flat textãand is somewhat index-able. Doesn't need to be much more than aãpersistent hash so JSON DB sounds like it would be the best option.ããJaredã-- ãJared Quinnã----------------------+-------------------------------------------O---O-ãjared@jaredquinn.info | Knowledge is knowing a tomato is a fruit; iã3:712/101@fidonet | Wisdom is not putting it in a fruit salad.\___/ã----------------------+-------------------------------------------------ãã---ã þ Synchronet þ Currently Private BBS - Testingã
  • From Corey@VERT/TSGC to Xeanalyth on Thu Jul 19 20:43:56 2012
    Re: Re: setTimeout and data storageã By: Xeanalyth to Deuce on Fri Jul 20 2012 07:58 amãã > Subject: Re: setTimeout and data storageã > @VIA: OGLAROONã > @MSGID: <500882F8.1220.sync_js@oglaroon.servebeer.com>ã > @REPLY: <50084AC8.1219.sync_js@nix.synchro.net>ã > @TZ: 0258ã > On 20/07/12 03:58, Deuce wrote:ã > ã > > > 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.ã > ã > > There's the JSON DB (json-db.js) and RecordFile (recordfile.js)... though ã > > not sure what you mean be "database style format". There's also the ini bã > > of the File class.ã > ã > by "database style format", I meant just anything that isn't flat textã > and is somewhat index-able. Doesn't need to be much more than aã > persistent hash so JSON DB sounds like it would be the best option.ã > ã > Jaredã > --ã > Jared Quinnã > ----------------------+-------------------------------------------O---O-ã > jared@jaredquinn.info | Knowledge is knowing a tomato is a fruit; iã > 3:712/101@fidonet | Wisdom is not putting it in a fruit salad.\___/ã > ----------------------+-------------------------------------------------ã > ããsome program in java,ãsome program with java,ãand some do both.ãã"Practise safe Lunch, Use a Condiment"ããã---ã þ Synchronet þ Three Stooges Gentlemens Club - Las Vegas, Nvã
  • From Tracker1@VERT/TRN to Xeanalyth on Fri Jul 20 00:37:29 2012
    setTimeout is not defined? How does one go about executingã > timed events?ããon http://www.roughneckbbs.com/Downloads.aspx download, and look into the S3ãshell... basically all the input prompts are doing a 1 second timeout, thenãchecking for other stuff (this allows for inbound messages at a commandãprompt).ãã > 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.ããDepends on what you need... if all you need is a key/document store... you canãcreate a directory for your app's data, and put ####.json files... JSON.jsãshould work fine for serialization/deserialization.ãã > If there isn't... what are other people using for their persistentã > data stores for extensions to and doors for SBBS?ããgenerally people are using text configs, serializing json, doing somethingãcustom, or shoe-horning in a database client driver... I wrote a connectorãfor ADO.Net requests at one point... at the time I was using XML, before aãversion of spidermonkey with E4X support, or for that matter the boom ofãJSON... didn't perform well enough at the time.. ymmv.ãã--ãMichael J. Ryan - http://tracker1.info/ãã---ã þ Synchronet þ Roughneck BBS - telnet://roughneckbbs.com - http://roughneckbbs.comã
  • From Tracker1@VERT/TRN to Digital Man on Fri Jul 20 00:39:17 2012
    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).ããIs there an example out there for creating a db, create table,ãinsert/update/delete records etc?ãã--ãMichael J. Ryan - http://tracker1.info/ãã---ã þ Synchronet þ Roughneck BBS - telnet://roughneckbbs.com - http://roughneckbbs.comã
  • From Digital Man@VERT to Tracker1 on Fri Jul 20 11:52:05 2012
    Re: Re: setTimeout and data storageã By: Tracker1 to Digital Man on Fri Jul 20 2012 12:39 amãã > > 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).ã >ã > Is there an example out there for creating a db, create table,ã > insert/update/delete records etc?ããWith Ragnarok's sqlite patch? I have no idea, I don't see the patch anymore, so ãthat's a question for Ragnarok.ãã digital manããSynchronet "Real Fact" #48:ãSynchronet program was named 'sbbs' instead of 'sync' to avoid conflict w/Unix.ãNorco, CA WX: 87.4øF, 35.0% humidity, 6 mph NW wind, 0.00 inches rain/24hrsã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã
  • From Ragnarok@VERT/DOCKSUD to Digital Man on Sun Jul 22 23:55:38 2012
    El 19/07/12 19:45, Digital Man escribió:ã> ã> The patch used to be hosted here:ã> http://bbs.docksud.com.ar/~ragnarok/sync/js_sqlite/ã> but the file appears to be missing now... get ahold of Ragnarok (Synchronet ã> sysop) and see if it's still available somewhere.ã> ã> digital manã> ãthanks for warning, i recovery the files.ãSaludos!ãã---ã þ Synchronet þ Dock Sud BBS TLD 24 HS - http://www.docksud.com.ar - telnet://bbs.docksud.com.arã
  • From Ragnarok@VERT/DOCKSUD to Tracker1 on Sun Jul 22 23:57:55 2012
    El 20/07/12 04:39, Tracker1 escribió:ã> > 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).ã> ã> Is there an example out there for creating a db, create table,ã> insert/update/delete records etc?ã> ããyou can see the example file:ããhttp://bbs.docksud.com.ar/~ragnarok/sync/js_sqlite/js_sqlite_test.jsããand little example app:ããhttp://bbs.docksud.com.ar/~ragnarok/sync/rssviewer/ãã---ã þ Synchronet þ Dock Sud BBS TLD 24 HS - http://www.docksud.com.ar - telnet://bbs.docksud.com.arã
  • From Xeanalyth@VERT/OGLAROON to Ragnarok on Mon Jul 23 14:56:06 2012
    On 23/07/12 12:57, Ragnarok wrote:ãã> you can see the example file:ã> ã> http://bbs.docksud.com.ar/~ragnarok/sync/js_sqlite/js_sqlite_test.jsã> ã> and little example app:ã> ã> http://bbs.docksud.com.ar/~ragnarok/sync/rssviewer/ããAwesome... That's *exactly* what I'm looking for!ããJaredã-- ãJared Quinnã----------------------+-------------------------------------------O---O-ãjared@jaredquinn.info | Knowledge is knowing a tomato is a fruit; iã3:712/101@fidonet | Wisdom is not putting it in a fruit salad.\___/ã----------------------+-------------------------------------------------ãã---ã þ Synchronet þ Currently Private BBS - Testingã
  • From Xeanalyth@VERT/OGLAROON to Ragnarok on Mon Jul 23 19:46:14 2012
    On 23/07/12 12:57, Ragnarok wrote:ãã>> > 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).ã>>ã>> Is there an example out there for creating a db, create table,ã>> insert/update/delete records etc?ã>>ã> ã> you can see the example file:ã> ã> http://bbs.docksud.com.ar/~ragnarok/sync/js_sqlite/js_sqlite_test.jsã> ã> and little example app:ã> ã> http://bbs.docksud.com.ar/~ragnarok/sync/rssviewer/ããI've updated your patch to work with the latest CVS source.. along withãdealing with updating some calls which are now obsolete in mozjs. I'llãforward you a copy once I've finished testing it.ãããJaredã-- ãJared Quinnã----------------------+-------------------------------------------O---O-ãjared@jaredquinn.info | Knowledge is knowing a tomato is a fruit; iã3:712/101@fidonet | Wisdom is not putting it in a fruit salad.\___/ã----------------------+-------------------------------------------------ãã---ã þ Synchronet þ Currently Private BBS - Testingã