chat system through text commands
Posted: Sun Jan 31, 2010 7:19 am
Hi.
I've recently made a chat system that can be used through text commands. It's a text command called .chat.
You can download it here. Read INSTALL to learn how to install and configure the package.
Note that this is not a formal package with a directory and a pkg.cfg file (I don't use those things that much). Also note that I've written INSTALL in a hurry, so I may have forgotten something.
Post your problems here.
.chat usage
.chat send|s msg
Sends a message to everyone in the player's chat room. Examples:
.chat s hy folks
.chat send hey, u n00b lol xdddd
.chat join|j room_name passwd
This will make the player try to join the chat room named room_name using passwd or an empty string as password. If the room doesn't exist, it'll be created with password being an empty string or passwd.
Note that if this is done:
.chat j abc
Then the room "abc" is created with an empty string password. If another player, then, do this:
.chat j abc 123
He won't enter the room because the password is invalid because "abc"'s password is an empty string. To join rooms with empty strng passwords, simply do:
.chat j room_name
.chat leave
This will make the player leave his current room.
.chat list|ls|l
This will send an html gump to the player showing him a list of all currently created rooms.
.chat nextmsg|nm|n
This command will send the next player message as a message. So, if the player types
.chat nm
and, then, type
Hi folks!!
That will be the same of doing
.chat send Hi folks!!
.chat roll|r
Accepts a dice string (read RandomDiceRoll docs), rolls it and output as a chat message.
This differs from send in that the prefix isn't [c] (read prefix in the end of this post), it's [cr]. Examples:
.chat r 3d4
should output
[cr] phao 3d4 3
if the internal result of rolling 3d4 was 3.
.chat who|w
This will send the player a html gump containing a list of all player names that are in his chat room.
.chat meta|m
This will send the player a html gump containing information about chat rooms and his chat room.
Prefix
Chat messages have a [c] prefix.
[c] phao: hey
Chat roll messages have a [cr] prefix
[cr] phao: 2d4 3
Chat join messages have a [cj] prefix
[cj] phao entered the room.
Chat leave messages have a [cl] prefix
[cl] phao left the room.
You can extract .tar files with winrar, 7z or, in linux, tar.
Note that all files are unix text files. You probably won't be able to read them correctly in notepad. Use notepad2 or notepad++ instead.
Read all the other posts of mine to get more info on how to fix bugs, missing files and wrong source code. READ!
I've recently made a chat system that can be used through text commands. It's a text command called .chat.
You can download it here. Read INSTALL to learn how to install and configure the package.
Note that this is not a formal package with a directory and a pkg.cfg file (I don't use those things that much). Also note that I've written INSTALL in a hurry, so I may have forgotten something.
Post your problems here.
.chat usage
.chat send|s msg
Sends a message to everyone in the player's chat room. Examples:
.chat s hy folks
.chat send hey, u n00b lol xdddd
.chat join|j room_name passwd
This will make the player try to join the chat room named room_name using passwd or an empty string as password. If the room doesn't exist, it'll be created with password being an empty string or passwd.
Note that if this is done:
.chat j abc
Then the room "abc" is created with an empty string password. If another player, then, do this:
.chat j abc 123
He won't enter the room because the password is invalid because "abc"'s password is an empty string. To join rooms with empty strng passwords, simply do:
.chat j room_name
.chat leave
This will make the player leave his current room.
.chat list|ls|l
This will send an html gump to the player showing him a list of all currently created rooms.
.chat nextmsg|nm|n
This command will send the next player message as a message. So, if the player types
.chat nm
and, then, type
Hi folks!!
That will be the same of doing
.chat send Hi folks!!
.chat roll|r
Accepts a dice string (read RandomDiceRoll docs), rolls it and output as a chat message.
This differs from send in that the prefix isn't [c] (read prefix in the end of this post), it's [cr]. Examples:
.chat r 3d4
should output
[cr] phao 3d4 3
if the internal result of rolling 3d4 was 3.
.chat who|w
This will send the player a html gump containing a list of all player names that are in his chat room.
.chat meta|m
This will send the player a html gump containing information about chat rooms and his chat room.
Prefix
Chat messages have a [c] prefix.
[c] phao: hey
Chat roll messages have a [cr] prefix
[cr] phao: 2d4 3
Chat join messages have a [cj] prefix
[cj] phao entered the room.
Chat leave messages have a [cl] prefix
[cl] phao left the room.
You can extract .tar files with winrar, 7z or, in linux, tar.
Note that all files are unix text files. You probably won't be able to read them correctly in notepad. Use notepad2 or notepad++ instead.
Read all the other posts of mine to get more info on how to fix bugs, missing files and wrong source code. READ!