maybe use hash for this instead of filling up ur var list
here is a fast rewrite using hash trying to keep it at what you have. added a delete command an you may want to add a flood control an some checks, but w/e
on @*:text:!joinmsg *:#: {
if ($nick isop #) {
if ($2 = on || $2 = off) {
.hadd -m joinmsg $+(conf,.,$network,.,#) $iif($2 = on,on,off)
msg # Joinmsg $+(,$hget(joinmsg,$+(conf,.,$network,.,#)),.)
}
if ($2 = set || $2 = del) {
$iif($2 = set,.hadd -m joinmsg $+(text,.,$network,.,#) $3-,$iif($2 = del,hdel joinmsg $+(text,.,$network,.,#)))
msg # Joinmsg $iif($hget(joinmsg,$+(text,.,$network,.,#)),set.,deleted.)
}
}
else { msg # $nick - Only channel operators may use this command. }
}
on !*:JOIN:#: {
if ($hget(joinmsg,$+(conf,.,$network,.,#)) && $hget(joinmsg,$+(text,.,$network,.,#))) {
msg # $hget(joinmsg,$+(text,.,$network,.,#))
}
}
on *:start:{ $joinmsgstartup }
on *:connect:{ $joinmsgstartup }
on *:exit:{ $joinmsgclose }
on *:disconnect:{ $joinmsgclose }
alias -l joinmsgclose { .hsave joinmsg $qt($scriptdirjoinmsg.hsh) }
alias -l joinmsgstartup {
if (!$hget(joinmsg)) { .hmake joinmsg 100 }
elseif ($exists($qt($scriptdirjoinmsg.hsh))) { .hload joinmsg $qt($scriptdirjoinmsg.hsh) }
}