@ is anyone with Ops status (/mode #channel +o nick)
Owner/Deowner is only recognized properly on IRCX servers.
The ON MODE event is for Channel modes, which this is not.
Here's a suggestion for you to try. Please note that I have used ~ for the character that represents the owner mode, change if necessary.
on ^*:rawmode:#:{
if q isin $2 {
var %a = 2, %b = $len($2)
while %a <= %b {
if $mid($2,%a,1) == q {
set %opnicks $addtok(%opnicks,$gettok($3-,$calc(%a - 1),32),32)
}
inc %a
}
.msg $chan $nick ( $+ $address $+ ) set mode +q for %opnicks
}
haltdef
}
You had the right idea regarding ON MODE, just not the right event.