RobinM commented on a Page, Simple Qoute Bot  -  Jun 30, 2011

This should actually be posted in the forum I think but...
Here's might what you're looking for:
Both searches for a quote with the specified query. The first line with the wilcardmatch of your query will be echoed in your active window or messaged to the channel.
Alias version:

alias searchquote {
  if $1 {
    if $read(Talk.txt,w, * [ $+ [ $1- ] $+ ] *) {
      echo -a Result found:
      echo -a $v1
    }
    else {
      echo -a No result were found.
    }
  }
  else {
    echo -a You need to specify a something to search for.
  }
}

Bot version:

on *:text:!searchquote*:#:{
  if $2 {
    if $read(Talk.txt,w, * [ $+ [ $2- ] $+ ] *) {
      msg $chan Result found:
      msg $chan $v1
    }
    else {
      msg $chan No result were found.
    }
  }
  else {
    msg $chan You need to specify a something to search for.
  }
}

Edit: Changed the $read part in echo/msg to $v1. (facepalm)

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.