Not really better but shorter and maybe faster even if I'm sure you don't care about speed... :

Code:
if (0 isin $regsubex(xxxxxxxx,/x/g,$iif($did($calc(2 + \n)).state,0,1))) {
 if !$didwm($dname,2,$did(2,0)) {
   did -a $dname 2 $did(2,0)
  }
}
Not tested of course, but should work smile

Last edited by Wims; 11/03/09 12:37 AM.

#mircscripting @ irc.swiftirc.net == the best mIRC help channel