Random Broadcaster for GM/Admin

Kong

New member
Messages
224
Points
0
Emulator
Hello if there's anyone here who could be generous enough to provide an NPC like this that would be greatly appreciated.

So we have a random news broadcaster that looks like this:

- script News -1,{OnInit:set .Time,60; // Announce every x Minute.setarray .News$[0], // Random Message to be Announced "Blablablablah", "Jeeejejejejejeeeh"; while( 1 ){ announce .News$[ rand( getarraysize( .News$ ) ) ],bc_all,0x99CC00; sleep ( .Time * 60000 ); }end;}
However the problem is that when we have new things to announce to the server (ex. Modified EXP rates event / drop rate / an event to happen in an hour) we'll have to do @reloadscript just to reload this file again everytime you have an update. And we all know the CONS of using @reloadscript in-game..

I have come up with an idea where there would be an NPC (only accessible by admins/gms) where you could store "News / Announcements" and configure the X number of minutes it will randomly show up all the news stored in the NPC. This way we can dynamically manage to 'Add, Edit, Delete' current news/announcement without having to reload the server. 

So if we have to announce something, we just have to access that NPC maybe through an "@" command and add new announcement. And maybe configure the number of minutes it will randomly show all stored announcements. If possible, there's also a way to show the number of news currently being rolled.

For future developments:

  • Maybe we can allow "active/inactive" state of news so GMs/Admins can simply deactivate that announcement (without removing it in the list)



Huhuhuu... paging @@AnnieRuru

 
@@Kong

there's @unloadnpc and @loadnpc ☺

use those commands to reload that specific script

example:

@unloadnpc npc/custom/broadcaster.txt

@loadnpc npc/custom/broadcaster.txt

 
@@Kong

there's @unloadnpc and @loadnpc ☺

use those commands to reload that specific script

example:

@unloadnpc npc/custom/broadcaster.txt

@loadnpc npc/custom/broadcaster.txt
Unfortunately there's a bug with @loadnpc, when you use it to load the broadcaster, 2 broadcaster will simultaneously broadcast news. lol

 
Does @unloadnpc/@unloadnpcfile succeeds before using @loadnpc?

 
@@Kong

there's @unloadnpc and @loadnpc ☺

use those commands to reload that specific script

example:

@unloadnpc npc/custom/broadcaster.txt

@loadnpc npc/custom/broadcaster.txt
Unfortunately there's a bug with @loadnpc, when you use it to load the broadcaster, 2 broadcaster will simultaneously broadcast news. lol
This means you failed to unload the first one.
default_smile.png


You can see your map server that the npc was duplicated

 
www.eathena.ws/board/index.php?s=&showtopic=272409&view=findpost&p=1492359

yeah ... stupid eathena forum down

luckily I always reupload everything stuffs on since rathena times

https://rathena.org/board/pastebin/21hkxkuvt6dl

 
Last edited by a moderator:
Back
Top