mIRC Homepage
Whenever you get a NickServ or a ChanServ for help, it gives you a list of their commands. Those commands are indented. How?

I've run a script trying to find a TAB character in there, or multiple null characters and I can't find anything:
Code:
 
[00:21] -NickServ- /msg NickServ HELP command.

[00:21] -NickServ-  

[00:21] -NickServ-     REGISTER   Register a nickname

[00:21] -NickServ-     CONFIRM    Confirm a nickserv auth code

[00:21] -NickServ-     RESEND     Resend a nickserv auth code

[00:21] -NickServ-     GROUP      Join a group

[00:21] -NickServ-     GLIST      Lists all nicknames in your group
NickServ/ChanServ are not written using mIRC's scripting language so they can therefore send messages with multiple spaces.

You can even send a message with multiple spaces from the editbox. Try it. You just can't send messages like that using /commands.
How is ChanServ doing it? What I'm looking to do is "tell" when a message is indented (to intrepret it as a command). There aren't any multiple spaces so far as I can tell and there's no indent character either.

To elaborate a little on the problem, when I "read" each of those indented lines, I'm seeing no spaces at all before those words.

**UPDATE: PROBLEM SOLVED. This was tough but here's what's happening. When you go to grab the text that ChanServ sends you, what do you think of? $1-

Trouble is, what does $1- start with? It starts with $1. And what is $1? It's the first space-delimited parameter, meaning TEXT. You need more than text, you need the whole thing.

The solution is to use $rawmsg, not $1-, and pull the text out of that field.

I found between 2 and 4 $null characters (or ascii-32 characters) depending on which NickServ/ChanServ you're talking to.
You can see what actually comes from the IRC server by typing /debug @debug and looking what appears in the @debug window when an event you're interested in triggers.

A $null character does not exist and certainly cannot be used to indent text - it is nothing. They use ASCII 32 to indent the text.

A better way of realising when the text is a command would be to set a variable whenever you send the message to chan/nickserve that lists the commands.

For example:

Code:
alias listcommands { 
  if ($status != connected) { return }
  set -u10 %chanservecommands $true
  msg chanserv help
}
on *:notice:*:?:{
  if ($nick == chanserv) && (%chanservecommands) && ($1 isupper) { echo -a command = $1, purpose = $2- }
}


That said, yes, $rawmsg is the best way to retrieve text with spaces intact smile
Your observation about the commands being capitalized is fantastic. For instance, on WebChat (using ConferenceRoom), the commands aren't indented but we'd still be able to filter using which words are capitalized.
© mIRC Discussion Forums