function AntiCAPSFilter(input_st:string;max_percent:byte):string; var i, n, nonspace_count:integer; begin nonspace_count:=0; n:=0; for i:=1 to length(input_st) do begin if input_st[i]<>' ' then inc(nonspace_count); if ((input_st[i]>='A') and (input_st[i]<='Z')) or ((input_st[i]>='À') and (input_st[i]<='ß')) or (input_st[i]='_') or (input_st[i]='¯') or (input_st[i]='ª') then inc(n); end; if round(n*100/nonspace_count)>=max_percent then result:=LowerCase(input_st) else result:=input_st; end; var s, chname:string; uin, uid:integer; begin s:=mGetLastChannelMessage(uin, uid, chname); // AntiCAPS filter s:=AntiCAPSFilter(s,70); mModifyLastChannelMessage(uin, uid, s); end.