User Control Panel
Advertisements

HELP US, HELP YOU!

Help with Chat

 
Post new topic   Reply to topic    Bot Depot Forum Index -> General Programming Questions
View unanswered posts
Author Message
Dark_Angel
Newbie
Newbie


Joined: 01 Mar 2006
Posts: 4

Reputation: 2.3Reputation: 2.3

PostPosted: Wed Mar 01, 2006 6:38 pm    Post subject: Help with Chat Reply with quote

Hello

I'm a complete noob in what relates to bots and Perl.

I installed ActivePerl, and was able to run two bots, White Warrior v1.0 and MayaBot v4.0.

So far so good, but I still can't do what I wanted, and I'm would you could help me.

I wanted a chatroom, but I wanted it to be a "real" chatroom, with several contacts in the same conversation.

Whenever anyone would open a conversation with the Bot, and give the command !chat, the bot would then invite that user to a conversation already open and with several people in it already chatting.
If that conversation window doesn't exist yet, a separate one would be created...to where others would be invited, and keeping the initial conversation intact.

I don't know how difficult this is to do, but I sure was unable to do it.
I tried a MSN::SimChat that I found here, but could integrate it with either WW or Maya.
Back to top
ScottyGN
Newbie
Newbie


Joined: 12 Feb 2006
Posts: 15

Reputation: 6.8Reputation: 6.8Reputation: 6.8Reputation: 6.8Reputation: 6.8Reputation: 6.8

PostPosted: Thu Mar 02, 2006 7:23 pm    Post subject: Reply with quote

create a file in command/public called chat.maya, witch looks like this:

$self->invite("$1");

then you have the inviting, however i cannot se how one would make a chatroom like you want.(mayabot)
Back to top
Dark_Angel
Newbie
Newbie


Joined: 01 Mar 2006
Posts: 4

Reputation: 2.3Reputation: 2.3

PostPosted: Thu Mar 02, 2006 9:43 pm    Post subject: Reply with quote

Code:
<Command> Executing chat command
ERROR : Need a handle to invite
Caller trace:
  0: MSN::error (MSN/SwitchBoard.pm, line 79)
  1: MSN::SwitchBoard::error (MSN/SwitchBoard.pm, line 339)
  2: MSN::SwitchBoard::invite ((eval 17), line 1)
  3: (eval) (MSN Bot\MayaBot\bot.pl, line 166)
  4: main::Message (MSN.pm, line 750)
  5: MSN::call_event (MSN/SwitchBoard.pm, line 604)
  6: MSN::SwitchBoard::CMD_MSG (MSN/SwitchBoard.pm, line 438)
  7: MSN::SwitchBoard::dispatch (MSN.pm, line 691)
  8: MSN::do_one_loop (MSN Bot\MayaBot\bot.pl, line 61)


That command gives this error

Imagine this:

Quote:
The BOT is running

User A logs in, opens a chat with the BOT and executes !chatroom command.

The BOT assumes the current conversation as a CHATROOM if no CHATROOM exists

User B logs in, opens a chat with the BOT and executes !chatroom

The BOT invites user B into CHATROOM, started by user A

User C logs in, opens a chat with the BOT and executes !chatroom

The BOT invites user C into CHATROOM, started by user A, and where is also user B.

User D logs in, opens a chat with the BOT and executes !chatroom

The BOT invites user D into CHATROOM, started by user A, and where is also user B and C


I don't nedd kicking,and baning and other complicated stuff, so no need for a simulated chat.

Its just inviting people into the same conversation over and over again, I suppose its a lot easier to do than the other Chats I have seen in templates I have tried, and I have tried MayaBot 4, Aiden 0.2 , Evolution 1.3, White Warrior 1.

Leviathan, WhiteWarrior and blobsy I couln't set them running.

Can anyone...please help me with this????
Back to top
Dark_Angel
Newbie
Newbie


Joined: 01 Mar 2006
Posts: 4

Reputation: 2.3Reputation: 2.3

PostPosted: Wed Mar 08, 2006 7:09 pm    Post subject: Reply with quote

I got it to work, but it has a few problems:

Code:
   if (!exists $msn->{chatroom})
   {
      $msn->{chatroom} = $self;
      &send($self, "Bem-vindo/a ao Chat, $username");
   }
   elsif ($self eq $msn->{chatroom})
   {
      &send($self, "Já está no Chat!");
   }
   else
   {
      $msn->{chatroom}->invite($username);
      &send($self, "A convidá-lo/a para entrar no Chat...");
      &send($msn->{chatroom}, "Bem-vindo/a ao Chat, $username");
   } 


I believe this code came from a thred in this forum, but I don't remember which one.
In that thread one of my problems was already mencionted.

When everyone leaves the chat, and someone tries to get in, the bo tries to connect to the previous chat instead of starting a new one.
This problem I think is very complicated, and I doubt I can solve it.

I will just have to get someone to be in the chat 24/7 (another bot perhaps?)




Another thing that happens is that when someone leaves the chat, and then tries to return, it gets invited...but the conversation only opens on their end when one someone says something on the chat.
This could be easily resolved, by getting the Bot to greet overyone that enters the Chat, and this way the conversation would always be opened for them.

But the problem is that the Bot greets the person before she gets in!
Despite the order of the code, the message gets to the chat greeting the user...before the user actually enters the chat!!

this should have a way around...I would aprecciate some help Wink
Back to top
JTW
God Like
God Like


Joined: 07 Mar 2004
Posts: 579
Location: Maidstone
Reputation: 67.1
votes: 4

PostPosted: Thu Mar 09, 2006 11:00 am    Post subject: Reply with quote

To solve the problem of inviting the person back into chat you probably do not
Code:
delete $msn->{chatroom};

When the last Person has left. which should solve that problem

For your second problem, do you use the join handler (i think its the right one)which is called when a person enters a room that is already open with the bot, maybe if you make it check if it is chat and then send the greet message.

Hope this helps
JT

_________________
"Help us, Help you" - BotDepot
Back to top
Dark_Angel
Newbie
Newbie


Joined: 01 Mar 2006
Posts: 4

Reputation: 2.3Reputation: 2.3

PostPosted: Thu Mar 30, 2006 11:29 pm    Post subject: Reply with quote

JTW wrote:
To solve the problem of inviting the person back into chat you probably do not
Code:
delete $msn->{chatroom};

When the last Person has left. which should solve that problem

For your second problem, do you use the join handler (i think its the right one)which is called when a person enters a room that is already open with the bot, maybe if you make it check if it is chat and then send the greet message.

Hope this helps
JT


I tried doing what you said, but failed to do so.
My knowledge of Pearl is close to null.

Can you give an example of the apllication of your advice, please?
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Bot Depot Forum Index -> General Programming Questions All times are GMT
Page 1 of 1

 



Protected by phpBB Security phpBB-TweakS
phpBB Security Has Blocked 9 Exploit Attempts.
Antispam Captcha Mod by phpbb-security.com
Powered by phpBB © 2001, 2005 phpBB Group