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: Output to a different channel?  (Read 9185 times)

0 Members and 1 Guest are viewing this topic.

Offline trousers

  • BeBot User
  • **
  • Posts: 22
  • Karma: +0/-0
Output to a different channel?
« on: March 21, 2008, 03:05:16 pm »
I searched the forums and the Wiki and didn't find anything, perhaps my terminology is wrong  ::)

I've been getting more adventurous in my programming thanks to the help this community has been giving me, but I am stuck now on how to achieve my next goals.

1) Is it possible to have the bot a) Listen to a public channel such as Neutral OOC and b) Output into said chat channel.

2) I presume it may be the same as the above, but is it possible to have the bot join another bot's private group and output into that chat channel?

Thanks in advance guys!!!!

-Pants

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Output to a different channel?
« Reply #1 on: March 21, 2008, 04:34:24 pm »
Short answer: yes to both.

Some more details now :)

You can use the $command["gmsg"][$channel][] = &$module; registration to listen to a public channel, where $channel has to be the exact name of the public channel, including upper and lower case.
It's technical possible to output stuff to an existing public channel. But there is no pre-defined function to do it (it would be a slight variation of the send_gc() function) as bot output to public channels may lead to dire reactions on FC's side. This usually only happens if a bot is spamming the public channel, but bot owners always have to be careful.

If you want your bot to join an existing private chat group it's almost as easy. You need a module to register to pginvite, and the handler must be similar to the one below, checking that it's a valid channel (you don't want your bot to join random channels really) and if it is accept the invite.
Code: [Select]
function pginvite($group)
{
    if (strtolower($validgroup) == strtolower($group))
        $this -> bot -> aoc -> privategroup_join($group);
}
The owner of the private chat (either the bot or the player) has to send you the invite. If it's a bebot it can be an !invite command or using autoinvite.

If you want to react to commands in the external channel you have to register them to the channel extpgmsg instead of pgmsg for the bot's group.
If you just want to parse the chat you have to register the handler extprivgroup($pgroupname, $user, $msg).
In both cases you have to make sure in the handler that you are only parsing stuff for the correct private group.

To send to the group you can use the send_pgmsg() function, like in the following line of code:
Code: [Select]
$this -> bot -> send_pgroup($output, $mygroup);
The code above is taken from Relay_GUILD.php and just slightly modified.
« Last Edit: March 21, 2008, 04:38:36 pm by Alreadythere »

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: Output to a different channel?
« Reply #2 on: March 21, 2008, 05:31:32 pm »
Any bot output to any public channel is going to be reported and you are likely to find all your accounts banned.

Funcom does not take lightly on bots spamming public channels. Remember, bot's are against the EULA of Anarchy Online, and are only allowed to exists by the good graces of Funcom.
BeBot Founder and Fixer Kingpin

Offline trousers

  • BeBot User
  • **
  • Posts: 22
  • Karma: +0/-0
Re: Output to a different channel?
« Reply #3 on: March 21, 2008, 10:27:15 pm »
Thanks for the code guys!

My plan was to have the one Roleplaying bot talk into the OOC channel once every 2 hours.  I figured that wouldn't be considered spam ... but if you're saying ALL bot chatter on the public channel is spam, I think I need to reconsider.

Offline Blueeagle

  • Omnipotent
  • BeBot Hero
  • ******
  • Posts: 323
  • Karma: +0/-0
Re: Output to a different channel?
« Reply #4 on: March 22, 2008, 04:28:30 am »
A) OOC = Out Of Character = Not a place for role playing
B) Any unsolicited bot chatter (especially repetitive) = spam.

I would not recomend or condone such a plan. Even when it's possible for players to ignore the bot chatter with a single command it's not appropriate to force users to do that.

What I would suggest you rather did was to invite people that were interested in such roleplaying to the bots private group. That way only people wanting the bot chatter would recieve it and FC  would most likely leave you alone.
The only problem that can't be solved by adding another wrapper is having too many wrappers.

Offline trousers

  • BeBot User
  • **
  • Posts: 22
  • Karma: +0/-0
Re: Output to a different channel?
« Reply #5 on: April 06, 2008, 08:48:59 am »
There is no RP Channel, so I was hoping to be able to inform people about the existance of such via the OOC Channel.  Since it's not advised to use the bot, I can still set it up in exactly the same fashion and just and people point players to it for info.

As for the code, it's still super useful for a different projecrt I am working on  ^_^

 

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