I'm in the process of making my own quote storage system.

I'm not getting any errors, fortunately, but somehow it's sending the first word of the string as a command.

This happens only when it detects the quote is already in the file but not when the text is being added to the file. This has me totally stumped.

Here's the code:

Code:
on *:TEXT:!addquote*:*: {
  if ($nick ison $chan) {
    if ($2 == $null) {
      msg $chan Command Usage: !addquote quote-message (Example: !addquote My hand is sore from overuse.)
      msg $chan Do not add quotation marks when adding text, they will be added automatically.
    }
    if ($2 != $null) {
      $read(C:\lloydbot_data\quotes.txt, nrw, * $+ $2- $+ *)
      if ($readn == 0) {
        write C:\lloydbot_data\quotes.txt $2-
        msg $chan Quote: $qt($2-) has been added to the database.
      }
      elseif ($readn > 0) {
        msg $chan That quote is already in the database.
      }
    }
  }
}


Edit: I removed both of the "$+" from the $read command and it's still happening. I'm obviously mis-using the flags somehow. I just need some help figuring out why it's sending the first word of the quote string as a command.

Last edited by Lloyd_B; 15/05/15 10:16 AM.

Lloyd