Skip to content

Instantly share code, notes, and snippets.

@secobi
Last active February 28, 2021 00:16
Show Gist options
  • Select an option

  • Save secobi/5192447 to your computer and use it in GitHub Desktop.

Select an option

Save secobi/5192447 to your computer and use it in GitHub Desktop.
This is a simple random alphanumeric string generator for mIRC to be saved under the alias tab and used as an identifier; for instance, entering "//echo $rndstr(16)" into any chat window will echo 16 random alphanumeric characters.
rndstr {
if ($1 != $null) {
var %x = 0
var %y = $null
var %z = $null
:start
if (%x < $1) {
inc %x
%y = $rand(0,61)
if (%y < 10) { %y = $rand(0,9) | goto add }
if (%y < 36) { %y = $rand(a,z) | goto add }
else { %y = $rand(A,Z) | goto add }
:add
%z = [ %z $+ [ %y ] ]
goto start
}
else return %z
}
else {return $null | echo 0,5 $+ $chr(10) $chr(36) $+ rndstr 4requires an argument!  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment