AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   Task Scheduler - by JustinHoMi (https://forums.alliedmods.net/showthread.php?t=1263)

pendragon 04-20-2004 22:40

Task Scheduler - by JustinHoMi
 
1 Attachment(s)
A task scheduler to perform server commands at a specified interval or a specific time. Based on Clanmod's "cm_task".

Usage:
Put tasks in your amx.cfg (or could possibly work in server.cfg) in the format:
amx_task time "command" flags

Flags:
m - time is in minutes
s - time is in seconds
r - repeat task
t - specific time (0:00-23:59, assumes "r" flag)

For example to restart the round every 5 minutes use:
amx_task 5 "sv_restart 1" mr

-------------------------------------------------------------
originally by JustinHoMi
original amx thread: http://djeyl.net/forum/index.php?showtopic=4130&st=0

NOTE: chagned all the "time" variables to "clock"
added: #include <amxmodx>

thanks to Bailopan and Gizzard for their help.

BigBaller 04-21-2004 00:05

Is it just me or do some of JustinHoMi plugins should be incorpated into the AMXX project?

Good plugin, thanks for the port.

azure 04-21-2004 02:17

hrrmm this is very interesting. Could I set this up to change the mapcycle possibly?

like have mapcycle 1 from 9 till 23 and then mapcycle2 from 23 til 9?

I am gonna have to look into this. But, if anyone already knows the answer, please let me know :wink:

btw.. I noticed you left #include <amxmod>
the amxmodx team will want you to use #include <amxmodx> before the plugin can be approved.

Man I hope there is a way to get this mapcycle thing hooked up. I have been trying to find a way to do this for a while now.

[BioMaN]**neogun** 04-21-2004 06:15

very interesting :wink:

PM 04-21-2004 11:40

#include <amxmodx> please

pendragon 04-21-2004 14:10

Quote:

Originally Posted by PM
#include <amxmodx> please

done.. sorry bout that guys ... Still learning.

Stardust 04-24-2004 10:25

Quote:

Originally Posted by azure
hrrmm this is very interesting. Could I set this up to change the mapcycle possibly?

like have mapcycle 1 from 9 till 23 and then mapcycle2 from 23 til 9?

I did this with the amx mod an this plugin, worked fine.
Only problem was that I wanted to specify this once, but the amx config file was run every mapload.

hmm how did I do this ...
I did something like
amx_task 18:00 "amx_tsay blue Evening mapcycle loaded" t
amx_task 18:01 "mp_timelimit 20" t
amx_task 18:02 "mapcyclefile evening.txt" t

then around 0100 I switched back
amx_task 01:00 "amx_tsay blue Standard mapcycle loaded" t
amx_task 01:01 "mp_timelimit 25" t
amx_task 01:02 "mapcyclefile mapcyclefile.txt" t


hmm how did I do this ...
I did something like
amx_task 18:00 "amx_tsay blue Evening mapcycle loaded" t
amx_task 18:01 "mp_timelimit 20" t
amx_task 18:02 "mapcyclefile evening.txt" t

then around 0100 I switched back
amx_task 01:00 "amx_tsay blue Standard mapcycle loaded" t
amx_task 01:01 "mp_timelimit 25" t
amx_task 01:02 "mapcyclefile mapcyclefile.txt" t


one nice thing about this plugin is delayed action, like shutdown

alias shutdown "exec shutdown.cfg"
---
file shutdown.cfg
--
amx_tsay red Shutting down server in 10 seconds
amx_task 10 "quit" s
amx_task 7 "amx_tsay red Server shutting down, come back later." s
--

then you just send "shutdown" to hlds via your favorite admin tool.

This plugin has endless possibilities, thx for the port!

azure 04-26-2004 03:01

Yea I have tried that. And the server just gets stuck in a loop on the first map in the new cycle. If you do a listmaps in the console, it shows the new mapcycle so I know it changed. But like I said, it just keeps running the first map over and over.
In fact, just typing in "mapcyclefile newcycle.txt" causes the same issue.

Any idea why?

azure 04-26-2004 04:41

hrmm... update.
It turns out that the server only gets stuck on the first map for about 3 mapcycles. Then after that it finally starts to go through the other maps. I need to test some other stuff I guess.
I am going to get rid of the nextmap plugin. Maybe that had something to do with it?
nothing is ever easy....

pendragon 04-26-2004 13:52

Quote:

Originally Posted by azure
nothing is ever easy....

you got that right - good luck in your testing.

azure 04-27-2004 05:20

hehe thanks pendragon. Either way, this is a good port. Thanks for converting it.
As stardust said, this plugin has endless possiblilities. I am pretty sure i will find a lot of good uses for it. 8)

Kamikatze 05-01-2004 09:10

It would be nice to enhanced this plugin with cron (linux task scheduler) syntax, so it would be possible to run tasks only on specific days of the week or on specific dates (a christmas greeting maybe on 24 Dec. :)

