Author Topic: How to find time left before schedule and if something is currently scheduled?  (Read 2744 times)

That function looks valid. The problem may be in the calendarLoop function.

That function looks valid. The problem may be in the calendarLoop function.

Okay, here's the calendarLoop function, although I don't see anything wrong with it either:
Code: [Select]
function calendarLoop(%monthNum, %day, %year, %firstTime)
{
cancel($Calendar);
if(!%firstTime) //Don't do this if it's the first time running through the function
{
$Cal::curD++; //increment the date

if($Cal::curD > $Cal::Days[%monthNum]) //check if we need to increment the month
{
$Cal::curM++; //increment the month
$Cal::curD = 1; //reset the day

if($Cal::curM > 12) //check if we need to increment the year
{
$Cal::curM 1; //reset month
$Cal::curY++; //increment year
} //end if
} //end if
} //end if
else
{
$Cal::curD = %day;
$Cal::curM = %month;
$Cal::curY = %year;
%firstTime = false;
} //end else

%suffix = getSuffix($Cal::curD);
chatMsgAll("\c6It is \c3" @ $Cal::Month[$Cal::curM] SPC $Cal::curD @ %suffix @ "," SPC $Cal::curY @ "\c6.");

$Calendar = schedule($Cal::loop, 0, calendarLoop);
} //end func

line 17 is missing an equals symbol, you should check your console for syntax errors in the future.
« Last Edit: March 25, 2013, 11:50:54 PM by Little Anarchist »

line 17 is missing an equals symbol, you should check your console for syntax errors in the future.
Sorry, I'm new to Torque Script and this is the first thing I am making... I did check my console for errors, but that was previous to fixing the getTimeRemaining().
Anyway, thanks.