Crinul, the .data only applie for the match part, it return the item name...
xyzzy, You're missing a { in the if part and you're using $1 instead of $v1 :
else {
tokenize 32 $2-
var %a = $0
while %a {
if ($hfind(Badwords,$($+($,%a),2),1).data) { .hdel Badwords $v1 | msg $chan $($+($,%a),2) deleted from bad word list }
;else var %er = %er $v1
dec %a
}
}
Should work
Edit : in Crinul's code, the value of $hget(Badwords,$v1).data is certainly $null since we just delete the item..., $($+($,%a),2) should be used, but a $gettok seems to be better imo.