opcount { var %incnum = 1 while %incnum <= 30 { if ($me isop $chan(%incnum)) { var %opcount = $calc(%opcount + 1) inc %incnum } } return %opcount }