collapse collapse
* User Info
 
 
Welcome, Guest. Please login or register.
* Search

* Board Stats
  • stats Total Members: 989
  • stats Total Posts: 18363
  • stats Total Topics: 2500
  • stats Total Categories: 7
  • stats Total Boards: 35
  • stats Most Online: 1144

Author Topic: Spam Announcement/script  (Read 3492 times)

0 Members and 1 Guest are viewing this topic.

Offline Sinaii

  • BeBot Rookie
  • *
  • Posts: 3
  • Karma: +0/-0
Spam Announcement/script
« on: September 02, 2009, 02:15:48 am »
Hello.

Any body know how it would be possible to spam in guildchat some annoucement every 1hours ?


and how can i use the .html script used in aoc script folder to be called like !kos or !guide but from the bot directly ?

I tryed the !guide modeul but it don't work like i would, i just want the html script to be called or the .txt file


Offline Jiheld

  • BeBot User
  • **
  • Posts: 53
  • Karma: +0/-0
Re: Spam Announcement/script
« Reply #1 on: September 02, 2009, 11:02:37 am »
hi, i use the cron script for that.

Code: [Select]
<?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(&$botget_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_gcpost what ever you want here to get in the GC.##end##");
}



}
?>


Offline Sinaii

  • BeBot Rookie
  • *
  • Posts: 3
  • Karma: +0/-0
Re: Spam Announcement/script
« Reply #2 on: September 02, 2009, 12:51:08 pm »
Thx i will try the script

line 102 $this -> bot -> send_gc( post what ever you want here to get in the GC.##end##");

should be

$this -> bot -> send_gc("post what ever you want here to get in the GC.##end##");
« Last Edit: September 07, 2009, 06:06:02 am by Sinaii »

 

* Recent Posts
[AoC] special char for items module by bitnykk
[February 09, 2024, 09:41:18 pm]


0.8.x updates for AoC by bitnykk
[January 30, 2024, 11:16:08 pm]


0.8.x updates for AO by bitnykk
[January 30, 2024, 11:15:37 pm]


BeBot still alive & kicking ! by bitnykk
[December 17, 2023, 12:58:44 am]


Bebot and Rasberry by bitnykk
[November 29, 2023, 11:04:14 pm]

* Who's Online
  • Dot Guests: 688
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.
* Forum Staff
bitnykk admin bitnykk
Administrator
Khalem admin Khalem
Administrator
WeZoN gmod WeZoN
Global Moderator
SimplePortal 2.3.7 © 2008-2024, SimplePortal