Jump to content
  • 0

Woe Start Time Chatroom


Question

Posted
 
Hello good, I've been trying for a long time to put a script so that I get the current time that I need to start the woe,
I have only managed to tell me the current time, a tip would be possible to be able to put the npc to tell me in
a chatroom the hours left for the woe to start? Thanks a lot.
This is the code that I have put

OnInit:
while( 1 ){
    delwaitingroom;
    waitingroom ""+gettimestr( "%H:%M:%S %p",21 ),0;
    sleep 1000;
}
end;

 

Thanks so much!

1 answer to this question

Recommended Posts

  • 0
Posted
On 11/1/2020 at 2:27 PM, sacrox said:
 

Hello good, I've been trying for a long time to put a script so that I get the current time that I need to start the woe,
I have only managed to tell me the current time, a tip would be possible to be able to put the npc to tell me in
a chatroom the hours left for the woe to start? Thanks a lot.
This is the code that I have put

OnInit:
while( 1 ){
    delwaitingroom;
    waitingroom ""+gettimestr( "%H:%M:%S %p",21 ),0;
    sleep 1000;
}
end;

 

Thanks so much!




Here Full coded

prontera,149,193,4	script	WOE Information	420,{
	doevent "WOE_CONTROL::OnMenu";
	end;
OnAgitStart:
	while(agitcheck() || agitcheck2() || agitcheck3()) {
		sleep 425;
		specialeffect EF_BEGINSPELL6;
	}
	end;


OnInit:	
	function s;
	function woe_update;
	
	// CONFIG //                  ...If you're not using Euphy's Woe Controller.
	setarray .@start_day,   1, 2, 3, 4, 5, 6, 7; //Day of the week WOE Starts on. (1 for Sunday, 7 is Saturday)
	setarray .@start_hour, 21; //rAthena works on a 24 hour clock.
	.auto_update = 60;            //Auto update timer in seconds.
	
	.woe_len = getarraysize( .@start_day );
	for( .@i = 0; .@i < .woe_len; .@i++ ) {
		.woe_day[ .@i * 4 ] = .@start_day[ .@i ] -1;
		.woe_day[ (.@i * 4) + 1 ] = .@start_hour[ .@i ];
	}
	.woe_len = ( ( .woe_len ) * 4 );
	
	woe_update();

	while ( 1 ) {
		if( !( gettimetick(2) % .auto_update ) )
			woe_update();
		.@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$ = ( .@day  ? .@day  +" day"+    s( .@day )    : "" ) +
		         ( .@hour ? .@hour +" hour"+   s( .@hour )   : "" ) +
		         ( .@min  ? .@min  +" minute"+ s( .@min )    : "" ) +
		         ( .@sec  ? .@sec  +" second"+ s( .@sec, 1 ) : "" );
		delwaitingroom strnpcinfo(0);
		waitingroom (.woe_len ? ( agitcheck() ? "WOE is Active!" : .@mes$ ) : "WOE is Disabled!" ), 0;
		sleep 1000;
	}
	end;
	
OnAgitEnd:
		woe_update();
		end;
	
	function s {
		return ( getarg(0) > 1 ? "s" : "" ) + ( getarg(1,0) ? "" : " " );
	}
	function woe_update {
		if( getnpcid( 0, "WOE_CONTROL" ) ) {
			.@Euphy_Len = getarraysize( $WOE_CONTROL );
			copyarray .woe_day, $WOE_CONTROL, .@Euphy_Len;
			.woe_len = .@Euphy_Len;
		}
		
		for( .@a = 0; .@a < .woe_len; .@a += 4 ) {
			.@woe_day[.@a] = ( .woe_day[.@a] - gettime(4) + 7 ) % 7 * 86400;
			.@woe_hour[.@a] = ( .woe_day[.@a+1] * 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;
		}
	}	
	
}

 

  • Like 1

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...