• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

data/H03-May-2022-12,6299,338

doc/H03-May-2022-320264

AUTHORSH A D15-Apr-2001363 1713

COPYINGH A D20-Apr-199917.6 KiB341281

ChangeLogH A D13-Jan-200453.7 KiB979895

ChangeLog.themesH A D09-Jan-2000189 64

FAQH A D07-Feb-20003.9 KiB8564

INSTALLH A D04-Mar-20026.8 KiB234167

Makefile.amH A D12-Jan-20044.3 KiB13274

Makefile.inH A D03-May-202229.4 KiB843717

NEWSH A D09-Jan-20001.8 KiB4029

READMEH A D04-Mar-200215.9 KiB500352

aclocal.m4H A D13-Jan-200432.9 KiB901766

channel.ccH A D03-May-20224.2 KiB209169

channel.hH A D12-Jan-2004881 4238

command.ccH A D12-Jan-20044.8 KiB188166

command.hH A D12-Jan-2004264 104

complete.ccH A D02-Oct-200214.1 KiB554460

complete.hH A D18-Jan-2000227 128

config.h.inH A D13-Jan-20042.5 KiB9865

configureH A D03-May-2022363 KiB12,05210,438

configure.inH A D12-Jan-200416.4 KiB510433

dcc.ccH A D12-Jan-200428.1 KiB987824

defines.hH A D01-Aug-1999384 2016

depcompH A D12-Jan-200414.5 KiB521331

echo.ccH A D12-Jan-200410.6 KiB421346

echo.hH A D16-Dec-1999279 128

format.ccH A D03-May-20229.8 KiB411333

format.hH A D12-Jan-2004540 1814

generate_tags.ccH A D12-Jan-20041.5 KiB3633

hash.ccH A D03-May-20221.2 KiB6052

hash.hH A D12-Jan-2004372 1813

history.hH A D20-May-1999554 3632

illist.hH A D01-Oct-20025.3 KiB264227

install-shH A D25-Jun-19995.5 KiB252153

llist.hH A D04-Jul-20004.8 KiB241205

messages.hH A D25-Jul-19991.1 KiB1915

missingH A D12-Jan-200410.4 KiB361270

mkinstalldirsH A D25-Jun-1999725 4123

mytcl.hH A D17-Jul-20003.4 KiB9184

network.ccH A D02-Aug-20001.7 KiB7447

network.hH A D10-May-1999331 1913

nick.hH A D12-Jan-20042.8 KiB156128

query.hH A D12-Jan-2004895 5643

quirc.ccH A D17-Jul-20008.4 KiB304224

quirc.hH A D25-Jul-1999743 3823

quirc.specH A D12-Jan-2004799 3124

server.ccH A D13-Jan-200434.6 KiB1,2931,061

serverdcc.hH A D12-Jan-20045.7 KiB298259

servertcl.ccH A D03-May-202248.8 KiB1,5901,464

support.ccH A D12-Jan-20042.9 KiB161128

support.hH A D03-May-20221.8 KiB5617

tags.ccH A D13-Jan-2004157.9 KiB1,0321,030

tags.hH A D12-Jan-2004148 96

tcl.ccH A D03-May-202237.6 KiB1,3371,152

tcltk.ccH A D03-May-20227.7 KiB330239

tcltk.h.inH A D12-Jan-20041.4 KiB4029

window.ccH A D03-May-20223.4 KiB8456

window.hH A D15-May-1999532 3932

README

