Kirsle.net logo Kirsle.net

Text-Based CyanChat Client

October 24, 2008 by Noah
I was looking at my CPAN directory the other day and noticed that my CyanChat modules were poorly documented, to the point where if I was somebody else and didn't know about Kirsle's Perl CyanChat Client, I'd have no example code to reference to figure out how to use these modules.

So, I've decided to update the modules and add some better examples in its documentation. I also thought it would be nice to include a demonstration program for a CyanChat client. The distribution already comes with a sample server script, but none for a client. I didn't wanna include a bot though, because then CyanChat would have these bots entering the room from people testing the demo script, and nobody likes bots. And then, PCCC is a heavy program to include as an example script. So, I decided to make a new CyanChat client that would be light enough to work.

So, I've created a text-based CyanChat client:
Terminal CyanChat Client

The script is mostly standalone: just one Perl script that uses Net::CyanChat. And also Term::ReadKey, which is easy to install. It doesn't use Curses or any other terminal GUI toolkit: it's all plain old text and ANSI colors. I built in my own kind of buffer system, and any time the chat dialog (or typed message prompt) changes, the window is cleared and redrawn from top to bottom, keeping track of how many characters and lines are being written so that it cuts off the buffer directly at the bottom of your terminal. And it works no matter what your terminal's dimensions are.

More screenshots:

Intro
The main menu screen, changing the CC host back to using port 1812 (I used 1813 as the default port number for development purposes).

Chatting
The CyanChat client in full operation.

Update: It works on Windows too (to much amazement as the command prompt completely sucks):

Win32 Console

Tags:

Comments

There are 2 comments on this page. Add yours.

Avatar image
Paradox posted on November 16, 2008 @ 04:15 UTC

For some reason, PMs don't seem to be working properly. Not a huge issue, and I'm curious to look into it myself and see what might be the issue.

Overall, an amazing app, especially since I can now run CC over SSH and access it from places where port 1812 is blocked. :D

Avatar image
Noah (@kirsle) posted on November 17, 2008 @ 07:55 UTC

I think it's mainly a bug in Net::CyanChat itself... the sendPrivate method still tries to get the fullName from $self->{nicks}->{$to} instead of $self->{nicks}->{who}->{$to} or ->{special}->{$to}. I changed the documentation to say that sendPrivate requires the fullName instead of just the nick but the module itself wasn't actually doing that.

I have a fix for it, I'll prolly upload the new version to CPAN in the next day or two.

Add a Comment

Used for your Gravatar and optional thread subscription. Privacy policy.
You may format your message using GitHub Flavored Markdown syntax.