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?
November 22, 2008, 12:54:32 PM

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 300 times)
0 Members and 1 Guest are viewing this topic.
Parfet
Rookie
**
Offline Offline

Posts: 33


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
Change text in remember "...
by gerborg
[November 21, 2008, 05:14:57 PM]

Log playtime from buddys ...
by Temar
[November 20, 2008, 10:33:57 AM]

Vote Core module and Simp...
by Temar
[November 19, 2008, 09:26:52 AM]

Restrict access for one m...
by Organizer
[November 19, 2008, 03:21:19 AM]

Custom / Revised Modules ...
by Elesar1
[November 17, 2008, 03:51:46 PM]

TWC
by Temar
[November 16, 2008, 11:39:12 AM]

Are there any FUN modules...
by Elesar1
[November 15, 2008, 07:39:15 PM]

Call to a member function...
by exxie
[November 15, 2008, 09:29:31 AM]

Ported Modules
by Alreadythere
[November 14, 2008, 06:10:07 PM]

cURL and other non-defaul...
by Temar
[November 14, 2008, 04:11:44 PM]
Stats
Members
Total Members: 1235
Latest: DDDepressionnn
Stats
Total Posts: 11037
Total Topics: 1496
Online Today: 18
Online Ever: 168
(July 01, 2007, 09:30:02 PM)
Users Online
Users: 1
Guests: 15
Total: 16
xlDanek

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