$randtok

By Pwntage`Ninja on Apr 07, 2007

This is just basically a token extension I made, it operates thus:

[b]$randtok(text,C)
Randomizes token sequence of text

$randtok(a.c,46) returns either c.a or a.c
$randtok(a.b.c,46) returns either a.b.c / a.c.b / c.a.b / c.b.a

The C parameter is the ascii value of the character separating the tokens.[/b]

=]

Very simple.

alias randtok {
  If (!$2) { echo -s $+(,$gettok($readini(mirc.ini,colors,n0),6,44),*) Invalid format: $ $+ randtok (line $scriptline $+ , $nopath($script) $+ ) | halt }
  unset %x %i %t %rand
  var %x = $1
while (%x != $null) {
    %rand = $rand(1,$numtok(%x,$2))
    var %t = $iif(%t,%t $gettok(%x,%rand,$2),$gettok(%x,%rand,$2)), %x = $deltok(%x,%rand,$2)
  }
  return %t
}

Comments

Sign in to comment.
Pwntage`Ninja   -  Apr 07, 2007

Done.

 Respond  
xDaeMoN   -  Apr 07, 2007

Use local variables, instead of global.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.