When the result does come through, it triggers this event:

on *:dns:{; Cycles through all returned results; sometimes there are more than one

var %i = 1

while $dns(%i) {

; Only if the temporary variable was set (ie. if you used /nickinfo)

if (%waitfordns. [ $+ [ $dns(%i).nick ] ]) {

; Sends data from the DNS lookup and some additional info to the chan/query you specified in /nickinfo

msg $ifmatch $+(,Nick:,) $dns(%i).nick $+(,Address:,) $dns(%i).addr $+(,IP:,) $dns(%i).ip ( $+ $+(,My Time:,) $time $+(,My Email:,) $emailaddr $+ )$+ )

; Unsets the temporary variable; even though it unsets itself after 5secs, it never hurts to clean up.

unset %waitfordns. [ $+ [ $dns(%i).nick ] ]

}

inc %i

}

}

This is where our temporary variable comes in handy. When we match up the /dns target with existing variables in existence, we essentially determine whether or not this /dns call originated from /nickinfo. It's not a 100% tied link but it's reasonable enough to assume you wouldn't /dns the same person within the same fraction of a second through multiple means.

With that variable matched, we use its value – the destination window for results – and send the information there.

In practice, you can do whatever you like with it at that point.

Note: As with all my mIRCscript posts, you should copy the code into mIRC's script editor and press the "{}" button to auto-indent it. It will make it far more readable. Posting on the web makes it difficult to present the code as it really should appear. Some lines may also have auto-wrapped in your web browser, which won't be a problem once in the script editor.