mIRC Homepage
Posted By: Computerwiz160 [TWITCH] Help with quote bot - 28/04/16 01:31 AM
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-) 
      }
    }
  }
}
Posted By: Sakana Re: [TWITCH] Help with quote bot - 30/04/16 03:39 AM
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
© mIRC Discussion Forums