All pastes #510914 Raw Edit

Unnamed

public text v1 · immutable
#510914 ·published 2007-05-26 04:16 UTC
rendered paste body
proc random {text} {
 return [lindex $text [rand [llength $text]]]
}

set letters(0) {
{A}
{B}
{C}
{D}
{E}
{F}
{G}
{H}
{I}
{G}
{K}
{L}
{M}
{N}
{O}
{P}
{Q}
{R}
{S}
{T}
{U}
{V}
{W}
{X}
{Y}
{Z}
}

set letters(1) {
{a}
{b}
{c}
{d}
{e}
{f}
{g}
{h}
{i}
{j}
{k}
{l}
{m}
{n}
{o}
{p}
{q}
{r}
{s}
{t}
{u}
{v}
{w}
{x}
{y}
{z}
}

set letters(2) {
{0}
{1}
{2}
{3}
{4}
{5}
{6}
{7}
{8}
{9}
}

set letters(3) {
{~}
{!}
{@}
{#}
{$}
{%}
{^}
{&}
{*}
{,}
{.}
{'}
}


proc random2 {{d "10"}} {
global letters 
set i 0
set output ""
set sc [rand [expr $d]]
while {![string equal $i $d]} {
set r [rand 3]
if {[string equal $i $sc]} {set r "3"}
append output [random $letters($r)]; incr i} 
return $output
}

bind pub - random pub:random
proc pub:random {nick uhost hand chan args} {
set d [lindex $args 0]
if {[string equal [llength $d] 0]} {set d "10"}
puthelp "privmsg $chan :[random2 $d]"
}