Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Server Message in event.js.

Newbie Spellweaver
Joined
Jul 22, 2012
Messages
90
Reaction score
0
hey , im trying to make auto notice every X mins for my server.

this is the script: (event.js)

Code:
importPackage(Packages.tools);

var setupTask;

function init() {
    scheduleNew();
}

function scheduleNew() {
    var cal = java.util.Calendar.getInstance();
    cal.set(java.util.Calendar.HOUR, 0);
    cal.set(java.util.Calendar.MINUTE, 0);
    cal.set(java.util.Calendar.SECOND, 0);
    var nextTime = cal.getTimeInMillis();
    while (nextTime <= java.lang.System.currentTimeMillis()) {
         nextTime += 1000 * 3600; //1 Hour
    }
    setupTask = em.scheduleAtTimestamp("start", nextTime);
}

function cancelSchedule() {
    setupTask.cancel(true);
}

function start() {
    scheduleNew();
    em.getChannelServer().broadcastPacket(MaplePacketCreator.serverNotice(6, "message"));
}


now the message isnt showing up in game and idk why, thanks for the help.
 
Newbie Spellweaver
Joined
Jul 22, 2012
Messages
90
Reaction score
0
Did you try to debug your script and check if the task actually gets executed? Is the script even being loaded by the server? Please provide more infromation.
this script is working (i have another system that based on that script), the problem is the message , the message isnt showing up.
 
Upvote 0
Back
Top