depends...

example

if /whois is performed on nick like....

/whois nickc

it usually shows up something like this...

dirty100 is !hostmask!* wtf
dirty100 is a registered nick
dirty100 on &#chaotic
dirty100 using $networkhere $servermsg
dirty100 is a Services Administrator
dirty100 is available for help.
dirty100 has been idle 1min 56secs, signed on Mon Sep 19 02:53:09
dirty100 End of /WHOIS list.

so we need a raw event because what we did here is before the /whois event on dirty100 we did /debug @raw then when i performed the whois i saw that RAW 307 = the registered nick area so therefore in my remotes i would put this

RAW 307:*: {
if (registered isin $1-) { echo -a W00t there it is , W00t there it is }
}

so now next time i typed /whois dirty100 my script replyed W00t there it is , W00t there it is in a echo

so now the answer to your question well if you didnt know already it does a little something like this (ONLY EXAMPLE)

we have to create a script to perform a certain command now ill use a in channel trigger for a bot or something

on *:TEXT:*:#: {
if $1 == !op {
%op.chan = $chan
%op.nick = $2
whois %op.nick
}
}

RAW 307:*: {
if (registered isin $1-) { mode %op.chan +o %op.nick }
else { halt }
}

now when someone in a channel types !op nickname the script records the nickname + the channel then performs a whois, now the raw event scans 307 to see if registered is there in the whole line is so then mode $chan +o $nick is performed else script Halt's