Advertisement
westor

$randomchars v1.0 for Koragg

Jul 23rd, 2020
1,918
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 0.69 KB | None | 0 0
  1. ; Usage: $randomchars(text)
  2. ; E.g: $randomchars(this is a testing message)
  3.  
  4. alias randomchars {
  5.   if (!$1-) { return }
  6.  
  7.   var %o = $1-
  8.   var %t = $numtok(%o,32)
  9.   var %i = 1
  10.  
  11.   while (%i <= %t) {
  12.     var %w = $gettok(%o,%i,32)
  13.  
  14.     if (%w == $null) { goto next_word }
  15.  
  16.     var %l = $len(%w)
  17.  
  18.     if (!%l) { goto next_word }
  19.  
  20.     unset %x
  21.  
  22.     var %z = 1
  23.  
  24.     while (%z <= %l) {
  25.       var %c = $mid(%w,%z,1)
  26.  
  27.       if (!%c) { goto next_word }
  28.  
  29.       var %r = $rand(1,2)
  30.  
  31.       if (%r == 1) { var %x = %x $+ $upper(%c) }
  32.       if (%r == 2) { var %x = %x $+ $lower(%c) }
  33.  
  34.       inc %z
  35.     }
  36.  
  37.     var %o = $puttok(%o,%x,%i,32)
  38.  
  39.     :next_word
  40.     inc %i
  41.   }
  42.  
  43.   return %o
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement