Haiku Flag email

If you need to have the same function do multiple things, you have to define this function somewhere central and have logic to make it do what you want when you want.
 
I combined them last night but now I get an error:

Apr 24/12 8:01 AM: Home: Unhandled exception in script on line: 4 in function onSyncStart: Can't find variable: now


function onSyncStart(forced, timestamp) {
if(!isCollectingEvents) collectEvents();

helper.log(controller, 'Started sync at ' + now.getHours() + ':' + now.getMinutes());
var date = new Date(timestamp);


if(date.getHours() == 23 && date.getMinutes() == 19) {
sendPoolMeterReport();
poolMeterDay = 0;
if(date.getDay() == 0) poolMeterWeek = 0;
}
}
 
Replace
Code:
 helper.log(controller, 'Started sync at ' + now.getHours() + ':' + now.getMinutes());

with

Code:
helper.log(controller, 'Started sync at ' + date.getHours() + ':' + date.getMinutes());
 
I commented the line out and it appears that the mailer still isn't working :( Can I email you the entire script so you can take a look?
 
Back
Top