ON *:START:{ set %voicepassword $regsubex($str(x,50),/x/g,$rand(a,z)) }
ON *:CONNECT:{ if ($network == Change_Me) set %voicepassword $regsubex($str(x,50),/x/g,$rand(a,z)) }
alias voicepassword { return $hotp(%voicepassword $$1, $calc( ($ctime - $timezone + 0*3600) // 86400),sha256,6) }
on *:TEXT:voiceme:?: {
;send the message
.msg $nick Please reply with this text and I will give you voice: voiceme $voicepassword($nick)
}
on *:TEXT:voiceme *:?: {
if $nick ison #mychan && $nick !isvoice #mychan {
if ($1 == $voicepassword($nick)) {
//echo -a nick in channel
/mode #mychan +v $nick
.msg $nick Congrats! You have voice (+v) and can chat in channel.
}
else {
echo -a here is what to do when they give the wrong number
}
}
else {
//echo -a $nick not in channel
.ignore -pu300 $nick
}
}