Ok so, This isn't finished...and I'm sure there are coding mistakes cause I wrote it. But I was thinking about what would be a good way to do hundreds of responses. If for some reason you wanted to.

Code:
on *:text:!*:#: {
  if ($hfind($+(responses.,$chan), $1)) { 
    var %chan $chan
    messages $1 $hfind($+(responses.,$chan), $1) 
  }
}
on *:join:#: {
  if ($nick == $me) {
    hmake $+(responses.,$chan)
    hload $+(responses.,$chan) responses.ini
    .timer.messagequeue 0 1 messages2 $chan
  }
}
;example response !command cooldown .msg %chan message
alias messages {
  if (!$hget($+(messages.,%chan))) { hmake $+(messages.,%chan) }
  if ($3 == msg || $3 == .msg) {
    if ($($+(%,sentmessage.,%chan,$1),2) > 0) {          
      if ($hfind($+(messages.,%chan), $1)) { return failresponse $1 }
      else { 
        hadd $+(messages.,%chan) $3- 
        set $+(%,cooldowns.,%chan) $addtok($+(%,cooldowns.,%chan), $1, 32)
      }
    }
    else { 
      .msg $2- 
      inc $sentmessage. $+ %chan $+ $1 $2
    }
  }
}
alias messagesqueue {
  if ($hget($+(messages.,$1), 0) > 0) {
    var %t $numtok($+(%,cooldowns.,$1), 32)
    var %i 1
    while (%i < %t) {
      if ($($+(%,sentmessage.,$1,$gettok($+(%,cooldowns.,$1),%i,32)),2) > 0) {
        dec $sentmessage. $+ $2 $+ $gettok($+(%,cooldowns.,$1),%i,32)
      }
      else {
        var %chan $1
        tokenize $hget($+(messages.,$1), 1)
        .msg $4- 
        set $+(%,cooldowns.,%chan) $deltok($+(%,cooldowns.,%chan),%i,32)
        return
      }
    }
  }
}


So my idea was just make an ini and format it like
!command1 cooldown msg %chan message
and now that I think about it it seems like you could go back and cut out a chunk of that and simply
!command1 cooldown message

But I wrote the above snippet with the first format in mind. I think what I wrote would work right up until the failed response part..thats where I got bored. I might work on this some more later but I thought I'd post it just as an idea. Its also possible this is a dumb idea smile

Last edited by Belhifet; 14/12/14 04:49 PM.