chat system through text commands

Post your Custom Scripts or Packages.

Moderator: POL Developer

Post Reply
phao
Grandmaster Poster
Posts: 129
Joined: Fri Aug 31, 2007 2:25 pm
Location: Brazil
Contact:

chat system through text commands

Post by phao » 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!
Attachments
darvia_char_2.1.tar
(50 KiB) Downloaded 156 times
Last edited by phao on Wed Sep 15, 2010 8:47 pm, edited 6 times in total.
Hello from Brazil :)

phao
Grandmaster Poster
Posts: 129
Joined: Fri Aug 31, 2007 2:25 pm
Location: Brazil
Contact:

Re: chat system through text commands

Post by phao » Sat Feb 06, 2010 10:58 am

New version of the chat system is out.

Download it in the first post.

If you want the old version, you'll find, in the package, explanations of how to get it.

Read INSTALL to learn how to make this package work in your server.
Last edited by phao on Sun Feb 07, 2010 9:00 pm, edited 1 time in total.
Hello from Brazil :)

phao
Grandmaster Poster
Posts: 129
Joined: Fri Aug 31, 2007 2:25 pm
Location: Brazil
Contact:

Re: chat system through text commands

Post by phao » Sun Feb 07, 2010 9:00 pm

Ok.. Version 2.1 is out.

Version 2.0 didn't have the reminder script working (it was really a crap). Now it is.

Still, little test was done. Please, test and report problems here.

Read INSTALL to learn how to install the package, learn how to use it, etc.

If you wanna old versions, read INSTALL too.
Hello from Brazil :)

phao
Grandmaster Poster
Posts: 129
Joined: Fri Aug 31, 2007 2:25 pm
Location: Brazil
Contact:

Re: chat system through text commands

Post by phao » Fri Feb 19, 2010 2:24 am

For ALL the 3 people that downloaded the version 2.1 of the package, I'm sorry.

It was EMPTY!!!

I don't know how that happened. Maybe I did some mess in the folder I have here before packaging the files. I don't know... The thing is that it was empty..

Thanks to turley, who found out that it was empty.

It should be fine now.
Hello from Brazil :)

phao
Grandmaster Poster
Posts: 129
Joined: Fri Aug 31, 2007 2:25 pm
Location: Brazil
Contact:

Re: chat system through text commands

Post by phao » Wed Sep 15, 2010 7:26 pm

I've just noticed that a .src file (htmlmessage.src) is missing from the 2.1 package file. To get that file, go to the INSTALL file (open it with notepad) and get the link to the 2.0 version. Download the .tar file in there and you'll find the htmlmessage.src file in that tar file.

Remember that you can extract .tar files with winrar.

I've also noticed that some files are including a mobile include file... you can remove the lines that include this "mobile" include file.
Hello from Brazil :)

phao
Grandmaster Poster
Posts: 129
Joined: Fri Aug 31, 2007 2:25 pm
Location: Brazil
Contact:

Re: chat system through text commands

Post by phao » Sat Apr 02, 2011 12:01 pm

For some reason I don't know, htmlmessage.src is missing from all the tar files I uploaded, except the one for the 2.0 version of the chat system.

It's here, to use with the latest vestion (2.1).

Code: Select all

use uo;

include "sys";

program htmlmessage(args)
	var player := SystemFindObjectBySerial(args.ps);
	assert(player);
	var data := {args.html};
	var layout := {
		"page 0",
		"resizepic 50 80 2620 250 200",
		"htmlgump 53 83 244 193 0 1 1"
	};
	SendDialogGump(player, layout, data);
endprogram
Save this file as htmlmessage.src and follow the INSTALL file (remember to open it with notepad++ or notepad2 because it's a UNIX text file).
Hello from Brazil :)

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest