User Control Panel
Advertisements

HELP US, HELP YOU!

MSN::SimChat
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Bot Depot Forum Index -> Modules & Add-ons
View unanswered posts
Author Message
thomashp
Member
Member


Joined: 22 Feb 2004
Posts: 121
Location: Richmond, VA
Reputation: 29.3Reputation: 29.3Reputation: 29.3

PostPosted: Tue Nov 30, 2004 12:34 am    Post subject: Reply with quote

Basically this module wraps up stuff needed to simulate chats with msn.

Keep in mind this is a beta (v0.3). If you find any bugs or have any suggestions for method additions or changes please post them here.

Methods:
Quote:
new( msn => $msn, notify => $bool, autoCreate => $bool2 )
Creates a new SimChat object. $msn is a MSN object. notify is a boolean that turns on notifications when users join and leave chats, set name flags or room topics are set. autoCreate is a boolean which controls if a new chat room is created when you try to put users into a room that does not exist.

createChat( $chatname )
Creates a chat room. $chatname is the name of the room.

destroyChat( $chatname )
Destroys a chat room. $chatname is the name of the room.

joinChat( $chatname, @users )
Puts @users in $chatname. If autoCreate is true, then it will also create $chatname if it does not exist.

leaveChat( $chatname, @users )
Takes @users out of $chatname. If $chatname is undef, then @users are taken out of all chats.

sendChat( $chatname, $from, $message, %style )
Sends message with %style to $chatname. If $from is sent then it does not send to that user. (So you don't send the message to the sender of the message.)

getChats( $user )
Returns an arrayref of chats $user is in.

getAllChats( )
Returns an arrayref of all chats.

getUsers( $chatname )
Returns an arrayref of all users in $chatname.

setNameFlag( $user, $bool )
Sets a flag for $user that controls if the name of the message's sender is put on the front of messages he receives from a chat. (Support for clients that don't support P4 naming, like Trillian.)

setTopic( $chatname, $topic )
Sets the topic of $chatname to $topic. To unset a topic, just set it to undef.

getTopic( $chatname )
Gets the topic for $chatname.

All methods return true for success and false otherwise.

Included is MSN::SimChat and a little test script called simchat.pl
Back to top
prof3ta
Young One
Young One


Joined: 04 Mar 2004
Posts: 64

Reputation: 27.7Reputation: 27.7Reputation: 27.7

PostPosted: Tue Nov 30, 2004 12:53 am    Post subject: Reply with quote

functional Smile I'm gonna give it a try!
Back to top
Mojave
Almost An Agent
Almost An Agent


Joined: 01 Nov 2003
Posts: 1434

Reputation: 66.4

PostPosted: Tue Nov 30, 2004 12:56 am    Post subject: Reply with quote

Nice job! I downloaded it and reviewed it (even though it now says zero downloads - you must have uploaded a newer version?). Anyhow, I like it.

Why does addChat take a list of users? It seems to me when you first create a chat, there would be nobody to put in it yet.
Back to top
mattaustin
Sentinel
Sentinel


Joined: 19 Jul 2004
Posts: 556
Location: Los Angeles, CA
Reputation: 50.7
votes: 1

PostPosted: Tue Nov 30, 2004 12:57 am    Post subject: Reply with quote

Great job. Looks cool ill give it a try too.
_________________
[ matt ]
Back to top
Addict
Not Yet a God
Not Yet a God


Joined: 21 Jan 2004
Posts: 473

Reputation: 34.4Reputation: 34.4Reputation: 34.4

PostPosted: Tue Nov 30, 2004 1:28 am    Post subject: Reply with quote

Very nice. Smile +1 ! B)
Back to top
dvondrake
Not Yet a God
Not Yet a God


Joined: 11 Mar 2004
Posts: 314
Location: El Paso, Texas
Reputation: 32.6Reputation: 32.6Reputation: 32.6

PostPosted: Tue Nov 30, 2004 1:29 am    Post subject: Reply with quote

Really cool module!!
Back to top
Art
God Like
God Like


Joined: 25 May 2004
Posts: 551
Location: Amsterdam, Holland
Reputation: 35.2Reputation: 35.2Reputation: 35.2Reputation: 35.2

PostPosted: Tue Nov 30, 2004 8:28 am    Post subject: Reply with quote

Very nice! I'll give it a try later. Smile
+ 1!
Back to top
thomashp
Member
Member


Joined: 22 Feb 2004
Posts: 121
Location: Richmond, VA
Reputation: 29.3Reputation: 29.3Reputation: 29.3

