mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: May 2006
Posts: 98
L
Lloyd_B Offline OP
Babel fish
OP Offline
Babel fish
L
Joined: May 2006
Posts: 98
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
Joined: May 2015
Posts: 249
Fjord artisan
Offline
Fjord artisan
Joined: May 2015
Posts: 249
probably "noop $read(..." will fix it


Dont give a fish - teach to fish!
Joined: May 2006
Posts: 98
L
Lloyd_B Offline OP
Babel fish
OP Offline
Babel fish
L
Joined: May 2006
Posts: 98
That fixed it. Thanks.

I have a lot of learning to do obviously. It's just taking time.

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

Lloyd

Link Copied to Clipboard