Jump to content
  • 0
Sign in to follow this  
orange

repeated announcement

Question

hello hercules

 

i want to make a specific announcement in my server every hour. i have 3 messages to  broadcast every 1 hour. 

 

i want each message to be announced once in 3 hours. eg if i i have message A, B and C. then 1st hour message A is announced , 2nd hour message B is announced and 3rd hour message C is announced and then the 4th hour again message A is announced and so on.

 

 

Please help me with such a script.

 

Thank you :)

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

never tried this

-	script	news	-1,{	OnInit:        set .Time,60;        // Announce every x Minute.	setarray .News$[0],	// Random Message to be announced						"1 hi",						"2 hello",						"3 holla";				while(1){		if(getarraysize(.News$)==.xxx-1)			set .xxx, 0;					announce .News$[.xxx],bc_blue;		set .xxx, .xxx + 1;		sleep ( .Time * 60000 );	}}

edit from http://rathena.org/board/files/file/2503-random-news/

Edited by mleo1

Share this post


Link to post
Share on other sites
  • 0

Here's my method using the OnMinuteXX label as a trigger. It's a bit less effort and allows for virtually limitless amounts of announcements; when the last announcement has been made, it will repeat from the beginning on the next hour.

-	script	announce	-1,{	/*-----------------------------------------------------	Script	-----------------------------------------------------*/	OnInit:		// Announcement messages		setarray .news$[0],	"This is the first announcement.",							"This is the second announcement.",							"This is the third announcement.";				// Announcement options in corresponding order		setarray .options[0],	bc_all,								bc_all|bc_blue,								bc_all|bc_yellow;				end;			/*-----------------------------------------------------	Configuration	-----------------------------------------------------*/	OnMinute00:		announce .news$[.i], .options[.i];		.i++;				if (.i == getarraysize(.news$)) {			.i = 0;		}				end;}

Share this post


Link to post
Share on other sites
  • 0

You can set any number of announcements you want, just change the "This is the first announcement.", "This is the second announcement.", "This is the third announcement.", "4th", "5th"; and so on. The script adapts to any number of announcements you have. Remember last member of the array should end with a semicolon ( ;), not a comma (,) and you're good to go.

Share this post


Link to post
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.   Restore formatting

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.