Elpies Event
Forum rules
READ NOW: L2j Forums Rules of Conduct
READ NOW: L2j Forums Rules of Conduct
-
- Posts: 441
- Joined: Mon May 05, 2014 10:15 am
Elpies Event
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
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
- AntV
- Posts: 177
- Joined: Mon May 10, 2010 10:46 pm
Re: Elpies Event
Search the forum.
Try the term "global_tasks", there are many things you can set there.
Try the term "global_tasks", there are many things you can set there.
-
- Posts: 441
- Joined: Mon May 05, 2014 10:15 am
Re: Elpies Event
yes i try to searchAntV wrote:Search the forum.
Try the term "global_tasks", there are many things you can set there.
I found only somting for old l2 server.
i need it for
L2J Revision Number:5649
L2JDP Revision Number:10448
-
- Posts: 441
- Joined: Mon May 05, 2014 10:15 am
Re: Elpies Event
do only need to put something at global_tasks
or do i need also need a script to run it
help please
or do i need also need a script to run it
help please
- AntV
- Posts: 177
- Joined: Mon May 10, 2010 10:46 pm
Re: Elpies Event
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.
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.
-
- Posts: 441
- Joined: Mon May 05, 2014 10:15 am
Re: Elpies Event
thanksAntV 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.
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');
- AntV
- Posts: 177
- Joined: Mon May 10, 2010 10:46 pm
Re: Elpies Event
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:INSERT INTO `global_tasks` (`task`, `type`, `param1`, `param2`, `param3`) VALUES ('script', 'TYPE_GLOBAL_TASK', '1', '10:00:00', 'AutoEventModRace.java');
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(); } } }
Code: Select all
public static void main(String[] args){ Event event = (Event) QuestManager.getInstance().getQuest("eventmodRace"); if (event != null) { event.eventStart(); }}
-
- Posts: 441
- Joined: Mon May 05, 2014 10:15 am
Re: Elpies Event
i got this at global_tasks:

and this script:
But event dont start it at 13.00.00 hour to day

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(); } }
- AntV
- Posts: 177
- Joined: Mon May 10, 2010 10:46 pm
Re: Elpies Event
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.
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.
-
- Posts: 441
- Joined: Mon May 05, 2014 10:15 am
Re: Elpies Event
yes i put AutoEvetRace.java in:
game\data\scripts\cron
game\data\scripts\cron
-
- Posts: 441
- Joined: Mon May 05, 2014 10:15 am
Re: Elpies Event
Can some won tell me why this not work pleaseAttila wrote:i got this at global_tasks:
and this script:But event dont start it at 13.00.00 hour to dayCode: 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(); } }
-
- Posts: 441
- Joined: Mon May 05, 2014 10:15 am
Re: Elpies Event
someone who can help me here please and tell me why he doesn't do work
please
please
- AntV
- Posts: 177
- Joined: Mon May 10, 2010 10:46 pm
Re: Elpies Event
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 to
2) change to
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");
Code: Select all
Event event = (Event) QuestManager.getInstance().getQuest("Race");
Code: Select all
event.eventStart();
Code: Select all
event.eventStart(null);
-
- Posts: 441
- Joined: Mon May 05, 2014 10:15 am
Re: Elpies Event
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
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); } }
-
- Initiates
- Posts: 88
- Joined: Fri Jul 26, 2013 10:16 am
Re: Elpies Event
your code needs "}" on the end!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); } }
