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: Simple Guild Alliance Chat  (Read 3910 times)

0 Members and 1 Guest are viewing this topic.

Offline -Fionn-

  • BeBot Rookie
  • *
  • Posts: 9
  • Karma: +0/-0
Simple Guild Alliance Chat
« on: February 10, 2009, 01:24:21 pm »
Thanks to Temar and Alreadythere for helping me get this module to work. This is a simple module that makes use of the Say module that comes with the bebot. You must make both bots members of their target bot for this to work. Change TARGET_BOTNAME in the code below to the bot of your alliance guild and then save the file as alliance.php in your modules folder and restart your bot. Get your alliance guild to do the same thing but of course TARGET_BOTNAME for them is the name of your bot instead. It should also be possible to send the messages to more bots by adding this line below the existing one for each extra bot you want to send the message to. Although I can foresee if you add too many bots then you may lose some of the messages due to the flood filter in game, so you may have to add a delay between each tell.

Code: [Select]
$this -> bot -> send_tell("TARGET_BOTNAME", "say " . $name .": ".$message, 0, FALSE);

Note that I don't have a great understanding of php so I mostly went on using code from the say module and adapting it for what I needed this one to do. So I am sure its far from perfect but it works so I'm happy!

To send a message to your allied guild you type "!alliance <message>" in guild chat and the bot sends it to the target guilds bot which relays it to their guild chat.

Code: [Select]
<?php

$Alliance 
= new alliance($bot);

class 
alliance Extends BaseActiveModule
{
var $bot;
var $msg;




function __construct (&$bot)
{
parent::__construct(&$botget_class($this));

$this -> register_command("all""alliance""MEMBER");

$this -> help['description'] = 'Alliance Message Module';
$this -> help['command']['alliance <message>'] = "- Send a message to allied guild.";

}

function command_handler($name$msg$source)
{
$filters "rot13|chef|eleet|fudd|pirate|nofont";
if (preg_match("/^alliance (".$filters.") (.+)$/i"$msg$info))
return $this -> send_message($name$info[2], $info[1]);
else if (preg_match("/^alliance (.+)$/i"$msg$info))
return $this -> send_message($name$info[1]);
else    return "Learn how to use the command. See !help alliance";

}

function send_message($name$message$filter="off")
{
$filter strtolower($filter);

if ($filter <> "off")
{
$message $this -> bot -> core("stringfilter") -> funmode($message$filter);
}

$this -> bot -> send_tell("TARGET_BOTNAME""say " $name .": ".$message0FALSE);
                
$this -> bot -> send_gc("Your message has been sent to allies.");
}
}
?>
« Last Edit: February 10, 2009, 01:41:59 pm by -Fionn- »

Offline keirou

  • BeBot Apprentice
  • ***
  • Posts: 90
  • Karma: +0/-0
Re: Simple Guild Alliance Chat
« Reply #1 on: March 25, 2009, 04:20:00 pm »
was testing this earlier today, was working fine.
Just went to use it then (i run both bots off my comptuer)

and got this.
http://yfrog.com/4sbotsvj

so it would seem to me that AussieBot, has lost sync of TTLBot, and thus cannot pass on the messages.

TELL]   [INC]   -1: say Leafy: hello lol.
[TELL]   [OUT]   -> -1: I only listen to members of this bot.
[TELL]   [INC]   Miyaichi: hi
[TELL]   [OUT]   -> Miyaichi: /tell Aussiebot !help
[TELL]   [INC]   Miyaichi: !alliance Test
[TELL]   [OUT]   -> ttlbot: say Miyaichi: Test
[GROUP]   [MSG]   [The Aussie Battlers] Aussiebot: Your message has been sent to allies.
[TELL]   [INC]   -1: say Miyaichi: Test
[TELL]   [OUT]   -> -1: I only listen to members of this bot.
[TELL]   [INC]   Miyaichi: whois ttlbot
[TELL]   [OUT]   -> Miyaichi: Ttlbot is a level 5 Tempest of Set :: Online :: [link]Details[/link]

the -1 is ttlbot trying to send a message
both bots are superadmins on eachother, both bots have the file setup as instructed.
« Last Edit: March 25, 2009, 04:49:50 pm by keirou »

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Simple Guild Alliance Chat
« Reply #2 on: March 26, 2009, 06:05:05 pm »
Looks like your bot has trouble with getting the correct UID.

If a reboot alone doesn't help try the following:
- Remove the troubling bot from members/security groups
- Restart the bot that shows -1
- Try adding again

Only thing I can think of right now.

Offline Zweiblum

  • BeBot Apprentice
  • ***
  • Posts: 135
  • Karma: +0/-0
Re: Simple Guild Alliance Chat
« Reply #3 on: November 28, 2009, 05:27:11 pm »
so u dont have to set up a relay bot to work relaying to bots?
and is it possible to give the msg a prefix?

so thats:

ORgBot: [2ndOrg] blablub

or is it:

Orgbot: blablub

?

 

* 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: 680
  • 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