IRC Bot Phrase Counter Help

Hey there folks, after browsing around some msl forums I made something that somewhat works

on *:text:*:#: {
  if ($1 == vac) { inc %vac.times }
  elseif ($1 == >vaccount) { msg $chan VAC has been been spammed %vac.times times in the last %pers.times seconds, or more precisely $calc(%vac.times / %pers.times) VACs/second. | .timerVac off | %vac.times = 0 | %pers.times = 0  }
  elseif ($1 == >vacstart) { %vac.times = 0 | %pers.times = 0 | .timerVac 0 1 inc %pers.times | .msg $chan VAC/second count started, type >vaccount for results $+ . }
  elseif ($1 == >debug) msg $chan vac: %vac.times pers: %pers.times $+ .
}

Basically the way this works is that whenever “vac” is said in chat it is always incrementing the %vac.times variable by one. This is kind of contrary to what I originally asked, but I used a work around later. Whenever >vacstart is said it resets the %vac.times variable as well as a new %pers.times variable. It also begins a new timer that after every 1 second increments the %pers.times variable, which is what keeps track of the seconds.

When the count is finished, a user types >vaccount and it displays the raw data of numer of times VAC was said, number of seconds that had passed, then divides those values together to show the VAC/second count. It also ends the timer and resets the variables!

Thanks for your guys suggestions, glad I got this working.