Jump to content
  • 0

help regards timing


Yonko

Question


  • Group:  Members
  • Topic Count:  166
  • Topics Per Day:  0.04
  • Content Count:  789
  • Reputation:   50
  • Joined:  04/16/12
  • Last Seen:  

here's the script from eathena i want to modify this at the event will at a certain time:

-	script	KOH#announcer	-1,{

OnClock0000:
OnInit:
disablenpc "KingOfHill";
disablenpc "kohfinish";
end;
}
poring_c02,224,217,5	script	KingOfHillEvent	56,{
if ($started == 1) donpcevent "KingOfHill::Onregister";
if (getgmlevel()>=50) goto L_GM;
mes "[King Of Hill]";
mes "Only my master can open the race";
L_no:
close;
L_GM:
mes "[King Of Hill]";
mes "Hello master, would you like to start the race?";
menu " - Yes",-,"- No",L_no;
close2;
cleararray $kohplayers[0],0,getarraysize($kohplayers);
announce "King Of Hill Event was started",0;
enablenpc "KingOfHill";
enablenpc "kohfinish";
set $started,1;
sleep2 10000;
announce "Please proceed at the middle of Event Room if you want to participate",0;
sleep 10000;
announce "Participants please enter the warp portal now before it will close",0;
initnpctimer;
close;
OnTimer30000:
announce "King Of Hill event will start in about 30 seconds",0;
sleep2 5000;
announce "Hurry and Join the Race",0;
end;
OnTimer50000:
announce "King Of Hill Portal is closed",0;
end;
OnTimer51000:
donpcevent "KOHannouncer::OnEnable";
stopnpctimer;
disablenpc "KingOfHill";
end;
}
//===========================================================
quiz_02,46,375,5	script	KingOfHill	811,{
Onregister:
if ($started == 1) {
mes "Hello would you like to register to join the race?";
next;
menu " -Yes",-," -No",L_no;
	next;
	mes "Thankyou for registering Mr. " + strcharinfo(0) + ", Have fun!";
	if (getarraysize($kohplayers) == 0) setarray $kohplayers[0], getcharid(3);
	else setarray $kohplayers[getarraysize($kohplayers)], getcharid(3);
	atcommand "@option 255,0,0";
	warp "mjolnir_04",77,304;
	end;
}
end;
L_no:
close;
end;
}
//===========================================================
-	script	KOHannouncer	-1,{
OnEnable:
mapannounce "mjolnir_04","The one who will reach the end of the bridge found at the top of the Hill will win the event",16;
announce "Get Ready... Countdown will begin at 5",bc_all;
sleep2 1000;
announce "4",bc_all;
sleep2 1000;
announce "3",bc_all;
sleep2 1000;
announce "2",bc_all;
sleep2 1000;
announce "1",bc_all;
sleep2 1000;
	donpcevent "freezer::OnEvent";
	//areawarp "mjolnir_04",72,307,82,300,"mjolnir_04",77,304;
announce "GO!",bc_all;
end;
}
mjolnir_04,135,208,5	script	Finish Line!::kohfinish	111,2,2,{
if ($started == 0) end;
OnTouch:
if (.winner == 1) {
mes "Sorry we have got a winner.";
end;
}  
if (.winner == 0) {
mes "You win !!";
set .winner,1;
close2;
}  
announce strcharinfo(0)+" is the King of the Hill!!",bc_all;
getitem 7720,1;
set $started,0;
atcommand "@doommap";
atcommand "@kill "+strcharinfo(0);
set .winner,0;
cleararray $kohplayers[0],0,getarraysize($kohplayers);
disablenpc "kohfinish";
end;

}
mjolnir_04,0,0,0	script	freezer	111,2,2,{
OnEvent:
	for (set .@i, 0; .@i < getarraysize($kohplayers); set .@i, .@i + 1) {
	attachrid($kohplayers[.@i]);
	atcommand "@option 0 0 0";
	}
	end;
	}

Edited by Emistry
Please use [CODEBOX] or Attachments for long contents.
Link to comment
Share on other sites

7 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  666
  • Reputation:   93
  • Joined:  04/27/12
  • Last Seen:  

Change:

OnClock0000:

to a time that you want....

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  166
  • Topics Per Day:  0.04
  • Content Count:  789
  • Reputation:   50
  • Joined:  04/16/12
  • Last Seen:  

is the insertion my OnClock0000: correct?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  592
  • Reputation:   31
  • Joined:  11/14/11
  • Last Seen:  

OnClock0000 = 12:00 midnight

OnClock1200 = 12:00 Noon

OnClock1700 = 5:00 PM

- this is a military time..

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  166
  • Topics Per Day:  0.04
  • Content Count:  789
  • Reputation:   50
  • Joined:  04/16/12
  • Last Seen:  

