User Control Panel
Advertisements

HELP US, HELP YOU!

Chat Room

 
Post new topic   Reply to topic    Bot Depot Forum Index -> Commands
View unanswered posts
Author Message
Saphire
Newbie
Newbie


Joined: 03 Apr 2005
Posts: 26
Location: Hertfordshire, England
Reputation: 13.8

PostPosted: Tue Apr 05, 2005 8:15 am    Post subject: Reply with quote

People normally download Maya 4 and think.. wheres the Chat room.

Well i have found a Code for the chat room.

Code:
if ($msg eq "chat") {<br />    if (!exists $msn->{chatroom})<br />    {<br />        $msn->{chatroom} = $self;<br />        &send($self, "Welcome to the ChatRoom, $username");<br />    }<br />    elsif ($self eq $msn->{chatroom})<br />    {<br />        &send($self, "You are Already in the chat room!");<br />    }<br />    else<br />    {<br />        $msn->{chatroom}->invite($username);<br />        &send($self, "Waiting to go in the Chat Room...");<br />    }  <br />}


EDIT: I am having some problems with the code, when everyone leaves the chat if you want to get back in you cant because it says "Waiting to go in" and it dosnt go to the right Socket. Anyone know how to solve this? [Bit like Calums post]
Back to top
draget
Not Yet a God
Not Yet a God


Joined: 29 Dec 2004
Posts: 367
Location: Australia
Reputation: 32.2Reputation: 32.2Reputation: 32.2

PostPosted: Tue Apr 05, 2005 9:51 am    Post subject: Reply with quote

invite($username);

you hjave an invite sub?
Back to top
mat007
Almost An Agent
Almost An Agent


Joined: 12 Jan 2004
Posts: 1375

Reputation: 15.8Reputation: 15.8
votes: 2

PostPosted: Tue Apr 05, 2005 12:49 pm    Post subject: Reply with quote

$msn->{chatroom} is a refrence to self, so self being the chatroom wene someone types !chat it sends from that socket: CAL \r\n in switchboard.pm inviting them to teh convo..

Look in msn.pm docs and add the RoomClosed hadndler check if the convo was chat and if so delete it Smile
Back to top
Dazzy
Agent
Agent


Joined: 09 Jan 2004
Posts: 1731

Reputation: 72.3

PostPosted: Tue Apr 05, 2005 3:27 pm    Post subject: Reply with quote

Or even better, make it a p4 chat....
Well better for msn client user....Other wise 'change' it so that non people without p4 capability can use it just as well;)
Back to top
Cer
Upgraded Agent
Upgraded Agent


Joined: 03 Feb 2004
Posts: 3776
Location: Michigan
Reputation: 146.9
votes: 4

PostPosted: Tue Apr 05, 2005 6:48 pm    Post subject: Reply with quote

You could use the Games::Manager module to make a P4 chat room (and later, to make multiplayer games if you want to).

Code:
# Up right after creating $msn....<br />use Games::Manager;<br />$msn->{games} = new Games::Manager (debug => 1);<br />$msn->{games}->setHandler (broadcast => \&broadcast);<br /><br /># Games::Manager broadcast.<br />sub broadcast {<br />   my (%data) = @_;<br />   my $to = $data{to};<br />   my $msg = $data{message};<br /><br />   # Call them.<br />   $msn->call ($to, $msg);<br />}<br /><br />#......................................<br /><br />if ($msg eq "chat") {<br />   # See if the chat exists.<br />   if ($msn->{games}->queryGame ('chat') != 1) {<br />      # Create and add the first chat member.<br />      $msn->{games}->create (<br />         id => 'chat',<br />         name => 'P4 Chat Room',<br />      );<br />      $msn->{games}->addPlayer ('chat', $username);<br />      &send ($self, "Chat room created. Welcome!");<br />   }<br />   elsif ($msn->{games}->queryPlayer ('chat',$username)) {<br />      &send ($self, "You are already in the chat room!");<br />   }<br />   else {<br />      # Add this user to the chat.<br />      $msn->{games}->addPlayer ('chat', $username);<br />      $msn->{games}->broadcast ('chat', "$username has joined the room.");<br />   }<br />}


It's a kind of codey way to do it, but Games::Manager can handle chat rooms (you can even use Games::Manager to allow users to create their own rooms, you just have to know how to handle the ID's right so each room gets a unique ID)