PostPosted: Tue Nov 30, 2004 7:04 pm    Post subject: Reply with quote

Not that I don't love the praise, but give me some constructive criticism people! What do you like about it, what would you like to see, what would you like changed, what would you do differently?
Back to top
Mojave
Almost An Agent
Almost An Agent


Joined: 01 Nov 2003
Posts: 1434

Reputation: 66.4

PostPosted: Tue Nov 30, 2004 7:08 pm    Post subject: Reply with quote

Well, I asked a question that you didn't answer. Razz
Back to top
thomashp
Member
Member


Joined: 22 Feb 2004
Posts: 121
Location: Richmond, VA
Reputation: 29.3Reputation: 29.3Reputation: 29.3

PostPosted: Tue Nov 30, 2004 7:12 pm    Post subject: Reply with quote

QUOTE(Mojave @ Nov 29 2004, 04:56 PM)
Why does addChat take a list of users? It seems to me when you first create a chat, there would be nobody to put in it yet.

Well say you have a bot that doesn't have any specified chat rooms, it just lets users create them when they want. Ths si when you need it. If a room does not exist, you would create it and put the user(s) who want to chat in that room in it. The possibilities are endless. A secret to my code at the moment is you can just call joinChat and ti will create a room if there is not one (although it does give a warning). Should these 2 methods just be combined? should addChat only make a chat and joinChat only add to the chat? What do you guys think?
Back to top
Dazzy
Agent
Agent


Joined: 09 Jan 2004
Posts: 1731

Reputation: 72.3

PostPosted: Tue Nov 30, 2004 7:20 pm    Post subject: Reply with quote

I think...There should only be add chat, and when you add somebody to a chat that doesnt exsist then it creates it atomatically...

Also some features you could add:
  • Close chat ? - When are they cleared? When rebooted?
  • Settings - Such as some filters to apply ect
  • A topic - setTopic($chatroom, $topic) / Its then sent to the chatroom and recalled whenever a user enteres the room
Back to top
Mojave
Almost An Agent
Almost An Agent


Joined: 01 Nov 2003
Posts: 1434

Reputation: 66.4

PostPosted: Tue Nov 30, 2004 7:20 pm    Post subject: Reply with quote

I think you definitely need an addChat method, so that you can setup cahts that people can join and leave. joinChat could have an optional parameter to add the chat if it doesn't exist yet, as you said. If no chat exists and someone tries to join a chat (and you aren't auto-creating chats), then it should fail with an error. You could also have leaveChat automatically delete the chat when the last person leaves, and that would also be an option. So you need a remChat too. And what about broadcastToChat (or some better name)?
Back to top
eric256
The Keymaker
The Keymaker


Joined: 03 May 2006
Posts: 2292
Location: Colorado
Reputation: 47Reputation: 47Reputation: 47Reputation: 47Reputation: 47

PostPosted: Tue Nov 30, 2004 7:28 pm    Post subject: Reply with quote

I think it needs support for trillian,i.e. not useing p-4 chat for users who can't see it.

Most chat functionality I would see being added threw commands though.

_________________
Eric256
Proud previous owner and current admin of Bot-depot.com
Back to top
thomashp
Member
Member


Joined: 22 Feb 2004
Posts: 121
Location: Richmond, VA
Reputation: 29.3Reputation: 29.3Reputation: 29.3

PostPosted: Wed Dec 01, 2004 1:07 am    Post subject: Reply with quote

I think the only support I would give for trillian users is flag you can set for a user if you want that user to have the name of that user displayed in front of the message.

Maybe something like setNameFlag( $user, $boolean );

If true everytime I send a message to that user I would send the name in from of the message.
Back to top
thomashp
Member
Member


Joined: 22 Feb 2004
Posts: 121
Location: Richmond, VA
Reputation: 29.3Reputation: 29.3Reputation: 29.3

PostPosted: Wed Dec 01, 2004 4:07 am    Post subject: Reply with quote

I just posted up a new version: 0.3.

Look at the first post in this topic for methods and the download.

Changes:
-renamed addChat to createChat
-createChat only creates chats, does not add any users
-added destoyChat method
-added setTopic, getTopic and notifications of these actions
-added a contructor flag autoCreate that lets you choose if joinChat will create chats or not
-added a getUsers method (how'd I forget that?)
-renamed getChat to getChats and getChats to getAllChats
-added a setNameFlag method and edited sendChat to work with it
-more error handling
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Bot Depot Forum Index -> Modules & Add-ons All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 



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