channel Lock/Unlock

By Massivity on Nov 03, 2010

basically for a bot. it locks and unlocks your channel

on 1000:text:!private*:#:{ if ($nick isop $chan) || ($nick ishop $chan) {
    /mode $chan +m
    /mode $chan +p
    /mode $chan +i 
    /mode $chan +N
    /mode $chan +C
    /mode $chan +k 010100100PRIVATE01001010
    /msg $chan Channel $chan is now Locked
  }

}
on 1000:text:!public*:#:{ if ($nick isop $chan) || ($nick ishop $chan) {
    /mode $chan -m
    /mode $chan -p
    /mode $chan -i 
    /mode $chan -N
    /mode $chan -C
    /mode $chan -k 010100100PRIVATE01001010
    /msg $chan Channel $chan is now Unlocked
  }
}

Comments

Sign in to comment.
Jethro   -  Nov 06, 2010

ZirixZero,

on @$*:text:/!p(rivate|ublic)/iS:#:{
  if !%t {
    inc -u3 %t 
    mode # $iif($regml(1) = ublic,-,+) $+ pi 
  }
}

You have to make sure the client running the code is opped by adding a @ prefix, or else you'll get an error. A trigger protection is recommended.

 Respond  
d8e93jf9vwp   -  Nov 06, 2010

How about you just set modes +pi for private?em

on *:TEXT:!private:#: {
  mode $chan +pi
}

on *:TEXT:!public:#: {
  mode $chan -pi
}

Erotf No need for the forward slashes while using brackets. { }

 Respond  
WorldDMT   -  Nov 03, 2010

loool

 Respond  
Jethro   -  Nov 03, 2010

lol I reread this thread and found this phrase,"and how to add a user level 1000???"

:P I believe WorldDMT was saying, "Why do you add a user level 1000?"

Ah..well, as they French say, "C'est la vie!"

 Respond  
Jethro   -  Nov 03, 2010

This is what I'd do if I were you:

on $1000:text:/^!p(rivate|ublic)$/iS:#:{
  if $regml(1) = rivate { tokenize 124 $x | $y $!+(+, $* ) }
  else { tokenize 124 $x | $y $!+(-, $* ) }
}
alias -l y return scon -r mode $!decode( $encode(#,m) ,m)
alias -l x return $regsubex(m p i N C k 010100100PRIVATE01001010,/(m|p|i|N|C|k.*)/g,$+(|,\1))

One thing I'm confused about is that why do you check for ops and halfops when you indicate 1000 level for the on text event? Isn't that pointless?

P.S. I didn't implement a trigger control, but it's recommended so the client running the code doesn't get mode spam of flood in case that happens.

 Respond  
Massivity   -  Nov 03, 2010

/auser

 Respond  
WorldDMT   -  Nov 03, 2010

:/ ???!!!

/mode # (+/-)mpiNCk 010100100PRIVATE01001010

and how to add a user level 1000???

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.