random channel commands

By jsg55 on Jan 10, 2010

lame first attempt at regex :S

on 5:TEXT:*:#:{
if ($regex($1,!mute)) {
 mode # +b ~q: $+ $remove($2,$)
}
if ($regex($1,!unmute)) {
 mode # -b ~q: $+ $remove($2,$)
  }
if ($regex($1,!bchan)) {
 mode # +b ~c: $+ $remove($2,$)
  }
if ($regex($1,!unbchan)) {
 mode # -b ~c: $+ $remove($2,$)
  }
if ($regex($1,!akick)) {
 cs akick # add $remove($2,$) $+ $address($2,2)
  }
}

Comments

Sign in to comment.
jsg55   -  Jan 10, 2010

well thanks for the help both of you, making learning regex quite a bit easier lol

 Respond  
gooshie   -  Jan 10, 2010

Jethro_
You don't need $2 to be in channel for any of these codes.
I don't know what all daemons support the extended ban types
but I know unreal does.. it may be the only one that does..

on @$5:TEXT:/^!((un)?(mute|bchan)|akick) .+/iS:#:{
  if ($regml(1) = akick) cs akick # add $2
  else mode # $+($replace($regml(1),unmute,-b ~q,mute,+b ~q,unbchan,-b ~c,bchan,+b ~c),:,$2)
}
 Respond  
Jethro   -  Jan 10, 2010

Sorry if I'm a bit confused. The network I'm using doesn't have those mode sets. lol

 Respond  
Jethro   -  Jan 10, 2010

Yeah I agree. I believe the script can also be done this way:

on @$5:TEXT:/^!(unmute|mute|bchan|unbchan|akick)/iS:#: {
  if ($regml(1) = akick) cs akick # add $2 
  elseif ($2 ison #) mode # $replace($regml(1),unmute,$&
    -b ~q:,mute,+b ~q:,unbchan,-b ~c:,bchan,+b ~c:) $+ $2
}
 Respond  
jsg55   -  Jan 10, 2010

ah ok tyvm for the help

 Respond  
gooshie   -  Jan 10, 2010

Jethro_
That won't work with $v1 besides why use $v1 when $2 is shorter.
Also, no need for $2 to be in channel. May want to add someone
when they are not in channel.

 Respond  
Jethro   -  Jan 10, 2010

Gotta make sure the client is opped and the $2 ison #

on @$5:TEXT:/^!(((un)?mute|bchan)|akick) .+/iS:#:{
  var %r $regml(1) | if ($2 ison #) {
    if (%r = mute) mode # b ~q: $+ $v1
    elseif (%r = unmute) mode # -b ~q: $+ $v1
    elseif (%r = bchan) mode # +b ~c: $+ $v1
    elseif (%r = unbchan) mode # -b ~c: $+ $v1
    else cs akick # add $v1
  }
}
 Respond  
gooshie   -  Jan 10, 2010
on @$5:TEXT:/^!((un)?(mute|bchan)|akick) .+/iS:#:{
  var %r $regml(1)
  if (%r = mute) mode # +b ~q: $+ $2
  elseif (%r = unmute) mode # -b ~q: $+ $2
  elseif (%r = bchan) mode # +b ~c: $+ $2
  elseif (%r = unbchan) mode # -b ~c: $+ $2
  else cs akick # add $2
}
 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.