Raised This Month: $51 Target: $400
 12% 

Hobo Crontab ( Scheduler )


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Server Management        Approver:   Emp` (115)
hoboman
Senior Member
Join Date: Jul 2007
Old 03-27-2008 , 20:27   Hobo Crontab ( Scheduler )
Reply With Quote #1

Hobo Crontab

Description:
This plugin will schedule to run a list of commands or comment/uncomment a plugin from your plugins.ini file which it will read from hobo_crontab.ini file in your addons\amxmodx\configs folder ( auto created if you don't create it ) on a given day of month, day of week, hour and minute.
Cron Entry Format:
Code:
day_of_month day_of_week hour minute | cmd..., $plugin_to_comment..., @plugin_to_uncomment...

- day of month has to be a number 1-32 or a * which means that for every day of month
- day of week has to be a number 0-6 where 0 is Sunday and 6 is Saturday or a * which means that for every day of week
- hour has to be a number 0-24 or a * which means that for every hour of the day
- minute has to be a number 0-60 or a * which means that for every minute of the hour

- can uncomment any plugin from the plugins.ini file by putting a @ before of its name
- can comment any plugin from the plugins.ini file by putting a $ before of its name

Examples
:
Code:
03 01 02 59 | say mp_roundtime 5, say NOW
- on the third day of the month, Monday, the second hour on the fifty ninth minute change the round time to 5 minutes then the server will say "NOW"

Code:
* 2 * 2 | say hello, $repay.amxx, @ptb.amxx, changelevel cs_assault
- on every day of month, Tuesday, every hour and on the second minute make the server say "hello", comment the repay.amxx plugin and uncomment the ptb.amxx plugin then set the map to cs_assault.
Commands:
hobo_crontab_reload - reloads all the entries from the hobo_crontab.ini file. This is useful because otherwise the entries only get updated on map change.
hobo_show_time - shows the current time on the game server. This is useful for planning what time to put each command for if your server is in a different timezone.
Plugin Notes:
- the maximum length of a single command in an entry is 31 characters
- the maximum number of commands per entry is 8 ( #define MAX_CMDS_PER_ENTRY )
- the maximum number of entries is 32 ( #define MAX_CRON_ENTRIES )
Attached Files
File Type: sma Get Plugin or Get Source (hobo_crontab.sma - 3178 views - 8.5 KB)
__________________

Last edited by Emp`; 08-18-2011 at 03:06. Reason: Fixed Typos
hoboman is offline
hazard1337
Senior Member
Join Date: Sep 2006
Old 03-27-2008 , 21:40   Re: Hobo Crontab
Reply With Quote #2

this looks really in depth and developed. O.o

Edit: Code looks solid, testing.
__________________
[IMG]http://img139.**************/img139/1530/2sejaewg1.gif[/IMG]
If you +/- my K, leave your name.
I do not take requests VIA PM
Click on this before requesting/suggesting
This is your best friend
hazard1337 is offline
Send a message via Skype™ to hazard1337
Lord_Destros
Veteran Member
Join Date: Jul 2004
Location: With stupid.
Old 03-28-2008 , 03:18   Re: Hobo Crontab
Reply With Quote #3

What makes this CS specific?
__________________
Quote:
Originally Posted by Twilight Suzuka
Don't worry m'lord. The turtles day will come.
Lord_Destros is offline
Send a message via AIM to Lord_Destros
hoboman
Senior Member
Join Date: Jul 2007
Old 03-28-2008 , 13:04   Re: Hobo Crontab
Reply With Quote #4

Quote:
Originally Posted by Lord_Destros View Post
What makes this CS specific?
nothing...lol

should probably edit the category
__________________
hoboman is offline
hoboman
Senior Member
Join Date: Jul 2007
Old 03-29-2008 , 19:57   Re: Hobo Crontab ( Scheduler )
Reply With Quote #5

Updated:
- changed maximum number of entries from 64 to 32 to save some memory
- fixed a bug where if a map got changed on the same minute that the cmds were scheduled to be run then there was a chance that those cmds would be ignored...

btw, can anyone verify that this plugin works?
__________________
hoboman is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 03-31-2008 , 23:04   Re: Hobo Crontab ( Scheduler )
Reply With Quote #6

Quote:
Originally Posted by hoboman View Post
- changed maximum number of entries from 64 to 32 to save some memory
Why not use the CellArray that came available in 1.8?
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
hoboman
Senior Member
Join Date: Jul 2007
Old 04-01-2008 , 16:40   Re: Hobo Crontab ( Scheduler )
Reply With Quote #7

I am looking at these CellArrays now and apparently they are slower than using just regular arrays:
Quote:
* These are not designed to be used as a replacement for normal arrays, as
* normal arrays are faster and should be used whenever possible.
Also memory is cheap, so I don't know if it is even worth it to convert this to CellArrays...
__________________
hoboman is offline
spiderbites
Senior Member
Join Date: Nov 2007
Old 04-17-2008 , 04:35   Re: Hobo Crontab ( Scheduler )
Reply With Quote #8

Quote:
Originally Posted by hoboman View Post
Hobo Crontab
the maximum length of a single command in an entry is 31 characters
can you increase that length? cause i want to schedule my server to say something like announcement etc.
spiderbites is offline
hoboman
Senior Member
Join Date: Jul 2007
Old 04-17-2008 , 13:27   Re: Hobo Crontab ( Scheduler )
Reply With Quote #9

why not just use imessage.amxx for that? it already comes with amxx.
if you wanna increase that length then change: #define MAX_CRON_ENTRIES 32 at the beginning of file to whatever you want it to be and recompile
__________________
hoboman is offline
WiLDRAGoN
Junior Member
Join Date: Aug 2007
Old 05-17-2008 , 11:21   Re: Hobo Crontab ( Scheduler )
Reply With Quote #10

hoboman, would you tell me how I can get this plugin to do this please?
http://forums.alliedmods.net/showthread.php?t=71207
WiLDRAGoN is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:15.


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