on *:TEXT:!setcw*:#:{
if ($chan != #rspc) && ($nick !isreg $chan) {
if ($($+(%,cw.set.ignore.,$nick),2)) {
.notice $nick $c1(You can only use this command once every) $c2(30) $c1(seconds. Please wait) $c3($ifmatch) $c1(more $iif($ifmatch == 1,second.,seconds.))
halt
}
if (!$3) {
.notice $nick $c1(*** Syntax error:) $c2(!setcw world team)
halt
}
if (!$istok(2|6|9|12|18|22|23|24|26|27|28|31|36|41|42|44|46|48|53|54|56|58|59|60|64|65|66|69|70|71|76|77|78|79|82|83|84|88|89|91|92|97|98|99|100|103|104|110|111|112|114|115|116|120|121|123|124|126|129|130|131|132|137|138|124,$2,124)) {
.notice $nick $c1(The world you have specified is not a P2P world.)
halt
}
if (!$godname($3)) {
.notice $nick $c1(Please specify a valid god $chr(40)) $+ $c2(Saradomin) $+ $c1($chr(44)) $c2(Guthix) $+ $c1($chr(44) or) $c2(Zamorak) $+ $c1($chr(41))
}
else {
writeini RSCW.ini $chan World $2
writeini RSCW.ini $chan Team $godname($3)
writeini RSCW.ini $chan Setter $nick
msg $chan $c1(CastleWars World updated by) $br1($nick) $+ $c1(.) $c2(Team set to) $br2($godname($3)) $+ $c2(!) $c2(Type !cw or !cww to view the new world.)
set -z $+(%,cw.set.ignore.,$nick) 30
}
}
}
on $*:TEXT:/^[!@>~]cww? */Si:#:{
if ($chan != #rspc) {
if (!* !iswm $1) && ($nick isreg $chan) halt
if ($($+(%,cw.get.ignore.,$nick),2)) {
.notice $nick $c1(You can only use this command once every) $c2(30) $c1(seconds. Please wait) $c3($ifmatch) $c1(more $iif($ifmatch == 1,second.,seconds.))
halt
}
if (!$readini(RSCW.ini, $chan, World)) {
$iif(!* iswm $1,.notice $nick,msg $chan) $c1(There is not currently a CastleWars World set for) $br1($chan) $+ $c1(.)
halt
}
else {
$iif(!* iswm $1,.notice $nick,msg $chan) $c1(The CastleWars World for) $br1($chan) $c2(is currently:) $br2($readini(RSCW.ini, $chan, World)) $+ $c2(.) $c3(Team:) $br1($readini(RSCW.ini, $chan, Team)) $+ $c3(.) $c1(Set by:) $br2($readini(RSCW.ini, $chan, Setter)) $+ $c1(.)
set -z $+(%,cw.get.ignore.,$nick) 30
}
}
}
alias -l godname {
if ($regex($1,/^S(ara(domin)?)?$/Si)) return Saradomin
elseif ($regex($1,/^G(uth(ix)?)?$/Si)) return Guthix
elseif ($regex($1,/^Z(am(my|orak)?)?$/Si)) return Zamorak
}
alias -l br1 { return 02[13 $1- 02] }
alias -l br2 { return 02[07 $1- 02] }
alias -l c1 { return $+(06,$1-,) }
alias -l c2 { return $+(10,$1-,) }
alias -l c3 { return $+(05,$1-,) }