Jump to content
  • 0

Woe Chatroom Timer


Question

1 answer to this question

Recommended Posts

  • 0
Posted
//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;
        }
    }
}

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...