Username:
Password:
  Home About Us Articles Rules Script Library FAQ Help
Not logged in (register
AMPQuote for mIRC vmIRC 6.16

Last Modified: Dec 13 10:15pm (r2)

This is just what I use at the moment. It is not a complete script. I will soon add aliases that can add quotes and other such useful things so that you don't have to type /run Quotes.txt every time you wanna open the file and add a new quote.

Feel free, ofcourse, to change the stuff that says »» AMPQuotes »» to something more befitting your own style.
alias prequote { 
  if ($1 == $null) { echo -a »» AMPQuotes »» $read(quotes.txt) 
  } 
  elseif ($1 isnum) { echo -a »» AMPQuotes »» $read(quotes.txt, $1) 
  }
  elseif ($$1 !isnum) {
    unset %matches
    var %temp = $read(quotes.txt, w, * $+ $1- $+ *)
    if ($readn == 0) { echo -a Quote containing ' $+ $1- $+ ' not found. }
    elseif ($readn != 0) { 
      :search
      %matches = %matches $+ $readn
      %splace = $readn + 1
      var %temp = $read(quotes.txt, w, * $+ $1- $+ *,%splace)
      if ($readn != 0) {
        %matches = %matches $+ .
        goto search
      }
      elseif ($readn == 0) { /echo -a »» AMPQuotes »» $read(quotes.txt,$gettok(%matches,$rand(1,$numtok(%matches,46)),46)) 
      }
    }
  }
}

alias quote { 
  if ($1 == $null) { /msg $active »» AMPQuotes »» $read(quotes.txt) 
  } 
  elseif ($1 isnum) { /msg $active »» AMPQuotes »» $read(quotes.txt, $1) 
  }
  elseif ($$1 !isnum) {
    unset %matches
    var %temp = $read(quotes.txt, w, * $+ $1- $+ *)
    if ($readn == 0) { echo Quote containing ' $+ $1- $+ ' not found. }
    elseif ($readn != 0) { 
      :search
      %matches = %matches $+ $readn
      %splace = $readn + 1
      var %temp = $read(quotes.txt, w, * $+ $1- $+ *,%splace)
      if ($readn != 0) {
        %matches = %matches $+ .
        goto search
      }
      elseif ($readn == 0) { /msg $chan »» AMPQuotes »» $read(quotes.txt,$gettok(%matches,$rand(1,$numtok(%matches,46)),46)) 
      }
    }
  }
}

on *:TEXT:!quote*:#: { 
  if ($2 == $null) { /msg $chan »» AMPQuotes »» $read(quotes.txt) 
  } 
  elseif ($2 isnum) {
    if ($2 > $lines(quotes.txt) ) { /msg $chan »» AMPQuotes »» Quote $2 does not exist yet.
    }
    elseif ($2 <= $lines(quotes.txt) ) { /msg $chan »» AMPQuotes »» $read(quotes.txt, $2) 
    } 
  }
  elseif ($$2 !isnum) {
    unset %matches
    var %temp = $read(quotes.txt, w, * $+ $2- $+ *)
    if ($readn == 0) { msg $chan »» AMPQuotes »» Quote containing ' $+ $2- $+ ' not found. }
    elseif ($readn != 0) { 
      :search
      %matches = %matches $+ $readn
      %splace = $readn + 1
      var %temp = $read(quotes.txt, w, * $+ $2- $+ *,%splace)
      if ($readn != 0) {
        %matches = %matches $+ .
        goto search
      }
      elseif ($readn == 0) { /msg $chan »» AMPQuotes »» $read(quotes.txt,$gettok(%matches,$rand(1,$numtok(%matches,46)),46)) 
      }
    }
  } 
}

Comments
Franimus
Jan 03 10:55pm
And what makes this better than the other 20 quote scripts on this site?
Orionis
Feb 23 7:40am
I dunno what makes it better. What makes it different is that when you use the search function, it just displays a random match rather than a list of matches.
 
All content Copyright © 2004 - 2008 UtoNet IRC Network
UtoNet is sponsored and hosted by Datinix Systems