@Skorm
its seems everything is working to me even if the variable for sunday is 0. The countdown is working fine. it automatically starts the WoE and end the WoE to the date and time the I set it up.
P.S
even if I use this one its still working fine.
//Skormie's WOE Waitingroom Timer v1.02.1
//Should natively work with Euphy's WOE Controller.
prontera,150,150,5 script Woe Time 100,{
end;
OnInit:
function add_zero;
function woe_update;
.@Euphy_Len = getarraysize( $WOE_CONTROL );
if( .@Euphy_Len ) {
for( .@i = 0; .@i < .@Euphy_Len; .@i += 4 ) {
.woe_day[ getarraysize( .woe_day ) ] = $WOE_CONTROL[.@i];
.woe_hour[ getarraysize( .woe_hour ) ] = $WOE_CONTROL[.@i+1];
}
} else {
setarray .woe_day, 5, 4; //Day of the week WOE Starts on. (0 for Sunday, 6 is Saturday)
setarray .woe_hour, 16, 20; //rAthena works on a 24 hour clock.
}
woe_update();
while ( 1 ) {
.@woe_tick = .woe_time[.current] - gettimetick(2);
.@day = .@woe_tick / 86400;
.@hour = .@woe_tick % 86400 / 3600;
.@min = .@woe_tick % 3600 / 60;
.@sec = .@woe_tick % 60;
.@mes$ = add_zero( .@day ) +
add_zero( .@hour ) +
add_zero( .@min ) +
add_zero( .@sec, 1 );
delwaitingroom strnpcinfo(0);
waitingroom agitcheck() ? "WOE is Active!" : .@mes$, 0;
sleep 1000;
}
end;
OnAgitEnd:
woe_update();
end;
function add_zero {
return ( ( getarg(0) < 10 ) ? "0" : "" )+ getarg(0) +( getarg(1,0) ? "" : ":" );
}
function woe_update {
.@woe_len = getarraysize( .woe_day );
for( .@a = 0; .@a < .@woe_len; .@a++ ) {
.@woe_day[.@a] = ( .woe_day[.@a] - gettime(4) + 7 ) % 7 * 86400;
.@woe_hour[.@a] = ( .woe_hour[.@a] * 3600 ) - gettimetick(1);
.woe_time[.@a] = gettimetick(2) + .@woe_day[.@a] + .@woe_hour[.@a];
if(gettimetick(2) > .woe_time[.@a])
.woe_time[.@a] = .woe_time[.@a] + 7 * 86400;
if( .woe_time[.@a] <= .woe_time[.current] )
.current = .@a;
}
}
}
I dont see any error or experience unusual while the both script are running.
What I did was I combined your timer to Euphy's WoE Controller.