Alright, you really shouldn't bother with typing !quote, in a window and then doing the quote.

You can use an alias called "aquote" instead.

/aquote <channel or nick> would message the channel or nick with the quote, if you specify neither channel or nick, it will simply "echo" the quote to your window (so you're the only person that reads it).

Code:
alias aquote { $iif($1,msg $1,echo -ag) $read(quote.txt) }


Now, if you're still not satisfied, and absolutely MUST message the channel or nick with "!quote."

Code:
alias aquote { $iif($1,msg $1,echo -ag) $read(quote.txt) }
on *:signal:givequote:{ aquote $1 }
on *:input:*:{ 
  if ($1- == !quote &amp;&amp; $window($active).type isin query.channel) {
    .signal givequote $active
  } 
}
on *:text:!quote:*:{ 
  if (!%quote.flood.prot. [ $+ [ $wildsite ] ]) {
    aquote $iif($chan,$chan,$nick)
    set -z %quote.flood.prot. [ $+ [ $wildsite ] ] 10 
  }
}


/aquote <#channel or nick>; Messages the quote to a chan or nick.
/aquote; Echo's the quote to your active window.
!quote; in a query or channel window, will message the quote after.

Someone typing "!quote" in channel or PM will send them a quote. (I added an additional 10 second delay for this, just as a safety precaution)

Note: In case someone attempts to correct my script, there is a reason I'm using a signal and not a timer. 1.) double evaluations can lead to problems. (yes this can be avoided, but why bother when you can use a signal), 2.) We want the quote to be sent after !quote.

That second reason can be done with haltdef, and messaging both !quote and the quote to the channel, but here's the thing: Doing that may lead to problems with -other- on input scripts (for example, themes), so we're staying away from that problem by doing it this way.

Enjoy.

Edit: Oops, had a [./quote.] instead of a [./code.]

Last edited by Rand; 09/08/06 12:49 AM.