@@ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ @@ SGP @crontab installer - 17 February 2001 BETA @@ @@ Code courtesy of Jeff Hulsey. @@ @@ This is a quotable installer file that installs code designed to simulate @@ the functionality of a crontab. It allows you to schedule the triggering @@ of code without putting @waits in the queue for each action. @@ @@ @crontab can serve as a replacement for Myrddin's MUSHCron and is designed @@ to be much less queue intensive. @@ @@ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ @@ This file installs the Crontab Command Object for the adding and removing of @@ jobs from the @crontab and Mush Cron Object for data storage. @@ @@ This file also includes the necessary +help attributes and code to install @@ them into the SGP softcoded +help system. Any +help system that accepts @@ &HELP_ attribute syntax will be able to used the data attributes, with @@ appropriate modifications of the object name. MUX users should use the @@ staffhelp.txt update found on the SGP website. @@ @@ Installer assumes that your SGP installation includes +version commands for @@ including this object in your local +version listing. Install +version @@ before installing this code. @@ @@ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ @@ Using this file: @@ @@ This code is in BETA form. This means that we believe that we have debugged @@ it sufficiently for it to run in your application, but that there may be bugs @@ we failed to anticipate. Make sure you run a test of the code @@ and report any problems to the SGP bug page(http://sgp.erisian.net/). There @@ may be a design or feature issue that we need to reconsider before the full @@ release of the code. @@ @@ ALL code in this file is uncommented and will quote to the game with your @@ MUSH client's uploading commands. The command object should reside in the @@ master room and the data object is stored, by default, inside it. @@ @@ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @pemit me=Creating @crontab objects. Moment.... @create SGP - @crontab=10 @create SGP - @crontab DB=10 @wait 0=&SGP-OBJECTS SGP - Global Parent Object=[get(SGP - Global Parent Object/SGP-OBJECTS)]|[num(SGP - @crontab)] @wait 0=&SGP-OBJECTS SGP - Global Parent Object=[get(SGP - Global Parent Object/SGP-OBJECTS)]|[num(SGP - @crontab DB)] @wait 0=&SGP-VERSION SGP - @crontab=1.0|Base|[elements(time(),2 3 5)] @wait 0=&SGP-VERSION SGP - @crontab DB=1.0|Base|[elements(time(),2 3 5)] &UPDATE-HISTORY SGP - @crontab=Base Install [elements(time(),2 3 5)] &UPDATE-HISTORY SGP - @crontab DB=Base Install [elements(time(),2 3 5)] @pemit me=Quoting @crontab commands. Moment.... @lock SGP - @crontab=SGP - @crontab @wait 0=&DB SGP - @crontab=num(SGP - @crontab DB) &CMD.CRONADD SGP - @crontab=$@cron/add *=*/*:@switch/first 0[setq(1,strlen(get(v(db)/CRON_TIME_[setr(0,u(v(db)/fn.strip,%0))])))]=andflags(%#,W),{@pemit %#=get(v(db)/HUH)},not(strlen(setr(9,setdiff(first(lcstr(%1),|),jan feb mar apr may jun jul aug sep oct nov dec)))),{@pemit %#=Invalid month: %q9},not(strlen(setr(9,setdiff(extract(lcstr(%1),3,1,|),sun mon tue wed thu fri sat)))),{@pemit %#=Invalid day of week: %q9},eq(5,words(%1,|)),{@pemit %#=Incomplete crontab entry},isdbref(setr(9,first(%2,|))),{@pemit %#=Invalid dbref: %q9},{&CRON_TIME_%q0 [v(db)]=%1;&CRON_JOB_%q0 [v(db)]=%2;@pemit %#=Cron job [ucstr(%q0)] [switch(0,%q1,add,edit)]ed.} &CMD.CRONDEL SGP - @crontab=$@cron/del *:@switch 0=andflags(%#,W),{@pemit %#=get(v(db)/HUH)},strlen(get(v(db)/CRON_TIME_[setr(0,u(v(db)/fn.strip,%0))])),{@pemit %#=No such job: [ucstr(%q0)]},{&CRON_TIME_%q0 [v(db)];&CRON_JOB_%q0 [v(db)];@pemit %#=Cron job [ucstr(%q0)] deleted.} &CMD.CRONHELP SGP - @crontab=$@cron/add:@switch 0=andflags(%#,W),{@pemit %#=get(v(db)/HUH)},{@pemit %#=Usage: @cron/add =