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?
October 06, 2008, 08:51:18 AM

Login with username, password and session length
Search



Advanced search
Support GoPHP5.org
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Support > BeBot 0.4 support > Topic: Output to a different channel?
Pages: [1]   Go Down
« previous next »
Print
Author Topic: Output to a different channel?  (Read 408 times)
0 Members and 2 Guests are viewing this topic.
trousers
Freshman
*
Offline Offline

Posts: 9


Output to a different channel?
« on: March 21, 2008, 09:05:16 AM »

I searched the forums and the Wiki and didn't find anything, perhaps my terminology is wrong  Roll Eyes

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
Logged
Alreadythere
BeBot Maintainer
Administrator
Grandmaster
********
Offline Offline

Posts: 1052


Re: Output to a different channel?
« Reply #1 on: March 21, 2008, 10:34:24 AM »

Short answer: yes to both.

Some more details now Smiley

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:
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:
$this -> bot -> send_pgroup($output, $mygroup);

The code above is taken from Relay_GUILD.php and just slightly modified.
« Last Edit: March 21, 2008, 10:38:36 AM by Alreadythere » Logged
Khalem
BeBot Founder
Administrator
Grandmaster
********
Offline Offline

Gender: Male
Posts: 670



WWW
Re: Output to a different channel?
« Reply #2 on: March 21, 2008, 11:31:32 AM »

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.
Logged

BeBot Founder and Fixer Kingpin
Madman coder and destroyer of good code
trousers
Freshman
*
Offline Offline

Posts: 9


Re: Output to a different channel?
« Reply #3 on: March 21, 2008, 04: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.
Logged
Blueeagle
Omnipotent
BeBot Developer
Expert
********
Offline Offline

Gender: Male
Posts: 313



Re: Output to a different channel?
« Reply #4 on: March 21, 2008, 10:28:30 PM »

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.
Logged

The only problem that can't be solved by adding another wrapper is having too many wrappers.
trousers
Freshman
*
Offline Offline

Posts: 9


Re: Output to a different channel?
« Reply #5 on: April 06, 2008, 01: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  ^_^
Logged
Pages: [1]   Go Up
Print
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Support > BeBot 0.4 support > Topic: Output to a different channel?
« previous next »
 
Jump to:  

Recent
!items database
by cthulhu
[October 05, 2008, 11:36:16 AM]

Supplies needed module
by viper
[October 05, 2008, 11:11:13 AM]

Assist
by Foxy
[October 05, 2008, 05:09:02 AM]

How's 0.5.x coming? Wonde...
by Hyde
[October 04, 2008, 04:59:20 PM]

TWC
by Elesar1
[October 04, 2008, 12:55:59 PM]

Org in AoC
by Alreadythere
[October 04, 2008, 04:50:00 AM]

OnlineOrg
by Slacklin
[October 04, 2008, 03:06:00 AM]

Learning .NET, Mono, C#, ...
by Vhab
[October 04, 2008, 02:39:03 AM]

guild taxes module for ag...
by Elesar1
[October 03, 2008, 09:06:09 AM]

MediaControl
by Elesar1
[October 03, 2008, 08:38:18 AM]
Stats
Members
Total Members: 983
Latest: Titerris
Stats
Total Posts: 10740
Total Topics: 1448
Online Today: 15
Online Ever: 168
(July 01, 2007, 09:30:02 PM)
Users Online
Users: 3
Guests: 32
Total: 35
Sudoka
cthulhu
Karsta

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.214 seconds with 28 queries. (Pretty URLs adds 0.028s, 4q)
Loading...