L* R*
HOME FORUM DOWNLOADS
Content
  Links
     Browse SVN
     SVN Commit log
     Documentation (Wiki)
  Developers
     Taskmanager
User
Welcome, Guest. Please login or register.
Did you miss your activation email?
September 08, 2008, 01:15:19 AM

Login with username, password and session length
Search



Advanced search
Support GoPHP5.org
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Modules > Modules for older versions > 0.3.x Custom/Unofficial Modules > Topic: assist macro generator for 0.3.5+
Pages: [1]   Go Down
« previous next »
Print
Author Topic: assist macro generator for 0.3.5+  (Read 252 times)
0 Members and 1 Guest are viewing this topic.
Parfet
Rookie
**
Offline Offline

Posts: 31


assist macro generator for 0.3.5+
« on: July 10, 2007, 09:36:44 PM »

Assist plugin for BeBot 0.3.5+

returns a generic assist macro if you don't give it a name

Assist.php:
Code:
<?php
/*
* Assist module for Bebot 0.3.5+ created by Parfet of Rimor
*
* BeBot - An Anarchy Online Chat Automaton
* Copyright (C) 2004 Jonas Jax
* Copyright (C) 2005 Thomas J. Stens� and ShadowRealm Creations
*
* Developed by:
* - Blondengy (RK1)
* - Khalem (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; either version 2 of the License, or
*  (at your option) any later version.
*
*  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
*
* File last changed at $LastChangedDate: 2007-06-12 15:09:11 +0200 (Tue, 12 Jun 2007) $
* Revision: $Id: _ExampleModule.php 619 2007-06-12 13:09:11Z alreadythere $
*/

/*
Add a "_" at the beginning of the file (_Assist.php) if you do not want it to be loaded.
*/

$assist = new assist($bot);

$commands["tell"]["assist"] = &$assist;
$commands["pgmsg"]["assist"] = &$assist;
$commands["gc"]["assist"] = &$assist;

/*
The Class itself...
*/
class Assist
{
var $bot;
var $help;


/*
Constructor:
Hands over a referance to the "Bot" class.
Defines access control for the commands
Creates settings for the module
Defines help for the commands
*/
function Assist (&$bot)
{
$this -> bot = &$bot;

$this -> bot -> accesscontrol -> create ('tell', 'assist', 'ANONYMOUS');
$this -> bot -> accesscontrol -> create ('gc', 'assist', 'ANONYMOUS');
$this -> bot -> accesscontrol -> create ('pgmsg', 'assist', 'ANONYMOUS');

$this -> help['description'] = 'Assist module for BeBot 0.3.5+';
$this -> help['command']['assist']="Provides a generic '/assist' macro.";
$this -> help['command']['assist name'] = "Provides an '/assist name' macro.";
}

/*
This gets called on a tell with the command
*/
function tell($name, $msg)
{
$this -> bot -> send_tell($name, $this -> assist_blob($msg));
}

/*
This gets called on a msg in the privgroup with the command
*/
function pgmsg($name, $msg)
{
$this -> bot -> send_pgroup($this -> assist_blob($msg));
}

/*
This gets called on a msg in the guildchat with the command
*/
function gc($name, $msg)
{
$this -> bot -> send_gc($this -> assist_blob($msg));
}

/*
This creates the /assist blob
*/
function assist_blob($msg)
{
$msg = rtrim($msg);
if (preg_match("/^" . $this -> bot -> commpre . "assist ([a-zA-Z0-9]{4,25})$/i", $msg, $info)) {
$name = ucfirst(strtolower($info[1]));
$inside = "<center>##White##:##Red##:##White##:";
$inside .= " <a href='chatcmd:///macro $name /assist $name'>Assisting $name</a>.";
$inside .= " :##Red##:##White##:##End##</center>";
return $this -> bot -> make_blob("Click", $inside) . " to assist ##Highlight##$name##End##.";
} else {
$inside = "<center>##White##:##Red##:##White##:";
$inside .= " <a href='chatcmd:///macro Assist /assist'>Assist Macro</a>.";
$inside .= " :##Red##:##White##:##End##</center>";
return $this -> bot -> make_blob("Click", $inside) . " to make a generic assist macro.";
}
}
}
?>


suggestions welcome
Logged
Pages: [1]   Go Up
Print
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Modules > Modules for older versions > 0.3.x Custom/Unofficial Modules > Topic: assist macro generator for 0.3.5+
« previous next »
 
Jump to:  

Recent
BeBot v0.5.3 released (de...
by Temar
[Today at 12:32:25 AM]

Help with online info in ...
by Barlyman
[September 07, 2008, 07:56:24 PM]

Security
by Alreadythere
[September 06, 2008, 10:02:42 AM]

Probs with relay from gue...
by Temar
[September 06, 2008, 09:03:06 AM]

Raid spam in guild chat
by Temar
[September 06, 2008, 09:01:18 AM]

Org Relaying
by Nytridr
[September 06, 2008, 01:34:35 AM]

Link 2 Guilds via 2 Bots?
by Temar
[September 05, 2008, 04:22:40 PM]

SVN download
by clashbot
[September 05, 2008, 05:12:59 AM]

TWC
by Temar
[September 05, 2008, 12:27:23 AM]

How to find the guild ID?...
by Irinir
[September 03, 2008, 02:58:54 PM]
Stats
Members
Total Members: 965
Latest: morisey
Stats
Total Posts: 10416
Total Topics: 1413
Online Today: 10
Online Ever: 168
(July 01, 2007, 09:30:02 PM)
Users Online
Users: 3
Guests: 28
Total: 31
Wolfbiter
Temar
kaagee

Powered by SMF 1.1.5 | SMF © 2006-2008, Simple Machines LLC
TinyPortal v0.9.8 © Bloc | NewDef design by Bloc
Page created in 0.174 seconds with 29 queries. (Pretty URLs adds 0.023s, 4q)
Loading...