Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; Usage: $randomchars(text)
- ; E.g: $randomchars(this is a testing message)
- alias randomchars {
- if (!$1-) { return }
- var %o = $1-
- var %t = $numtok(%o,32)
- var %i = 1
- while (%i <= %t) {
- var %w = $gettok(%o,%i,32)
- if (%w == $null) { goto next_word }
- var %l = $len(%w)
- if (!%l) { goto next_word }
- unset %x
- var %z = 1
- while (%z <= %l) {
- var %c = $mid(%w,%z,1)
- if (!%c) { goto next_word }
- var %r = $rand(1,2)
- if (%r == 1) { var %x = %x $+ $upper(%c) }
- if (%r == 2) { var %x = %x $+ $lower(%c) }
- inc %z
- }
- var %o = $puttok(%o,%x,%i,32)
- :next_word
- inc %i
- }
- return %o
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement