mIRC Home    About    Download    Register    News    Help

Print Thread
#70761 08/02/04 10:25 PM
Joined: Dec 2002
Posts: 332
C
Cheech Offline OP
Fjord artisan
OP Offline
Fjord artisan
C
Joined: Dec 2002
Posts: 332
i have the following code
Code:
  
alias caps {
  return $calc($regex($1,/[A-ZÄÖÜ]/g)/$len($1)*100)
}


and also
Code:
 
on 1:TEXT:*:*: {
  set %capscheck $remove($1-,$chr(32))
  set %capscheck1 $strip(%capscheck)
  if ($caps(%capscheck1) >= 50) { 
    msg $chan 04 $+ $nick 02you are using 04 $+ $caps($1-) $+ % Caps. 02this is 04VERY 02annoying 
  }
}


the problem is if someone types
<hfhfhfh> HHHHHHHHHH
<caps> hfhfhfh you are using 100% Caps. this is VERY annoying
if they type
<hfhfhfh> AAAAAAAA HHHHHHHH BBBBBBBBBBB CCCCCCCCC
<caps> hfhfhfh you are using 92.307692% Caps. this is VERY annoying
why doesnt it return 100% also ?

#70762 08/02/04 10:29 PM
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
Because a space isn't in the list of characters you specified.

Use tokenize 32 $remove($1,$chr(32)) in the alias.

Edit: Put 43 instead of 32.

Last edited by Collective; 08/02/04 10:31 PM.
#70763 08/02/04 10:32 PM
Joined: Dec 2002
Posts: 332
C
Cheech Offline OP
Fjord artisan
OP Offline
Fjord artisan
C
Joined: Dec 2002
Posts: 332
is the caps alias ? if so could you tell me where to look in the help for assitance ? i would like to try and do it myself but not sure what you mean thx . smile

#70764 08/02/04 10:39 PM
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
Sorry, I was talking nonsense. This is the correct reason why:

Code:
on 1:TEXT:*:*: {
  set %capscheck $remove($1-,$chr(32))
  set %capscheck1 $strip(%capscheck)
  if ($caps(%capscheck1) &gt;= 50) { 
    msg $chan 04 $+ $nick 02you are using 04 $+ $caps([color:red]%capscheck1[/color]) $+ % Caps. 02this is 04VERY 02annoying 
  }
}

Before you used $1- where the red is, that still has the spaces in.

Code:
on 1:TEXT:*:*: {
  set %capscheck $remove($1-,$chr(32))
  set %capscheck1 $strip(%capscheck)
  if ($caps(%capscheck1) &gt;= 50) { 
    msg $chan 04 $+ $nick 02you are using 04 $+ $ifmatch $+ % Caps. 02this is 04VERY 02annoying 
  }
}

Would be faster.

/me remembers to test his code frown

#70765 08/02/04 10:55 PM
Joined: Dec 2002
Posts: 332
C
Cheech Offline OP
Fjord artisan
OP Offline
Fjord artisan
C
Joined: Dec 2002
Posts: 332
thx Collective i did not see that $1- all the times i looked in there smile


Link Copied to Clipboard