WATCH [CSLl] [-nick] [+nick] Manages your WATCH list (equivalent to mIRC's Notify List).
WATCH C clears your watch list.
WATCH S generates a status report telling you how many entries you have, how many people have your current nick on their Notify List and the list of nicks you have in your list.
WATCH L generates a list (one nick per line) of all nicks in your WATCH list, both online and offline.
WATCH l generates a list (one nick per line) of all the nicks in your WATCH list that are currently online.
WATCH -nick removes a nick from your WATCH list.
WATCH +nick adds a nick to your WATCH list.
On a network that supports WATCH, /NICK changes and /QUITs are reported to everyone on the watched list for that nick. This happens server-side and requires no client intervention. When you first log on to a network that supports WATCH, your entire Notify list is set as your WATCH list after clearing it (
/WATCH C), right after the MOTD has been received.
WATCH C +NotifyNick1 +NotifyNick2 +NotifyNick3 +NotifyNick4 +NotifyNick5 +NotifyNick6to which the server responds by sending you a
/WATCH L S (list + status report), a separate line for each nick you've inserted into your WATCH list, 604 if they're online and 605 if they're not.
[color:#006600]; WATCH L
;
; Who's online
; -servername- 604 Hammer NotifyNick1 userid host tsinfo :is online
;[/color]
raw 604:*: echo $color(notify) -sbflirt * $2 $+($chr(40),$3,@,$4,$chr(41)) is on IRC | halt
[color:#006600];
; Who's offline
; -servername- 605 Hammer NotifyNick2 * * tsinfo :is offline
;[/color]
raw 605:*: halt
[color:#006600]; WATCH S
;
; How many entries you have and how many people are watching your current nick
; -server- 603 Hammer :You have 6 and are on 372 WATCH entries
;[/color]
raw 603:*: echo $color(notify) -sbflirt * $2- | halt
[color:#006600];
; Your entire watch list (separated by spaces in reverse order of entry)
;[/color]
raw 606:*: echo $color(notify) -sbflirt * $2- | halt
[color:#006600];
; End of /WATCH list.
;[/color]
raw 607:*: echo $color(notify) -sbflirt * $2- | halt
Any time one of the nicks on your list shows up (either by switching into a nick you're watching or by logging on using that nick), the server sends you a 600 numeric. When they log off (
/NICK or
/QUIT), the server sends you a 601 numeric.
[color:#006600];
; Who's online
; -servername- 600 Hammer NotifyNick2 userid host tsinfo :logged online
;[/color]
raw 600:*: echo $color(notify) -abflirt * $2 $+($chr(40),$3,@,$4,$chr(41)) is on IRC | halt
[color:#006600];
; Who's offline
; -servername- 601 Hammer NotifyNick2 userid host tsinfo :logged offline
;[/color]
raw 601:*: echo $color(notify) -abflirt * $2 $+($chr(40),$3,@,$4,$chr(41)) has left IRC | halt
TSInfo stands for TimeStamp Information - when something happened, such as connecting to the server, switching nicks or quitting.
If your server did not support WATCH, mIRC would use ISON instead. When it uses ISON, it polls the server approximately every 40 seconds to see if any of your Notify nicks have changed status. Nothing is stored on the server, as in the WATCH list. mIRC simply issues ISON command followed by the list of nicks you wish to check on (your Notify List).
ISON Nick1 [Nick2 ... NickN] Queries the server to see which of the listed nicks are online.
ISON NotifyNick1 NotifyNick2 NotifyNick3 NotifyNick4 NotifyNick5 NotifyNick6to which the server responds with a 303 numeric telling you which of the nicks you specified are online.
[color:#006600];
; Who's online
; - servername- 303 Hammer :NotifyNick1 NotifyNick4 NotifyNick5 notifynick6
;[/color]
raw 303:*:{
var %i = 1
while ($gettok($2-,%i,32)) {
echo $color(notify) -sbflirt * $ifmatch ison IRC
inc %i
}
halt
}
Of course, you'd have to store their current status so you didn't repeat yourself; mIRC does this internally and only shows those nicks whose statuses have changed.
mIRC also has settings you can check through script to determine whether to echo it to status, active or just update the Notify List window. In the preceeding simple examples, I have just used echo -s to echo it to the Status Window. In a more user-friendly script, you would have to check the user's settings to make your script follow their client setup choices and behave accordingly. However, since your question didn't specifically mention scripting anything in particular, the script samples were provided to clarify exactly what was happening.