Page 1 of 2
Elpies Event
Posted: Tue Oct 07, 2014 7:03 pm
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
Re: Elpies Event
Posted: Thu Oct 09, 2014 12:40 pm
by AntV
Search the forum.
Try the term "global_tasks", there are many things you can set there.
Re: Elpies Event
Posted: Thu Oct 09, 2014 3:38 pm
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
Re: Elpies Event
Posted: Fri Oct 10, 2014 10:42 am
by Attila
do only need to put something at global_tasks
or do i need also need a script to run it
help please
Re: Elpies Event
Posted: Fri Oct 10, 2014 3:02 pm
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.
Re: Elpies Event
Posted: Sat Oct 11, 2014 3:10 pm
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');
Re: Elpies Event
Posted: Sat Oct 11, 2014 8:26 pm
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
Re: Elpies Event
Posted: Sun Oct 12, 2014 1:34 pm
by Attila
i got this at global_tasks:
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
Re: Elpies Event
Posted: Mon Oct 13, 2014 1:36 am
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.
Re: Elpies Event
Posted: Mon Oct 13, 2014 2:58 pm
by Attila
yes i put AutoEvetRace.java in:
game\data\scripts\cron
Re: Elpies Event
Posted: Tue Oct 14, 2014 6:41 pm
by Attila
Attila wrote:i got this at global_tasks:
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
Re: Elpies Event
Posted: Sun Oct 19, 2014 11:14 am
by Attila
someone who can help me here please and tell me why he doesn't do work
please
Re: Elpies Event
Posted: Mon Oct 20, 2014 4:13 pm
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
to
Re: Elpies Event
Posted: Mon Oct 20, 2014 9:02 pm
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); } }
Re: Elpies Event
Posted: Mon Oct 20, 2014 9:10 pm
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!