mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Apr 2015
Posts: 15
C
Pikka bird
OP Offline
Pikka bird
C
Joined: Apr 2015
Posts: 15
Okay, so I have a quote bot and I recently added (or tried to add) a timer for the commands so it just doesn't respond to everyone who types in the command and gets the bot banned. Now the flood DOES work for the !saywhat command but I cannot get it to work for the !addquote command. Can someone please take a look and see what I did wrong?

Code:
on *:LOGON:*:{
  raw CAP REQ :twitch.tv/membership
}

on *:TEXT:*:#: {
  if (!%saywhat) {
    set -u5 %saywhat 1
  if ($1 == !saywhat) {
    if ($2 == $null) { msg $chan $read(Quotes.txt, n) }
    ELSE {
      var %i 1
      while (%i <= $lines(Quotes.txt)) {
        if ($2 isin $read(Quotes.txt, %i)) {
          write tempfile.tmp $read(Quotes.txt, %i)
        }
        inc %i
      }
      msg $chan $read(tempfile.tmp)
      .remove tempfile.tmp
      }
    }
  }
}
on *:TEXT:*:#: {
  if (!%addquote) {
    set -u5 %addquote 1
  %nicks = spyker_z_ex computerwiz160 missabirose
  var %check = $istok(%nicks,$nick,32)
  if ($1 == !addquote) { 
    if ($nick isop $chan) || (%check == $true) { 
      write Quotes.txt $+($2-)  
      msg $chan Quote Added : $+($2-) 
      }
    }
  }
}

Joined: Sep 2014
Posts: 259
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Sep 2014
Posts: 259
If you have two of this in the same file:

on *:TEXT:*:#:

Only the first one will trigger, so put the other one in another file or change it to on *:TEXT:!addquote:#: or whatever


Link Copied to Clipboard