Jump to content
  • 0

change OnMinute00 to specific time in a day LMS script


Heartfelt

Question


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.01
  • Content Count:  31
  • Reputation:   0
  • Joined:  01/09/16
  • Last Seen:  

how can i change this LMS script to start at 1 PM 3 PM 5 PM and 7 PM  only?

thanks in advance
 

// Edit by Mabuhay

-	script	Event_LMS	-1,{
OnInit:
	// item reward
	setarray .item,
		501, 10,
		502, 5;

	// @lmsstart - gm manual start
	bindatcmd "lmsstart", strnpcinfo(0)+"::OnStart",60,60;
	
	// @lms - player join event
	bindatcmd "lms", strnpcinfo(0)+"::OnJoinEvent";
	
	// Event cooldown
	.event_cd = 60 * 60 * 1; // 1hr
	
	// Mapflags
	setarray .@mapflag,
		mf_nowarp,
		mf_nowarpto,
		mf_noteleport,
		mf_nomemo,
		mf_nosave,
		mf_noicewall,
		mf_nobranch,
		mf_noreturn;
		
	for ( .@i = 0; .@i < getarraysize(.@mapflag); .@i++)
		setmapflag "06guild_01", .@mapflag[.@i];
		
	.@min = gettime(DT_MINUTE)*60;
	.@sec = gettime(DT_SECOND);
	.event_time = (gettimetick(2) - ( .@min + .@sec )) + .event_cd - 5;
	end;
	
OnJoinEvent:
	mes " [ Event Status ] ";
	if ( !.start ) mes "Next schedule starts in ^FF0000"+ Time2Str(.event_time) +"^000000.";
	if ( .start == 1 ) mes "Event is currently active.";
	if ( .start == 2 ) mes "Event is currently on-going.";
	next;
	switch(select(
		"Last Man Standing Event - "+ ((.start == 1) ? "^00ff00Join Event":((.start == 2) ? "^00ff00Event On-Going":"^ff0000Not Available"))+"^000000" )) {
	case 1:
		if ( !.start ) {
			mes "Event is not available.";
			close;
		} else if ( .start == 2 ) {
			mes "Event is on-going";
			close;
		}
		else
			warp "06guild_01",0,0;
	}
	end;

OnStart: .@force = true;
OnMinute00: // runs hourly
	.@time = gettimetick(2);
	.@min = gettime(DT_MINUTE)*60;
	.@sec = gettime(DT_SECOND);
	if ( .event_time > .@time && !.@force || .start && !.@force ) end; // doesnt start if cd isn't done.
	.event_time = (.@time - ( .@min + .@sec )) + .event_cd - 5;  
	.start = 1;
	pvpoff "06guild_01";
	announce "LMS: We are going to have a Last Man Standing event.",0;
	sleep 10000;
	announce "LMS: For those who wants to join, use @lms",0;
	sleep 10000;
	announce "LMS: After 1 Minute Event will close.",0;
	sleep 10000;
	announce "LMS: So please if you want to join. use @lms",0;
	sleep 60000;
	announce "LMS: The entry to the event is now closed.",bc_all,0x0ceedb;
	if ( getmapusers("06guild_01") < 2 ) {
		announce "LMS: Not enough participants.",bc_all,0x0ceedb;
		.start = false;
		end;
	}
	.start = 2;
	sleep 3500;
	mapannounce "06guild_01","We're about to begin the event.",bc_map,0x0ceedb;
	sleep 2500;
	mapannounce "06guild_01","The rules are simple.",bc_map,0x0ceedb;
	sleep 2500;
	mapannounce "06guild_01","Kill everyone in the map.",bc_map,0x0ceedb;
	sleep 2500;
	mapannounce "06guild_01","Last Man Standing wins!",bc_map,0x0ceedb;
	sleep 2000;
	mapannounce "06guild_01","That's all. Let's begin.",bc_map,0x0ceedb;
	sleep 3000;
	for (.@i = 10; .@i > 0; .@i--) {
		mapannounce "06guild_01", "LMS: -- "+.@i+" --",bc_map,0x0ceedb;
		sleep 1000;
	}
	mapannounce "06guild_01", "LMS: Fight! ",bc_map,0x0ceedb;
	pvpon "06guild_01";
	.timer = 0;
	initnpctimer;
	end;
	
OnTimer5000: // check every 5 secs..
	.timer++;
	.@size = getmapusers("06guild_01");
	if ( .@size > 1 && .timer == 6 ) {
		.timer = 0;
		mapannounce "06guild_01", "LMS: "+ .@size +" players left..", bc_blue;
	} 
	else if ( .@size <= 1 )
		donpcevent strnpcinfo(3)+"::OnEndEvent";
	setnpctimer 0;
	end;
	
OnEndEvent:
	stopnpctimer;
	.start = false;
	pvpoff "06guild_01";
	mapannounce "06guild_01", "LMS: Event ended!",bc_map,0x0ceedb;
	sleep 5000;
	.@size = getmapunits(BL_PC,"06guild_01",.@aid);
	if ( .@size == 0 ) {
		announce "LMS: No winners.",0;
		end;
	}
	.@amt = getarraysize(.item);
	attachrid .@aid;
	announce strcharinfo(0)+" has won the Last Man Standing Event.",bc_all,0x0ceedb;
	for ( .@j = 0; .@j < .@amt; .@j += 2 )
		getitem .item[.@j], .item[.@j+1];				
	warp "invek",rand(146,164),rand(149,164);
	end;
	
OnPCDieEvent:
	if ( .start && strcharinfo(3) == "06guild_01" ) {
		warp "invek",rand(146,164),rand(149,164);
		.@size = getmapusers("06guild_01");
		if ( .@size > 1 )
			mapannounce "06guild_01", "LMS: "+ .@size +" players left..", bc_blue;
		else if ( .@size <= 1 )
			donpcevent strnpcinfo(3)+"::OnEndEvent";
	}
	end;
	
}

 

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  102
  • Reputation:   6
  • Joined:  03/02/18
  • Last Seen:  

just edit and put your schedule using OnClock...

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.01
  • Content Count:  31
  • Reputation:   0
  • Joined:  01/09/16
  • Last Seen:  

2 hours ago, AceofSpades said:

just edit and put your schedule using OnClock...

sorry im noob.. which part sir?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  132
  • Reputation:   53
  • Joined:  06/02/12
  • Last Seen:  

Hi. Find this line:

.@time = gettimetick(2);

And add above it:

if (gettime(DT_HOUR) != 13 && gettime(DT_HOUR) != 17 && gettime(DT_HOUR) != 19) end;

 

Edited by Racaae
correction
Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

On 3/30/2023 at 12:07 PM, GarudaRO123 said:
OnMinute00: // runs hourly

change to

OnClock1300:
OnClock1500:
OnClock1700:
OnClock1900:

 

Link to comment
Share on other sites

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.

×
×
  • Create New...