mIRC Home    About    Download    Register    News    Help

Print Thread
[TWITCH] Help with quote bot #257617 28/04/16 01:31 AM
Joined: Apr 2015
Posts: 15
C
Computerwiz160 Offline OP
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-) 
      }
    }
  }
}

Re: [TWITCH] Help with quote bot [Re: Computerwiz160] #257632 30/04/16 03:39 AM
Joined: Sep 2014
Posts: 259
S
Sakana Offline
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