Torque IRC Client
A multi-part tutorial
By:
Harold “LabRat” Brown

Introduction

	This tutorial will cover the information you need to write a basic IRC client for the Torque Game Engine.  As you go through the tutorial you will learn how to use each of the different components needed to connect to an IRC server, Display the channel list, join a channel, see the chat and see the list of people in that channel with you.  Along the way, we will be exploring uses of the individual components that themselves can be expanded into useful or unique features.

Part 1 – TCP Object

	The first object we will learn about is the TCP Object.  This one object has many uses, both for connecting to remote servers and for hosting servers.  In this segment, we will cover how to create a TCP object, what functions you can perform with it, and what functions it will trigger while it is being used.

	First we will create a TCP Object, to do so we need to drop down the console window by pressing the ~ key (Figure 1).

Figure 1

	Once you have the console window open type the following:

new tcpobject(tcpobj);

	This will create a TCP object named “tcpobj” that can be referenced by that name.  Now that we have a TCP Object created, you will need to know what you can do with it.  The TCP Object has four commands unique to it, and several others that most objects in Torque share.  To see the list of all commands type tcpobj.dump(); To see the list (Figure 2)