dude i dont know, whats the value for %p but dont need to unset it all time
this is a simple edit, of course, if you put a value for %p
like a specific channel, var %p channel, dont need to unset it
on *:ctcpreply:*ping*: {
var %tik $ctime - $2, %p #channel
var % $+ $iif(%n == $me,n bot,n $nick)
var % $+ $iif(%tik <= 0,tik 0)
msg %p %n $+ 's ping: $duration(%tik,1) $replacex(%tik, 0, Good, 1, Average, 2, High, 3, Critical)
}
this is a simple edit based on your code, of course, there is many ways to do this script