hi, i use the cron script for that.
<?php
/*
* cron.php - Spam guildchat by Jiheld.
* Cron module - <module description>
* <Copyright notice for your module>
*
* BeBot - An Anarchy Online & Age of Conan Chat Automaton
* Copyright (C) 2004 Jonas Jax
* Copyright (C) 2005-2007 Thomas Juberg Stensås, ShadowRealm Creations and the BeBot development team.
*
* Developed by:
* - Alreadythere (RK2)
* - Blondengy (RK1)
* - Blueeagl3 (RK1)
* - Glarawyn (RK1)
* - Khalem (RK1)
* - Naturalistic (RK1)
* - Temar (RK1)
*
* See Credits file for all aknowledgements.
*
* This program 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; version 2 of the License only.
*
* This program 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, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
*
*/
/*
Add a "_" at the beginning of the file (_ClassName.php) if you do not want it to be loaded.
*/
$thisClass = new cron($bot);
/*
The Class itself...
*/
class cron extends BaseActiveModule
{
function __construct (&$bot)
{
//Initialize the base module
parent::__construct(&$bot, get_class($this));
$this->register_event('cron', '20min'); // time when the script needs to spam the GC.
}
/*
Unified message handler
$source: The originating player
$msg: The actual message, including command prefix and all
$type: The channel the message arrived from. This can be either "tell", "pgmsg" or "gc"
*/
function command_handler($source, $msg, $origin)
{
//ALWAYS reset the error handler before parsing the commands to prevent stale errors from giving false reports
$this->error->reset();
//The default is to split the command to com, sub and args. If you want to split it some other way change the pattern for it
//parse_com() returns an array where the pattern is the keys and the values are split out from $msg
$com = $this->parse_com($msg, array('com', 'sub', 'args'));
$command = $vars[0];
switch($com['com'])
{
case 'command1':
return($this -> somefunction($name, $com));
break;
case 'command2':
return($this -> someotherfunction($name, $com));
default:
// Just a safety net to allow you to catch errors where a module has registered a command, but fails to actually do anything about it
$this -> error -> set("Broken plugin, recieved unhandled command: $command");
return($this->error->message());
}
}
/*
This gets called on cron if you previously registered the event 'cron, interval'
$interval is the string name for the time delay between two cron jobs.
*/
function cron($interval)
{
$this -> bot -> send_gc( post what ever you want here to get in the GC.##end##");
}
}
?>