Elpies Event

Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Forum rules
READ NOW: L2j Forums Rules of Conduct
Attila
Posts: 441
Joined: Mon May 05, 2014 10:15 am

Elpies Event

Post by Attila »

L2J Revision Number:5649
L2JDP Revision Number:10448

Hi

how can i make Elpies Event auto start 3 time a day

Can some help me whit this please

Thanks
User avatar
AntV
Posts: 177
Joined: Mon May 10, 2010 10:46 pm

Re: Elpies Event

Post by AntV »

Search the forum.
Try the term "global_tasks", there are many things you can set there.
Attila
Posts: 441
Joined: Mon May 05, 2014 10:15 am

Re: Elpies Event

Post by Attila »

AntV wrote:Search the forum.
Try the term "global_tasks", there are many things you can set there.
yes i try to search
I found only somting for old l2 server.

i need it for
L2J Revision Number:5649
L2JDP Revision Number:10448
Attila
Posts: 441
Joined: Mon May 05, 2014 10:15 am

Re: Elpies Event

Post by Attila »

do only need to put something at global_tasks
or do i need also need a script to run it

help please
User avatar
AntV
Posts: 177
Joined: Mon May 10, 2010 10:46 pm

Re: Elpies Event

Post by AntV »

Both; you need a script which to call from global_tasks.
The idea is to make a script that starts the event and the add a global task to call it whenever you like.
Check this topic:
viewtopic.php?f=46&t=28275&p=168988&hil ... ks#p168988
You can find a script written by pandragon to start the Race event.
Also everything about what to write in global_tasks is in there as well.
Attila
Posts: 441
Joined: Mon May 05, 2014 10:15 am

Re: Elpies Event

Post by Attila »

AntV wrote:Both; you need a script which to call from global_tasks.
The idea is to make a script that starts the event and the add a global task to call it whenever you like.
Check this topic:
viewtopic.php?f=46&t=28275&p=168988&hil ... ks#p168988
You can find a script written by pandragon to start the Race event.
Also everything about what to write in global_tasks is in there as well.
thanks

but how do i make this script to start auto 3 time a day

Code: Select all

    /*     * Copyright (C) 2004-2013 L2J DataPack     *     * This file is part of L2J DataPack.     *     * L2J DataPack is free software: you can redistribute it and/or modify     * it under the terms of the GNU General Public License as published by     * the Free Software Foundation, either version 3 of the License, or     * (at your option) any later version.     *     * L2J DataPack is distributed in the hope that it will be useful,     * but WITHOUT ANY WARRANTY; without even the implied warranty of     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU     * General Public License for more details.     *     * You should have received a copy of the GNU General Public License     * along with this program. If not, see <http://www.gnu.org/licenses/>.     */    package cron;         import java.util.Calendar;         import com.l2jserver.gameserver.instancemanager.QuestManager;    import com.l2jserver.gameserver.model.quest.Event;         /**     * @author Pandragon     */    public class AutoEventModRace    {        public static void main(String[] args)        {            Calendar now = Calendar.getInstance();            if ((now.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY) || (now.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY))            {                Event event = (Event) QuestManager.getInstance().getQuest("eventmodRace");                if (event != null)                {                    event.eventStart();                }            }        }    }
INSERT INTO `global_tasks` (`task`, `type`, `param1`, `param2`, `param3`) VALUES ('script', 'TYPE_GLOBAL_TASK', '1', '10:00:00', 'AutoEventModRace.java');
User avatar
AntV
Posts: 177
Joined: Mon May 10, 2010 10:46 pm

Re: Elpies Event

Post by AntV »

INSERT INTO `global_tasks` (`task`, `type`, `param1`, `param2`, `param3`) VALUES ('script', 'TYPE_GLOBAL_TASK', '1', '10:00:00', 'AutoEventModRace.java');
The 1 you have in param1 represent in how many milliseconds after each run the event shall run again, so, if you want it to run 3 times a day (ie. every 8 hours) param 1 should be:
8*60(minutes)*60(seconds)*1000(milis)= 28800000
then set param2 to when you want it to start the first time.
If you leave it at 10:00:00 then it will run at 10:00, 18:00 and 02:00

Finally the script you copied includes a check about what day it is, here:

Code: Select all

 public static void main(String[] args)        {            Calendar now = Calendar.getInstance();            if ((now.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY) || (now.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY))            {                Event event = (Event) QuestManager.getInstance().getQuest("eventmodRace");                if (event != null)                {                    event.eventStart();                }            }        } 
If you don't want to run only on speciffic days change the above to:

Code: Select all

 public static void main(String[] args){                 Event event = (Event) QuestManager.getInstance().getQuest("eventmodRace");                if (event != null)                {                         event.eventStart();                }}
Also, this will start the Race event. If you still want the elpies change eventmodRace to eventmodElpies
Attila
Posts: 441
Joined: Mon May 05, 2014 10:15 am

Re: Elpies Event

Post by Attila »

i got this at global_tasks:

Image

and this script:

Code: Select all

    /*     * Copyright (C) 2004-2013 L2J DataPack     *     * This file is part of L2J DataPack.     *     * L2J DataPack is free software: you can redistribute it and/or modify     * it under the terms of the GNU General Public License as published by     * the Free Software Foundation, either version 3 of the License, or     * (at your option) any later version.     *     * L2J DataPack is distributed in the hope that it will be useful,     * but WITHOUT ANY WARRANTY; without even the implied warranty of     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU     * General Public License for more details.     *     * You should have received a copy of the GNU General Public License     * along with this program. If not, see <http://www.gnu.org/licenses/>.     */    package cron;         import java.util.Calendar;         import com.l2jserver.gameserver.instancemanager.QuestManager;    import com.l2jserver.gameserver.model.quest.Event;         /**     * @author Pandragon     */    public class AutoEventModRace    {     public static void main(String[] args)    {                    Event event = (Event) QuestManager.getInstance().getQuest("eventmodRace");                    if (event != null)                    {                             event.eventStart();                    }    }
But event dont start it at 13.00.00 hour to day
User avatar
AntV
Posts: 177
Joined: Mon May 10, 2010 10:46 pm

Re: Elpies Event

Post by AntV »

I don't see anything wrong.
I'm going to try and run it to report any issues.
Do you have the AutoEvetRace.java saved in the correct directory (/scripts/cron/)?
Also note that the time is the real time of the server, not in-game time.
Attila
Posts: 441
Joined: Mon May 05, 2014 10:15 am

Re: Elpies Event

Post by Attila »

yes i put AutoEvetRace.java in:
game\data\scripts\cron
Attila
Posts: 441
Joined: Mon May 05, 2014 10:15 am

Re: Elpies Event

Post by Attila »

Attila wrote:i got this at global_tasks:

Image

and this script:

Code: Select all

    /*     * Copyright (C) 2004-2013 L2J DataPack     *     * This file is part of L2J DataPack.     *     * L2J DataPack is free software: you can redistribute it and/or modify     * it under the terms of the GNU General Public License as published by     * the Free Software Foundation, either version 3 of the License, or     * (at your option) any later version.     *     * L2J DataPack is distributed in the hope that it will be useful,     * but WITHOUT ANY WARRANTY; without even the implied warranty of     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU     * General Public License for more details.     *     * You should have received a copy of the GNU General Public License     * along with this program. If not, see <http://www.gnu.org/licenses/>.     */    package cron;         import java.util.Calendar;         import com.l2jserver.gameserver.instancemanager.QuestManager;    import com.l2jserver.gameserver.model.quest.Event;         /**     * @author Pandragon     */    public class AutoEventModRace    {     public static void main(String[] args)    {                    Event event = (Event) QuestManager.getInstance().getQuest("eventmodRace");                    if (event != null)                    {                             event.eventStart();                    }    }
But event dont start it at 13.00.00 hour to day
Can some won tell me why this not work please
Attila
Posts: 441
Joined: Mon May 05, 2014 10:15 am

Re: Elpies Event

Post by Attila »

someone who can help me here please and tell me why he doesn't do work

please
User avatar
AntV
Posts: 177
Joined: Mon May 10, 2010 10:46 pm

Re: Elpies Event

Post by AntV »

It seems the cron job is never called...
I have not found out yet why, maybe someone else can also take a look at it?

EDIT: change param1 to 1, it seems it is the delay after which the script will run, not a repeat timer.
Still though the java files does not work, but at least that way it is getting called.

Edit2: Ok, I found what the problem was:
1) change

Code: Select all

Event event = (Event) QuestManager.getInstance().getQuest("eventmodRace");
to

Code: Select all

Event event = (Event) QuestManager.getInstance().getQuest("Race");
2) change

Code: Select all

event.eventStart();
to

Code: Select all

event.eventStart(null);
Attila
Posts: 441
Joined: Mon May 05, 2014 10:15 am

Re: Elpies Event

Post by Attila »

I get now this error if it try to lode script

1.ERROR in \cron\AutoEventModRace.java <at line 38>

}
^
Syntax error, insert "}" to complete Classbody

Code: Select all

        /*         * Copyright (C) 2004-2013 L2J DataPack         *         * This file is part of L2J DataPack.         *         * L2J DataPack is free software: you can redistribute it and/or modify         * it under the terms of the GNU General Public License as published by         * the Free Software Foundation, either version 3 of the License, or         * (at your option) any later version.         *         * L2J DataPack is distributed in the hope that it will be useful,         * but WITHOUT ANY WARRANTY; without even the implied warranty of         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU         * General Public License for more details.         *         * You should have received a copy of the GNU General Public License         * along with this program. If not, see <http://www.gnu.org/licenses/>.         */        package cron;                 import java.util.Calendar;                 import com.l2jserver.gameserver.instancemanager.QuestManager;        import com.l2jserver.gameserver.model.quest.Event;                 /**         * @author Pandragon         */        public class AutoEventModRace        {         public static void main(String[] args)        {                        Event event = (Event) QuestManager.getInstance().getQuest("Race");                        if (event != null)                        {                                 event.eventStart(null);                        }        } 
Stalitsa
Initiates
Initiates
Posts: 88
Joined: Fri Jul 26, 2013 10:16 am

Re: Elpies Event

Post by Stalitsa »

Attila wrote:I get now this error if it try to lode script

1.ERROR in \cron\AutoEventModRace.java <at line 38>

}
^
Syntax error, insert "}" to complete Classbody

Code: Select all

        /*         * Copyright (C) 2004-2013 L2J DataPack         *         * This file is part of L2J DataPack.         *         * L2J DataPack is free software: you can redistribute it and/or modify         * it under the terms of the GNU General Public License as published by         * the Free Software Foundation, either version 3 of the License, or         * (at your option) any later version.         *         * L2J DataPack is distributed in the hope that it will be useful,         * but WITHOUT ANY WARRANTY; without even the implied warranty of         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU         * General Public License for more details.         *         * You should have received a copy of the GNU General Public License         * along with this program. If not, see <http://www.gnu.org/licenses/>.         */        package cron;                 import java.util.Calendar;                 import com.l2jserver.gameserver.instancemanager.QuestManager;        import com.l2jserver.gameserver.model.quest.Event;                 /**         * @author Pandragon         */        public class AutoEventModRace        {         public static void main(String[] args)        {                        Event event = (Event) QuestManager.getInstance().getQuest("Race");                        if (event != null)                        {                                 event.eventStart(null);                        }        } 
your code needs "}" on the end!
Image
Post Reply