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

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

Author Topic: Bots Telling other bots?  (Read 3393 times)

0 Members and 2 Guests are viewing this topic.

Offline trousers

  • BeBot User
  • **
  • Posts: 22
  • Karma: +0/-0
Bots Telling other bots?
« on: December 19, 2007, 05:27:22 am »
I'm having trouble getting two bots to exchange tells and listen to eachother.

bot2 [2007-12-19 03:21:45]     [TELL]  [INC]   bot1: !online
bot2 [2007-12-19 03:21:45]     [TELL]  [OUT]   -> bot1: /tell bot2 !help

What I'm trying to do is have bot1 send a tell to bot2 whenever a bot1 member logs on so that bot2 can send an announcement about it.

Is there an easy way to get it to do this?

Thanks in advance!

Offline Temar

  • Contributor
  • *******
  • Posts: 1140
  • Karma: +0/-0
    • AoFiles
Re: Bots Telling other bots?
« Reply #1 on: December 19, 2007, 08:39:57 am »
you have to turn off the colors
it reading your tell as <font...>!online</font>
example:
      $this -> bot -> send_tell(Onlineorgbot, "get ".$orgid."", 0, false);
thats being (name, message, spam?, colors?)

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Bots Telling other bots?
« Reply #2 on: December 19, 2007, 04:04:23 pm »
I'm having trouble getting two bots to exchange tells and listen to eachother.

bot2 [2007-12-19 03:21:45]     [TELL]  [INC]   bot1: !online
bot2 [2007-12-19 03:21:45]     [TELL]  [OUT]   -> bot1: /tell bot2 !help

What I'm trying to do is have bot1 send a tell to bot2 whenever a bot1 member logs on so that bot2 can send an announcement about it.

Is there an easy way to get it to do this?

Thanks in advance!
You need two steps in your module on the sending server:
  • You have to check for buddies that log on. Either use the buddy() function or use the logon notifier module.
  • Send the tell to the target bot like Temar wrote, setting colors to false. That way you don't get any color tags in your output. E.g. $this -> bot -> send_tell("Bot2", "!loggedon ".$name, 0, false);[/i]

    Of course, the target bot will have to react to the tells.

Offline trousers

  • BeBot User
  • **
  • Posts: 22
  • Karma: +0/-0
Re: Bots Telling other bots?
« Reply #3 on: December 20, 2007, 03:52:22 pm »
You guys freaking rock!

I haven't tested it yet but I have confidence in your knowledge.

The way I have it right now is actually in bot.php in the buddy() function.  The Bot itself is only used to track a small group of players who log on and off, and then send a command to a different bot to send an announcement to the members that said players have logged on or off.

It's probably sloppy, but I am a noob trying to pull stuff off that's well beyond my capabilities :-)

I can't wait to get home and test this out!

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Bots Telling other bots?
« Reply #4 on: December 20, 2007, 05:19:43 pm »
Check out modules/Logon_GUILD.php to see a use of the buddy() function and the $commands["buddy"][] array.

Check out modules/AutoInv.php for the use of Logon_Notifies (the register() function in the constructor and the notify() function to handle the actual notify). This notifies can be slightly delayed (a few seconds, to avoid spamming of characters that just log on) - the delay is configurable via !settings Logon_Notifies.

 

* Recent Posts
Com bot module by bitnykk
[November 25, 2024, 05:36:11 pm ]


0.8.x updates for AO by bitnykk
[June 23, 2024, 03:19:47 pm ]


0.8.x updates for AoC by bitnykk
[June 23, 2024, 03:19:44 pm ]


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


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

* Who's Online
  • Dot Guests: 307
  • 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