Top

Textinfo percent/bold/underline....


mIRC Code
+ 0 likes
Please Register to submit score.
Bookmark and Share
Average Score  0.0 (of 0 scores)
Date Added  Aug 23, 2008
Last Updated  Aug 23, 2008
Tags  alias  caps  percent 

Introduction

works like: //echo -a $text(sometext).bold/caps/bold/reverse/color
Would be useful for bots etc :)

Grab the Code

alias text {
  if (!$istok(caps|bold|underline|reverse|color,$prop,124)) || (!$prop) || (!$1) return
  if ($prop == caps) return $calc($regex($1-,/[A-ZÄÖÅÜ]/g) * 100 / $len($strip($1-)))
  elseif ($prop == bold) || ($prop == underline) || ($prop == reverse) {
    var %i 1,%z 0,%r $iif($prop == bold,$regex($1-,/\002([^\002]+)\002?/g),$iif($prop ==  underline,$regex($1-,/\037([^\037]+)\037?/g),$regex($1-,/\026([^\026]+)\026?/g)))
    while (%i <= %r) { inc %z $len($strip($regml(%i)))) | inc %i }
    return $calc(%z * 100 / $len($strip($1-)))
  }
  elseif ($prop == color) {
    var %i 1,%z 0,%r $regex($1-,/\003\d\d?(.\d\d?)?([^(\003\d\d?(.\d\d?)?)?]+)/g)
    while ($regml(%i)) { if ($left($regml(%i),1) != $chr(44)) { inc %z $len($strip($regml(%i)))) } | inc %i }
    return $calc(%z * 100 / $len($strip($1-)))
  }
}

Comments

  (6)  RSS
vaseline28
Comments: 162
 
mIRC Snippet:  Textinfo percent/bold/underline....
Posted on Aug 23, 2008 3:10 am
Just got a couple of things, to set a variable, you don't need an =, you can just do:
Code:
var %i 1

Instead of:
Code:
var %u = $calc(%u + 1)

Just declare %u as 0 at the start and then do:
Code:
inc %u

Otherwise the script won't necessarily return anything if none of the text is caps.
juhapuha
Comments: 73
 
mIRC Snippet:  Textinfo percent/bold/underline....
Posted on Aug 23, 2008 3:12 am
It works fine :>
even though none of text would be caps :)
EL
Comments: 1,125
 
mIRC Snippet:  Textinfo percent/bold/underline....
Posted on Aug 23, 2008 3:25 am
Code:

alias caps { return $round($calc($regex($1-,/[A-Z]/g) / $regex($1-,/[A-Z]/gi) * 100),0) }

Both return the same.`-.-´
napa182
Comments: 1,454
 
mIRC Snippet:  Textinfo percent/bold/underline....
Posted on Aug 23, 2008 3:34 am
going along with that you can do it like this as well
Code:
alias caps { return $calc($regex($1-,/[A-Z]/g)/$len($1-)*100) }
juhapuha
Comments: 73
 
mIRC Snippet:  Textinfo percent/bold/underline....
Posted on Aug 23, 2008 3:38 am
-_- >_<

I will update the snippet!
so you can get percent of colour/underline/reverse/caps ! and with regex because you seem you love it
At first i want to make the snippet simple so even beginners could understand it.
EL
Comments: 1,125
 
mIRC Snippet:  Textinfo percent/bold/underline....
Posted on Aug 23, 2008 4:10 am
Rofl well u dont have to change it on our accounts ;p we jsut made suggestions of different ways of doin it.`-.-´

Commenting Options

Register or Login to Hawkee.com or use your Facebook or Twitter account by clicking the corresponding button below.

  
Bottom