There was an plugin bk_cron in adminmod, maybe you can look into the source.

http://www.wing-clan.de/plugins/bk_c...bk_cron1.1.zip

pendragon 05-01-2004 16:25

well maybe someone will be up to the task cause I am no coder... let alone a (X)nix wiz. So I leave that wonderfull suggestion and new update task for an actual plugin coder...
I contacted the plugin author about me porting it and he never responded so I am assuming that he's dropped off the face of this planet.... so if anyone else is up for the challenge - by all means go for it.

lobstah 05-02-2004 05:17

azure wrote:
Quote:

Yea I have tried that. And the server just gets stuck in a loop on the first map in the new cycle.
I have a similar problem where it will work for a few hours and start to loop. Except I used Days of the Week w/amx9.7

If you have resolved this please post up how you did it. I was thinking it was the cycle. Some combination of custom maps. Or maybe when a new map was voted in it messed up the plug in. This has really has been a problem in my server for quite sometime. Im very tired of changing the cycles and server/amx.cfg myself.

We have ppl who donate to the server for events such as "Suck Me Sideways Sudays" with no walking and some other silly rules. Rabid Monkey Mondays all custom maps. Im always forgetting to adjust and when Im away its just impossible. If there were a way to automate a weeks worth of these things it would be invalueble to our community.

Kamikatze 05-12-2004 20:36

How many scheduled tasks can i setup with this plugin?

pendragon 05-12-2004 21:34

you are limited by your imagination

azure 05-16-2004 05:47

lobstah, I can't guarantee it but, after I disabled the nextmap plugin everything started working. Give it a try.

This task scheduler plugin is awesome. Besides getting my time specific mapcycles to work, I have set up the mapspecific configs plugin to show custom messages for certain maps. For example, I set up fy_snow to show a tsay message every 3 minutes stating that FF is turned off in that map (we are a friendly fire server). When it comes to messages, the possiblilities are endless.

There are many other ways this plugin can be used, just takes imagination.

GiLaN 06-05-2004 05:32

Hello, i would like to get some help with this plugin :d

in fact, i want Warcraft3 to be run every evening, between 20.00 and 23.59

so, in amxx.cfg i placed

Code:

//Task Scheduler
amx_task 20:00-23:59 "sv_warcraft3 1" tr
amx_task 0:00-19:59 "sv_warcraft3 0" tr

and the same thing in server.cfg

but it's not working :'(

somebody could help me please?

Thanks ! and nice job to amx mod x devs ;)

sanaell 06-05-2004 05:44

Quote:

Originally Posted by GiLaN
Hello, i would like to get some help with this plugin :d

in fact, i want Warcraft3 to be run every evening, between 20.00 and 23.59

so, in amxx.cfg i placed



and the same thing in server.cfg

but it's not working :'(

somebody could help me please?

Thanks ! and nice job to amx mod x devs ;)

may i answer you ?.....
dunno maybe if i put
Try this
Code:

//Task Scheduler
amx_task 20:00 "sv_warcraft3 1" tr
amx_task 00:00 "sv_warcraft3 0" tr


GiLaN 06-05-2004 06:46

Thx sana, it works ;)

lobstah 06-06-2004 10:50

could this be made into days of the week?

taskmonday.cfg-tasksunday.cfg?

GiLaN 06-06-2004 14:35

Quote:

Originally Posted by lobstah
could this be made into days of the week?

taskmonday.cfg-tasksunday.cfg?

I was jsut wondering, it could be so great

|2ob 06-06-2004 15:09

what about a certain date in the year? like... July 5th i want my csstats module to reset.

GiLaN 06-08-2004 12:23

up !

lobstah 06-11-2004 08:29

Quote:

Originally Posted by azure
lobstah, I can't guarantee it but, after I disabled the nextmap plugin everything started working. Give it a try.

azure,
So how did the regs like not knowing whats coming next? Do you have a nextmap work around? If not, I think its ironic that to keep regs and new players happy and better informed you have to disable the most basic informative feature there is. What's more gratifying than being able to look at HLSW or type a word in game and know what the next hour or so may hold. This is so embedded in pubbing many players have forgotten or never learned to type 'listmaps in console.

GiLaN, how about
http://forums.alliedmods.net/showthr...?p=24848#26563

marc 06-12-2004 16:09

task scheduler
 
Nice, I was looking for the amxx version, only where is my b (time before end of round :cry: )

noob 06-16-2004 05:05

can the time be * ? so it executes the command at random time
amx_task * "command" m

azure 06-17-2004 15:35

Quote:

Originally Posted by lobstah
Quote:

Originally Posted by azure
lobstah, I can't guarantee it but, after I disabled the nextmap plugin everything started working. Give it a try.

azure,
So how did the regs like not knowing whats coming next? Do you have a nextmap work around?

I use the nextmap cfg in statsme. That and end of round damage are the only parts of statsme I use. Oh, and I also use it just for the log information since amxx stats logging doesn't work. I need it for the psychostats accuracy etc.

