- 0
Sign in to follow this
Followers
0
[ Help ] Memory leak & loop bug at my minutely announcer for hercules
Asked by
Zirius
-
Recently Browsing 0 members
No registered users viewing this page.

Hello! I modified this script: http://rathena.org/board/topic/62184-can-someone-help-me-with-auto-broadcast-script/#entry119609
to work on Hercules, and instead of random, it would announce messages in order by array, here is what I manage to have:
- script News -1,{OnInit: set .Time,1; // Announce every x Minutes. setarray .News$[0], // Message to be Announced "MSG 1", "MSG 2", "MSG 3", "MSG 4", set (.msgs, getarraysize(.News$)); set .NewsID,0;OnTimer5000: //for dev ~zirius//OnTimer60000: initnpctimer; set .Counter, .Counter + 1; if (.Counter >= .Time) { announce .News$[.NewsID], bc_all; set .Counter, 0; set .NewsID, .NewsID +1 ; if (.NewsID == getarraysize(.News$)) { set .NewsID,0; } }}I fast track the time btw, the order of announcing the messages works great, but after the last message it announce "0", so there must be memory leak/loop bug, hope somebody can help me fix it.
Thanks!
P.S. Btw, how can I change broadcast color? LOL. thanks!
Edited by ZiriusShare this post
Link to post
Share on other sites