I attached Manager.pm, extract to a lib/Games/ folder if you intend to use it.

_________________
Current Site (2008) http://www.cuvou.com/
Back to top
Mojave
Almost An Agent
Almost An Agent


Joined: 01 Nov 2003
Posts: 1434

Reputation: 66.4

PostPosted: Tue Apr 05, 2005 7:51 pm    Post subject: Reply with quote

There's a robust Chat Room module written by thomashp.
Back to top
Saphire
Newbie
Newbie


Joined: 03 Apr 2005
Posts: 26
Location: Hertfordshire, England
Reputation: 13.8

PostPosted: Wed Apr 06, 2005 12:35 pm    Post subject: Reply with quote

QUOTE(Cer @ Apr 5 2005, 10:48 AM)
You could use the Games::Manager module to make a P4 chat room (and later, to make multiplayer games if you want to).

Code:
# Up right after creating $msn....<br />use Games::Manager;<br />$msn->{games} = new Games::Manager (debug => 1);<br />$msn->{games}->setHandler (broadcast => \&broadcast);<br /><br /># Games::Manager broadcast.<br />sub broadcast {<br />   my (%data) = @_;<br />   my $to = $data{to};<br />   my $msg = $data{message};<br /><br />   # Call them.<br />   $msn->call ($to, $msg);<br />}<br /><br />#......................................<br /><br />if ($msg eq "chat") {<br />   # See if the chat exists.<br />   if ($msn->{games}->queryGame ('chat') != 1) {<br />      # Create and add the first chat member.<br />      $msn->{games}->create (<br />         id => 'chat',<br />         name => 'P4 Chat Room',<br />      );<br />      $msn->{games}->addPlayer ('chat', $username);<br />      &send ($self, "Chat room created. Welcome!");<br />   }<br />   elsif ($msn->{games}->queryPlayer ('chat',$username)) {<br />      &send ($self, "You are already in the chat room!");<br />   }<br />   else {<br />      # Add this user to the chat.<br />      $msn->{games}->addPlayer ('chat', $username);<br />      $msn->{games}->broadcast ('chat', "$username has joined the room.");<br />   }<br />}


It's a kind of codey way to do it, but Games::Manager can handle chat rooms (you can even use Games::Manager to allow users to create their own rooms, you just have to know how to handle the ID's right so each room gets a unique ID)

I attached Manager.pm, extract to a lib/Games/ folder if you intend to use it.
[right][snapback]47541[/snapback][/right]


When ive done that what do i do after that. :S
Back to top
JTW
God Like
God Like


Joined: 07 Mar 2004
Posts: 582
Location: Maidstone
Reputation: 73.3
votes: 4

PostPosted: Wed Apr 06, 2005 12:50 pm    Post subject: Reply with quote

run the bot then type "chat" to join chat
_________________
"Help us, Help you" - BotDepot
Back to top
Saphire
Newbie
Newbie


Joined: 03 Apr 2005
Posts: 26
Location: Hertfordshire, England
Reputation: 13.8

PostPosted: Wed Apr 06, 2005 5:19 pm    Post subject: Reply with quote

Hmmmmm dosnt seem to work
Back to top
JTW
God Like
God Like


Joined: 07 Mar 2004
Posts: 582
Location: Maidstone
Reputation: 73.3
votes: 4

PostPosted: Thu Apr 07, 2005 3:20 am    Post subject: Reply with quote

any error messages?
_________________
"Help us, Help you" - BotDepot
Back to top
Saphire
Newbie
Newbie


Joined: 03 Apr 2005
Posts: 26
Location: Hertfordshire, England
Reputation: 13.8

PostPosted: Thu Apr 07, 2005 11:18 am    Post subject: Reply with quote

no.. just no reply. :S
Back to top
Saphire
Newbie
Newbie


Joined: 03 Apr 2005
Posts: 26
Location: Hertfordshire, England
Reputation: 13.8

PostPosted: Fri Apr 08, 2005 7:00 pm    Post subject: Reply with quote

Check post: http://www.bot-depot.com/forums/index.php?showtopic=5870

Please leave this topic now! ITS OLD. >Very Happy
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Bot Depot Forum Index -> Commands 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