0

I have this command for a onjoin event:

on !*:join:#:{ msg $chan MESSAGE }

How can i switch this message on/off by using example:

!onjoin on OR !onjoin off

Thanks

user3135461
  • 11
  • 1
  • 4

1 Answers1

0

You can use a variable that indicate the status for this option. This variable will be set by the command you specified.

Script should be as follow:

on !*:join:#: if (%onJoinMessage) { msg # MESSAGE }
on *:text:!onjoin *:#: {
    if ($1 == on) { inc %onJoinMessage }
    elseif ($1 == off) { unset %onJoinMessage }
}
Orel Eraki
  • 11,940
  • 3
  • 28
  • 36