• setTimeout and data storage

    From echicken@VERT/ECBBS to Xeanalyth on Thursday, July 19, 2012 10:14:27
    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 Ragnarok@VERT/DOCKSUD to Digital Man on Sunday, July 22, 2012 23:55:38
    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 Sunday, July 22, 2012 23:57:55
    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 Monday, July 23, 2012 14:56:06
    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 Monday, July 23, 2012 19:46:14
    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