1QuIRC - What do you think?
2
3Copyright (C) 1998-2001, Patrick Earl
4
5This program is free software; you can redistribute it and/or
6modify it under the terms of the GNU General Public License
7as published by the Free Software Foundation; either version 2
8of the License, or (at your option) any later version.
9
10This program is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with this program; if not, write to the Free Software
17Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
18
19Patrick Earl - quirc@patearl.net
20
21
22TABLE OF CONTENTS
23-Notes
24-Keys
25-Commands
26-Popups
27-Alias System
28-Event System
29-General Scripting Information
30-QuIRC's Start-Up Process
31-UI Programming Information
32-Issues To Be Aware Of
33-Lacking Features And Known Bugs
34
35
36NOTES
37
38Bug reports (detailed as possible please) and patches for QuIRC are always
39welcomed wholeheartedly.  If anyone would like to assist in the development
40of QuIRC, let me know and we'll see what we can work out.
41
42Special thanks to Stuart Moore (hero-) for writing the nick complete and
43substantial portions of the tcl code, and for being an Alpha tester for QuIRC.
44
45Thanks also to Wilton Wong (Atko) who was a great help in fixing the
46multiserver problems as well as a few bugs that caused a seg fault on exit.
47
48Let's have a great big round of applause for D. Richard Hipp without whose
49Embedded Tk, QuIRC would not even have happened.  Thanks also for the nice
50pure Tcl/Tk tree widget :)
51
52See the INSTALL file for instructions on installing.
53
54See the CHANGELOG file for details on what's new.
55
56See the FAQ for a variety of information not found here.
57
58
59KEYS
60
61These are the default keys that come in config.tcl:
62
63Control-Enter
64	Sends the input without parsing it first, so lines with / can be sent
65        and not interpreted as commands.
66
67Alt-Enter
68	Acts like Control-Enter only it trims space off the text before
69	sending.  Is useful for dealing with data pasted from Netscape.
70
71Shift-Enter
72	Inserts a linefeed into the command line so you can run more than one
73	command on the same line easily.
74
75Control-Down
76	Goes to the next window
77
78Control-Up
79	Goes to the previous window
80
81Up
82	Recalls the previous command in the history list
83
84Down
85	Recalls the next command in the history list
86
87Shift-Prior (PgUp)
88	Scrolls the currently showing text window up.
89
90Shift-Next (PgDn)
91	Scrolls the currently showing window down.
92
93Prior
94	Same as Shift-Prior
95
96Next
97	Same as Shift-Next
98
99Control-Prior
100	Scrolls the nicklist up.
101
102Control-Next
103	Scrolls the nicklist down.
104
105Alt-Prior
106	Scrolls the windowlist up.
107
108Alt-Next
109	Scrolls the windowlist down.
110
111Control-F4
112	Closes the current window.
113
114Alt-F4
115	Closes the client.
116
117Control-c
118	Inserts the color character (\x03).
119
120Control-l
121	Inserts the bold character (\x02).
122
123Control-u
124	Inserts the underline character (\x1f).
125
126Control-_
127	Inserts the underline character (\x1f).
128
129Alt-n
130	Opens the server dialog.
131
132
133COMMANDS
134
135Commands that begin with / are evaluated as aliases.  Every command not listed
136here is an alias:
137
138/lookup - Given a hostname, it will return the numeric IP for it
139
140Commands that begin with // are evaluated as tcl expressions.  For example:
141
142	//say My home dir is $::env(HOME)
143	//say 582 divided by 17 is [expr 582/17.0]
144
145Will be evaluated to, for example:
146
147	/say My home dir is /home/patearl
148	/say 582 divided by 17 is 34.2352941176
149
150And will send the message "My home dir is /home/patearl" to the current
151channel, query, or chat session.  For the calcuation example, you could just
152use /calc 582/17.0 to acheive similar results.
153
154Try hitting F1 for commands not listed here.
155
156(Really) Partial list of IRCII commands supported as well as any known
157differences from IRCII:
158(For more information see http://www.dal.net/services/helpserv/index.html)
159
160/abort - Simply exits.
161/admin
162/away
163/beep
164/bye
165/cd
166/channel
167
168
169POPUPS
170
171See the popup command below for how to implement popups.  The popups that come
172with QuIRC are all in popups.tcl and it is suggested that you place your own
173popups in userpopups.tcl which will be loaded by popups.tcl.  That way when you
174upgrade QuIRC it won't be a concern to merge the popup changes.
175
176
177ALIAS SYSTEM
178
179There are two types of aliases, server specific aliases and global aliases.
180The server specific aliases run within the namespace of the script that they
181are loaded in.  The global aliases run within the global namespace.  The server
182specific aliases are run before the global ones.  Any / command entered that
183does not have a corresponding alias will be sent to the server as is.  If an
184alias returns 1, no other aliases of the same name (in different scripts or in
185the global namespace) will be executed.  Do not put more than one alias of
186the same name in the same script file.
187
188Example:
189
190proc alias_test { arg } {
191    quote "PRIVMSG [mynick] :$arg"
192}
193
194OR
195
196alias test {
197    quote "PRIVMSG [mynick] :$arg"
198}
199
200When run with:
201
202	/test Hello there.
203
204would message you with the message "Hello there."
205
206
207EVENT SYSTEM
208
209There are two types of events, global events and server specific events.
210
211Global Events
212
213There can only be one global event of any type.  If a script is loaded that has
214that particular event in it, any older one will be replaced.
215
216The return values of global events are ignored unless otherwise indicated.
217
218proc event_windowchanged { oldpathname oldname oldserver oldindex pathname name server index } { script }
219	This event is called at the start of the totop proc and is passed the
220        pathnames, names, server indexes, and windowlist indexes of the old and
221        new windows.
222
223proc event_echo { message pathname new } { script }
224	This event is called everytime text is to be echoed.  You must return
225	the text that you actually want to be echoed.  If you return nothing,
226	it will not echo anything.  You can use echotags from within this proc
227	for very customized echoing.  The new parameter is used to indicate
228	whether or not the window list should be activated when the text is
229	printed.
230
231proc event_enter { message pathname } { script }
232	Is called (by parseentry) whenever data is entered normally in an entry
233	box.  Whatever you return is what is considered to be the actual input.
234	This can be used to do replacements on various data in the input or to
235	cancel certain input by returning "".  If you like, you may modify the
236        entry box while inside of this event.
237
238Server Specific Events
239
240The event system is composed of the following:
241
242proc event_raw { prefix command args } { script }
243proc event_??? { prefix args } { script }
244proc event_unparsednumeric { prefix command args } { script }
245proc event_unparsed { prefix command args } { script }
246
247??? is the event (in lowercase) as sent by the server.  For example:
248	privmsg or 301
249$prefix corresponds to the prefix as found in the IRC RFC (doc/rfc1459.txt).
250	It is often the originator of the event.  This is usually either a
251	nick!user@host or a server ip.
252$command is the actual command produced (exactly as returned by the server).
253$args is a TCL list of any arguments following the command part of the IRC
254	reply from the server.  The 0th argument often contains the target
255	of the event.  See the RFC for details.  The individual arguments of
256        $args can be accessed like so: [lindex $args #], where # is any
257        integer between 0 and up to but not including [llength $args].
258
259Example:
260
261proc event_376 { prefix args } {
262    quote "JOIN #mychannel"
263}
264
265The above would send the command to join #mychannel upon reception of the
266end of the MOTD from the server.
267
268Order of Event Execution:
269	event_raw_unparsed
270	event_raw
271	Specific Events (i.e. event_privmsg or event_301)
272	event_mymode(+/-)?
273	event_mode(+/-)?
274        Internal Events
275	event_unparsednumeric
276		If any previous events return 2, this event will not occur.
277	event_unparsed
278		If any previous events return 2, this event will not occur.
279
280If the message is a server numeric and is not one of the known invalid
281responses, mynick is set after event_raw_unparsed.
282
283Return Values of Events:
284
285	1 - Stop the same event (i.e. event_raw or event_privmsg) from occuring
286            in any other scripts after this point.  Scripts that are loaded
287            later are executed first, so the last script you load can override
288            previously loaded scripts.
289	2 - Stop output to the text windows from occuring.
290	    (event_unparsednumeric and event_unparsed will not be called and
291            any output internal to QuIRC will not be produced)
292	4 - Special return for event_raw and event_mode; stops the specific
293	    events from being checked. (i.e. Events like event_privmsg and
294            event_mode+o will not be called.)  This now applies to
295	    event_privmsg (event_ctcp, event_text) and event_notice
296	    (event_noticetext, event_ctcpreply).
297
298As an example, "return 7" would stop everything past that point.
299
300IRC Message Events:
301	proc event_raw_unparsed { data } { script }
302	proc event_raw { prefix command args } { script }
303	proc event_mode { prefix args } { script }
304	proc event_mymode+? { prefix args } { script }
305		? is any letter of the alphabet.  Gets executed when a
306                non-channel mode event occurs (ie. Personal mode change)
307	proc event_mymode-? { prefix args } { script }
308		Same as mymode only the removal of the mode instead of
309	        the addition.
310	proc event_mode+v { prefix target parameter } { script }
311	proc event_mode-v { prefix target parameter } { script }
312	proc event_mode+b { prefix target parameter } { script }
313	proc event_mode-b { prefix target parameter } { script }
314	proc event_mode+l { prefix target parameter } { script }
315	proc event_mode+k { prefix target parameter } { script }
316	proc event_mode-k { prefix target parameter } { script }
317	proc event_mode+o { prefix target parameter } { script }
318	proc event_mode-o { prefix target parameter } { script }
319	proc event_mode+? { prefix target } { script }
320		Channel modes that aren't covered above.
321	proc event_mode-? { prefix target } { script }
322	proc event_text { prefix target text } { script }
323		This event occurs when a privmsg, with some portion of it not
324		being CTCP, occurs.  text is the data in the privmsg with the
325		CTCP messages removed.
326	proc event_ctcp { prefix target ctcps } { script }
327		This occurs when a privmsg occurs with CTCP data.  ctcps is a
328		list of data pairs.  In each pair, the first item is the ctcp
329		name, the second item is the extra data if any.
330	proc event_noticetext { prefix target text } { script }
331	proc event_ctcpreply { prefix target ctcps } { script }
332		These two events are the equivalent of event_text and
333		event_ctcp only they are used for the replies instead of the
334		queries.
335
336Other Events:
337        proc event_unload {} { script }
338	proc event_disconnect {} { script }
339	proc event_connect () { script }
340		-Happens immediately after socket is connected before any data
341		 is sent.
342
343
344GENERAL SCRIPTING INFORMATION
345
346Each script is loaded into its own namespace.  To access script-wide variables
347you should use [set ::[index]::scriptname::variablename], otherwise standard
348namespace conventions apply.  See the tcl man page for namespace for details.
349
350Each server has its own namespace, given by ::<serveridx>.  Scripts are loaded
351under that namespace as ::<serveridx>::<script_name>, where script_name is
352the first part of the script file name that contains only alphanumeric
353characters.
354
355The way QuIRC determines which server a given command originated from is that
356it checks the name of the proc it was called from.  For example:
357
358	proc ::4::some_script::some_procname {
359	    /msg [mynick] hi
360        }
361
362will run the /msg command as if it was typed in server 4.  As another example:
363
364	proc some_procname {
365	    quote "bleh"
366        }
367
368will not know which server to use the quote command on because it wasn't run
369from a proc within any server's namespace.  In this case, only global commands
370or aliases are allowed.
371
372There are various types of commands which can be run:
373	Regular Tcl Commands
374	Templated Server Tcl Commands
375        Global Aliases
376        Server Specific Aliases
377        Server Commands
378
379Templated Server Tcl Commands are used in the following manner.  First a proc
380is created in the ::template namespace as follows:
381
382	proc ::template::procname { serverindex args } {
383        }
384
385After that, whenever procname is executed within a server's namespace (as shown
386previously), ::template::procname will be invoked and it will be passed the
387server's index as well as the arguments that were given.
388
389Global Aliases are aliases that are created in the global namespace and are
390run like this:
391
392	/aliasname regular tcl args
393
394Note that unlike aliases typed in at the command line, the arguments given must
395be valid TCL.
396
397Server Specific Aliases are like Global Aliases, but run in the namespace of
398the server that they were created in.
399
400Server Commands have the following format:
401
402	/command args
403
404Basically anything that isn't handled by an alias will be sent to the server as
405"command args".
406
407To run a command on another server, run:
408
409	evalserver <serveridx> <script>
410or:
411
412	namespace eval ::<serveridx> <script>
413
414
415If you need to escape a string to avoid problems with characters like ", {, $,
416[, etc, using pure TCL, I suggest the following:
417
418	[string range [list "\x7d$var"] 2 end]
419
420This is the equivalent to QuIRC's:
421
422	[escape $var]
423
424
425In QuIRC, if a disconnect is detected, it will check if the auto_reconnect
426variable is set.  If it is set, it will then check to see if the connect was
427on purpose, in which case the ::[index]::intentional_disconnect variable will
428be set to 1.  If it was on purpose, no reconnect will occur, otherwise QuIRC
429will attempt reconnection with small delays.  ::template::condis is the proc
430
431
432QuIRC'S START-UP PROCESS
433
434If you would like to see the techical details as to how QuIRC starts, you will
435want to examine the bottom of quirc.cc from the source.  It is well commented
436and you shouldn't have many problems seeing what happens.
437
438
439UI PROGRAMMING INFORMATION
440
441A lot of the UI is handled through qwidgets.tcl.  See that file for info.
442
443* QEntryBox
444
445The QEntryBox widget is used to provide a quick dialog box for entering in
446information.  Here is an example of it in use in a popup:
447
448popup add item channeltext "" "Set Keyword (+k)" {
449    QEntryBox::create "Channel Keyword" "Enter new keyword for channel:" "::template::quote [index] \"MODE \[channel] +k %g\""
450}
451
452The syntax is:
453    QEntryBox::create <window title> <message> <command>
454
455Any occurence of %g in the command will be replaced with the results of the
456message box.  Note also that the command is run in the global namespace, so
457if you need it to send data to a server or something you would need to
458specify the server like I did in the example.  You could also use some
459form of the tcl namespace command to do that.
460
461QEntryBox returns the the name of the toplevel window it created.  You might
462use it with tkwait to make the dialog box modal.
463
464* QPasswordBox
465
466Identical to QEntryBox, only it uses *'s in the box to hide what you're typing.
467
468* QColorChooser
469
470To pop up a little color chooser window that lets users pick one of the current
47116 colors, run:
472
473	QColorChooser command
474
475The command will run like so:
476
477	command <color number (0-15)>
478
479If the window is just closed, the command will not be run.  If you want to
480modify the window after you run the QColorChooser command, the window is called
481.colorchooser.  Only one should be run at a time.
482
483An example of use would be:
484
485	QColorChooser {set ::default_foreground}
486
487
488ISSUES TO BE AWARE OF
489
490The ANSI system does not handle cases where there is = or " in the given code.
491This does not affect the operation for normal IRC type ANSI, but could cause
492display of parts of the code if used.  If you encounter this, let me know and
493I will do something about it, otherwise it will stay this way.
494
495In order to stop the automatic scrolling in a window due to new text being
496inserted, simply move the scrollbar up so it is not at the very bottom.
497
498
499Enjoy!  Patrick Earl (Hynato on irc.dal.net, quirc@patearl.net)
500