i set that too but seems the event don't start at the designated time

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  666
  • Reputation:   93
  • Joined:  04/27/12
  • Last Seen:  

Oh lol. I just realized you were asking to MAKE this an automated event.. thought you just wanted to change w/e time you had... Umm, hold on...

- script KOH#announcer -1,{
OnInit:
disablenpc "KingOfHill";
disablenpc "kohfinish";
end;
}
poring_c02,224,217,5 script KingOfHillEvent 56,{
if ($started == 1) donpcevent "KingOfHill::Onregister";
if (getgmlevel()>=50) goto L_GM;
mes "[King Of Hill]";
mes "Only my master can open the race";
L_no:
close;
L_GM:
mes "[King Of Hill]";
mes "Hello master, would you like to start the race?";
menu " - Yes",-,"- No",L_no;
close2;
OnClock0000:
OnClock0400:
OnClock0800:
OnClock1200:
OnClock1600:
OnClock2000:
cleararray $kohplayers[0],0,getarraysize($kohplayers);
announce "King Of Hill Event was started",0;
enablenpc "KingOfHill";
enablenpc "kohfinish";
set $started,1;
if(playerattached){sleep2 10000;} else {sleep 10000;}
announce "Please proceed at the middle of Event Room if you want to participate",0;
if(playerattached){sleep2 10000;} else {sleep 10000;}
announce "Participants please enter the warp portal now before it will close",0;
initnpctimer;
end;
OnTimer30000:
announce "King Of Hill event will start in about 30 seconds",0;
sleep2 5000;
announce "Hurry and Join the Race",0;
end;
OnTimer50000:
announce "King Of Hill Portal is closed",0;
end;
OnTimer51000:
donpcevent "KOHannouncer::OnEnable";
stopnpctimer;
disablenpc "KingOfHill";
end;
}
//===========================================================
quiz_02,46,375,5 script KingOfHill 811,{
Onregister:
if ($started == 1) {
mes "Hello would you like to register to join the race?";
next;
menu " -Yes",-," -No",L_no;
 next;
 mes "Thankyou for registering Mr. " + strcharinfo(0) + ", Have fun!";
 if (getarraysize($kohplayers) == 0) setarray $kohplayers[0], getcharid(3);
 else setarray $kohplayers[getarraysize($kohplayers)], getcharid(3);
 atcommand "@option 255,0,0";
 warp "mjolnir_04",77,304;
 end;
}
end;
L_no:
close;
end;
}
//===========================================================
- script KOHannouncer -1,{
OnEnable:
mapannounce "mjolnir_04","The one who will reach the end of the bridge found at the top of the Hill will win the event",16;
announce "Get Ready... Countdown will begin at 5",bc_all;
sleep2 1000;
announce "4",bc_all;
sleep2 1000;
announce "3",bc_all;
sleep2 1000;
announce "2",bc_all;
sleep2 1000;
announce "1",bc_all;
sleep2 1000;
 donpcevent "freezer::OnEvent";
 //areawarp "mjolnir_04",72,307,82,300,"mjolnir_04",77,304;
announce "GO!",bc_all;
end;
}
mjolnir_04,135,208,5 script Finish Line!::kohfinish 111,2,2,{
if ($started == 0) end;
OnTouch:
if (.winner == 1) {
mes "Sorry we have got a winner.";
end;
}  
if (.winner == 0) {
mes "You win !!";
set .winner,1;
close2;
}  
announce strcharinfo(0)+" is the King of the Hill!!",bc_all;
getitem 7720,1;
set $started,0;
atcommand "@doommap";
atcommand "@kill "+strcharinfo(0);
set .winner,0;
cleararray $kohplayers[0],0,getarraysize($kohplayers);
disablenpc "kohfinish";
end;
}
mjolnir_04,0,0,0 script freezer 111,2,2,{
OnEvent:
 for (set .@i, 0; .@i < getarraysize($kohplayers); set .@i, .@i + 1) {
 attachrid($kohplayers[.@i]);
 atcommand "@option 0 0 0";
 }
 end;
 }

Edit: I made it auto-start every 4hours starting at Midnight, so 6x a day. Also, it should still be able to start manually if a GM sets it.

Edited by GmOcean
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

if(playerattached){sleep2 10000;} else {sleep 10000;}

I think just sleep 10000; is enough though

as there's nothing below that require RID

and you should just point out just put

OnClock0000:

OnClock0400:

OnClock0800:

OnClock1200:

OnClock1600:

OnClock2000:

under close2; after GM activation

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  666
  • Reputation:   93
  • Joined:  04/27/12
  • Last Seen:  

I see. I was just worried that if I were to use sleep the player would bug out and not be able to move. But if that's not gonna happen, then yeah your right sleep is all we need.

Also, yes as Annieruru stated, that is all I did to the script to make it auto run.

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