although.. I don't think anyone would care if they did not know what the next map is.

azure 08-13-2004 17:11

wanted to mention that our stats logging miraculously started working. Now, if we could just have a simple nextmap plugin. Only feature we need is a public say nextmap and it shows the players what the nextmap is. We don't need any of the other features. Then maybe it would't conflict with multiple mapcycles.

I am currently running without the plugin so we have no conflicts. However, I must admit that our players miss the nextmap command quite a bit.

Morpheus 08-13-2004 20:22

Hi there!

I want a this to work so the plugin announce something like this:

"Server is restarting ..bla bla bla"

Then it should kill the server, so ex. Linux server is restarting whole server to prevent memory leak !

What should I do?

Cheers

Morpheus

tammar 08-14-2004 06:55

Quote:

Originally Posted by Morpheus
Hi there!

I want a this to work so the plugin announce something like this:

"Server is restarting ..bla bla bla"

Then it should kill the server, so ex. Linux server is restarting whole server to prevent memory leak !

What should I do?

Cheers

Morpheus

Example: I want to restart the server every day at 03:00 am.

I placed to amxx.cfg following to shutdown the server:

Code:

amx_task 2:55 "amx_csay yellow Server is going down in 5 minutes" tr
amx_task 2:59 "amx_csay yellow Server is going down in 1 minute" tr
amx_task 3:00 "amx_rcon quit" tr

To start it again, there is no other way (I guess) than setting up a cron job. The crontab line to start the server at 3:01 would look like this:

Code:

1 3 * * * <commandline used to start the server>
If server shutdown fails and cron tries to start another server, the new server won't start because it's port will be still in use. So there is no risk of having too many DS only because server shutdown failed.

Hope it helps,

T.

Morpheus 08-16-2004 07:45

Thx i will go try that out now :-)

Cheers

Morpheus

Morpheus 08-16-2004 08:15

Quote:

Originally Posted by tammar
Quote:

Originally Posted by Morpheus
Hi there!

I want a this to work so the plugin announce something like this:

"Server is restarting ..bla bla bla"

Then it should kill the server, so ex. Linux server is restarting whole server to prevent memory leak !

What should I do?

Cheers

Morpheus

Example: I want to restart the server every day at 03:00 am.

I placed to amxx.cfg following to shutdown the server:

Code:

amx_task 2:55 "amx_csay yellow Server is going down in 5 minutes" tr
amx_task 2:59 "amx_csay yellow Server is going down in 1 minute" tr
amx_task 3:00 "amx_rcon quit" tr

To start it again, there is no other way (I guess) than setting up a cron job. The crontab line to start the server at 3:01 would look like this:

Code:

1 3 * * * <commandline used to start the server>
If server shutdown fails and cron tries to start another server, the new server won't start because it's port will be still in use. So there is no risk of having too many DS only because server shutdown failed.

Hope it helps,

T.

Hi again T!

Everything is working perfectly untill server task is amx_rcon quit ! Server is not shutting down, but when I use amx_rcon quit manually via console server is shutting down!?

How come?

Cheers

Morpheus

FeuerSturm 08-16-2004 13:20

you can use the shutdown command directly without using
"amx_rcon" infront of it. :wink:

Morpheus 08-17-2004 06:30

Oh nice...

I will try that out....

Thx

Morpheus

Freaky frank 02-04-2005 19:18

How to reset the cvars :?:

Any help plz , or must i restart the server then :?:

THX

tammar 02-04-2005 20:50

Quote:

Originally Posted by Freaky frank
How to reset the cvars :?:

Any help plz , or must i restart the server then :?:

THX

Which cvars? Be more specific please.

T.

Freaky frank 02-05-2005 15:53

I did this

amx_task 20 "fireworks 10" mr
amx_task 3 "amx_csay red [CSL] *This server is using Client Screenshot Logfile*" mr
amx_task 5 "amx_tsay green [CSL] *Checking Screen*" mr

Now if i want the fireworks to stop or change the time , then what ?
Because its stay in the memory

if i do

amx_task 60 "fireworks 5" mr

then the server shoots fireworks every 60 min and every 20 min because i cant deleted the first task only if i restart the server then its ok

But is there no other way ?

Cvar amx_task_delete or something like that

Dr_Knuckles 03-03-2005 22:45

Hey I am trying to get this scheduler to do different mapcycles at different times of day. Can anyone please tell me:

where do I put these different mapcycles?
do i need to specify where they are and how?
what is the actual command I need to put in amxx.cfg to do this?

If anyone can help I would totally appreciate it. I have been messing with it all day with and without nextmap.amxx on and it keeps freezing atmapchange and not going anywhere. If anyone can help I would totally appreciate it.

I got it to do other tasks fine, so I know it works I just can't seem to come up with the correct commands to do these mapcycles.

Dr_Knuckles 03-04-2005 12:25

Anyone, this is driving me insane?


All times are GMT -4. The time now is 10:03.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.