I'm making a kill-count script for a deathmatch game. This game is relayed from the server to a channel. I want the triggers to work if it is in the first or second position because I want this to able to be triggered by the relay bot so it can send the data back to the server. I'm puzzled as to why the following only partially works:

on *:text:!*:#:{
  if (!stats isin $strip($1-2)) {
    if ($2 == !stats) var %nick = $iif($3,$3,$1), %ingame = 1
    elseif ($1 == !stats) var %nick $iif($2,$2,$nick)
    dmsg %nick has killed $calc($hget(playerkills,%nick)) people without dying. 
  elseif (!deaths isin $strip($1-2)) {
    if ($1 == !deaths) var %nick $iif($2,$2,$nick)
    elseif ($2 == !deaths) var %nick $iif($3,$3,$1), %ingame 1
    dmsg %nick has died $calc($hget(playerdeaths,%nick)) times.
alias dmsg { msg $chan $iif(%ingame,!fds msg) $1- )

The problem is that the script triggers on !stats and !deaths but not if either of them is $2. It also don't work if the line is colored. How do I fix this?

Last edited by Tzar469; 20/02/08 05:34 AM.