You can also use "tokenize" command. That allows you to tokenize texts.
Usage; /tokenize <ascii code> <text>
on 1:sockread:dnn:{
var %temp
sockread %temp
tokenize 32 %temp
if ([color:red]$1[/color] == PING) { sockwrite -n $sockname PONG [color:red]$2-[/color] }
}