This Script Can Set The Topic In A Channel With A Status And An End
--COMMANDS--
.t Topic
.s Status
.e End
.on Status: Moderation Is ON
.off Status: Moderation Is OFF
The Topic Is Seperated By /'s
EXAMPLE:
<Austin|BNC> .t "Hawkee"
If You
on 1:text:.t *:#: {
if ( $nick isop $chan || $nick ishop $chan ) {
set %topic $2-
topic $chan %topic / %status / %end
}
}
on 1:text:.s *:#: {
if ( $nick isop $chan || $nick ishop $chan ) {
set %status $2-
topic $chan %topic / %status / %end
}
on 1:text:.on:#: {
if ( $nick isop $chan || $nick ishop $chan ) {
set %status 8Moderation Is 9ON. 4You Must Have Voice To Speak.
topic $chan %topic / %status / %end
}
}
on 1:text:.off:#: {
if ( $nick isop $chan || $nick ishop $chan ) {
set %status 8Moderation Is 4OFF
topic $chan %topic / %status / %end
}
}
on 1:text:.e *:#: {
if ( $nick isop $chan || $nick ishop $chan ) {
set %end $2-
topic $chan %topic / %status / %end
}
}
i use $strip bcz of color bold underline text then for the condition
if $1 == .f
if user use color or bold this will return false or i can remove "tokenize 32 $strip($1-)" and change the condition with
if $strip($1) == .f
also that can be like this
on *:text:*:#:{
tokenize 32 $strip($1-)
if (!%f) && ($istok(.on-.off.-.t-.s-.e,$1,45)) && ($nick(#,$nick,oh)) {
inc -u3 %f
...
...
theen the $trip is to remove all Ctrl+B, Ctrl+K, ect...
Yeah, there are various ways one can use. :-) Now, if you tokenize $strip($1-), that sort of defeats the purpose of using the regex with the /S modifier, which strips the control codes. You can put $2 as \S+ and represent it as $2-. The \s means a space:> on $*:text:/^.((o(n|ff))|t\s\S+|s\s\S+|e\s\S+)\b/iS:#:{
but when i read i see u can use only $reglm(1) with out $replace and put directly :on and :off
btw i have another method too
on $*:text:/^.((o(n|ff))|t|s|e)\b/iS:#:{
if (!%f) && ($nick(#,$nick,oh)) {
tokenize 32 $strip($1-)
inc -u3 %f
set %topic $iif($1 == .t,$2-)
set %status $iif($1 == .s,$2-,$iif($istok(.on|.off,$1,124),8Moderation Is $iif($pos($1,f,1),4OFF,4You Must Have Voice To Speak.)))
set %end $iif($1 == .e,$2-)
if ($topic != %topic / %status / %end) topic # $v2
}
}
on $*:text:/^.((o(n|ff))|t|s|e)\b/iS:#:{
if (!%f) && ($nick(#,$nick,oh)) {
inc -u3 %f
goto $replace($regml(1),on,o,off,f)
:o
set %status 8Moderation Is 9ON. 4You Must Have Voice To Speak.
topic $chan %topic / %status / %end
halt
:f
set %status 8Moderation Is 4OFF
topic # %topic / %status / %end
halt
:t
set %topic $$2-
topic # %topic / %status / %end
halt
:s
set %status $$2-
topic # %topic / %status / %end
halt
:e
set %end $$2-
topic # %topic / %status / %end
halt
}
}