; The /map command replaces (temporarily) the /links command so we can reroute the data.
;
alias map {
;
; If @Links is already open, close it
;
if ($window(@Links)) window -c @Links
;
; Create the @Links window
;
window -k @Links
;
; Title it to show the network the servers are on
;
titlebar @Links on $network
;
; Turn on the group that will catch the /links
;
.enable #MyScript.Links
;
; Send the /links command to the server without letting mIRC process the command.
;
.raw links
}
#MyScript.Links off
;
; Numeric 364 captures the actual server data from the /links command.
;
raw 364:*:{
;
; See if we're asking for a /map rather than a /links
;
if ($window(@Links)) {
;
; Since we will receive the list of links backwards, we will have to insert each line at the top of the
; window (line 1), thus: /iline @Links 1 ... the rest of this command line is just adding the formatting
; to make is basically resemble a normal mIRC /LINKS display.
; - colorCode $+ $calc(numberOfHops + 1) gives us the color...the + 1 is so we don't use color 0
; for the server we're connected to (0 hops)
; - $str(nonBreakingSpace,numberOfHops) indents things nicely based on hopcount
; - $2 is the server name ($3 is the server it's connected to - not used in this example)
; - [numberOfHops hops] ($4 is numberOfHops)
; - $5- is the server description.
;
iline @Links 1 $+($chr(3),$calc($4 + 1),$str($chr(160),$4),$2 [,$4 hops,],$chr(15)) $5-
;
; Now just halt the default text.
;
halt
}
}
;
; Numeric 365 is the "End of /LINKS list." message, letting us know no more data is coming.
;
raw 365:*:{
;
; Make sure we're supposed to be handling this event.
;
if ($window(@Links)) {
;
; Save the custom @Links window to a file.
;
.savebuf @Links $mircdirTEMP\ServLinks.TXT
;
; Turn off the group so a normal /links will work again.
;
.disable #MyScript.Links
;
; Now just halt the default text.
;
halt
}
}
#MyScript.Links end