alias startwithlower {
if ( $1 ) {
return $islower($left($regsubex($$1,/\W+/g,$null),1))
}
else return $false
}
on 1:JOIN:#: {
if ($readini(ini\title.ini,n,mistress,$nick)) {
.describe $chan looks up and sees Mistress $nick $+ . "Tal Mistress."
}
elseif ($readini(ini\title.ini,n,master,$nick)) {
.describe $chan looks up and sees Master $nick $+ . "Tal Master."
}
else {
notice $nick Tal $nick I have no record of what you are. Please take the time to register that info with me. A pm will be spent to you
shortly.
msg $nick Please choose from one of the following titles: .Master or .Mistress
}
on 1:text:*Mistress:?:{
if ($1 == Mistress) { .msg $nick I see your trying to register as a Mistress, $nick $+ . To do so, please type 12 $+ .Mistress | halt
}
elseif ($1 == .Mistress) && (!$readini(ini\title.ini,n,mistress,$nick)) {
if ( $startwithlower($nick) == $true ) { .msg $nick you cannot be addressed as Mistress | halt }
else {
/writeini ini\title.ini mistress $nick true
msg $nick Tal Mistress. I will remember who you are when I see you.
}
}
}
on 1:text:*Master:?:{
if ($1 == Master) { .msg $nick I see your trying to register as a Master, $nick $+ . To do so, please type 12 $+ .Master | halt }
elseif ($1 == .Master) {
if ( $startwithlower($nick) == $true ) { .msg $nick you cannot be addressed as Master | halt }
else {
/writeini ini\title.ini master $nick true
msg $nick Tal Master. I will remember who you are when I see you.
}
}
}