Channel auto voice

By Massivity on Nov 03, 2010

[Script for a bot]
commands are: !autovoice [on/off]

Demo

<~Justine> !autovoice on
<~Chicken> Autovoice for channel [#massivity] is now [ ON ]
<~Justine> !autovoice off
<~Chicken> Autovoice for channel [#massivity] is now [ OFF ]

==edited==
added onjoin event

on *:text:!autovoice on*:#: {
  if ($me !isop $chan) { notice $nick 4 $+ ERROR - I will only function on channels where i am opped | .halt }
  if ($nick !isop $chan) { msg $chan 4 $+ ERROR - You are not authorized for this command | .halt }
  if (% [ $+ autovoice. $+ [ $chan ] ] == on) { msg $chan 4 $+ ERROR - Autovoice for $chan is already on | .halt }
  .set % [ $+ autovoice. $+ [ $chan ] ] on
  msg $chan 7Autovoice for channel 2[ $+ $chan $+ ]7 is now [ $+ 9 ON  $+ ]
}

on *:text:!autovoice off*:#: {
  if ($me !isop $chan) { notice $nick 4 $+ ERROR - I will only function on channels where i am opped | .halt }
  if ($nick !isop $chan) { msg $chan 4 $+ ERROR - You are not authorized for this command | .halt }
  if (% [ $+ autovoice. $+ [ $chan ] ] == off) { msg $chan 4 $+ ERROR - Autovoice for $chan is already off | .halt }
  .set % [ $+ autovoice. $+ [ $chan ] ] off
  msg $chan 7Autovoice for channel 2[ $+ $chan $+ ]7 is now [ $+ 4 OFF  $+ ]
}
on *:join:#: {
  if ($me isop $chan) {
    if (% [ $+ autovoice. $+ [ $chan ] ] == on) {
      .mode $chan +v $nick
    }
  }
}

Comments

Sign in to comment.
Frenetic   -  Dec 29, 2011

Fuzionx, a lot of networks don't use services with chanserv and such.

 Respond  
Jethro   -  Dec 29, 2011

Fuzionx, putting a dot in front of /mode command, in this case, is purposeless indeed. Many MSL coders likes to put a dot in front of all the commands out of habit.

 Respond  
Fuzionx   -  Dec 29, 2011

No to put a . before mode since it won't silence anything. Also: '% [ $+ autovoice. $+ [ $chan ] ]' can be done like this: '%autovoice $+ [ $chan ]' or '$+(%autovoice,$chan)'.

And why won't you just give everybody autovoice access using ChanServ?

 Respond  
LordBotTeam   -  Dec 28, 2011

You Should of put it like this on !@*:join:#:{

on !@*:join:#: {
if ($me isop $chan) {
if (% [ $+ autovoice. $+ [ $chan ] ] == on) {
.mode $chan +v $nick
}
}
}

 Respond  
Jethro   -  Nov 11, 2010

BigSteve, have a read at this link: http://www.hawkee.com/phpBB2/faq.php?mode=bbcode

 Respond  
BigSteve   -  Nov 11, 2010

meep >.< how do you do quotes and code boxes lmao

 Respond  
Jethro   -  Nov 10, 2010

I see. WorldDMT has spoken.

 Respond  
WorldDMT   -  Nov 10, 2010

Let's say lots of nick joins in at once
this is a mass join before the mode flood :p

we can do also multi mode something like mode +vvvvvv nick1 nick2 ...... to avoid mode flood

 Respond  
BigSteve   -  Nov 10, 2010

aye cheers @Jethro_ :}

 Respond  
Jethro   -  Nov 09, 2010

BigSteve, your example should include a dynamic timer to voice each user in a delay, or else you're running the risk of mode flood. Let's say lots of nick joins in at once or at the same time...the client that runs the code will be doomed without some sort of protection.

on @*:join:#:{
  $+(.timer,autov,#,$network,$nick) 1 5 mode # +v $nick - $&
    $(|) msg # $nick has been auto voiced. Hello and Welcome to # $nick $+ .
}

P.S. There is yet a /pvoice command that may be useful too.

 Respond  
BigSteve   -  Nov 09, 2010

an also if you arent OP in a room or an OPER
on *:JOIN:#: {
voice $nick
}
will send an error message in your channelwindow saying Chanop: you are not a channel operator so SH

 Respond  
BigSteve   -  Nov 09, 2010

@ZirixZero

on *:JOIN:#: {
voice $nick
}

that fails

if your gonna do it do it properly

on @:JOIN:#: {
/mode +v $nick
/msg $chan $nick has been auto voiced Hello and Welcome to $chan $nick
}

One I use Kgo

 Respond  
d8e93jf9vwp   -  Nov 07, 2010

okay

 Respond  
Jethro   -  Nov 07, 2010

Then you should've said so, 'cause not all the chat networks use unreal.

 Respond  
d8e93jf9vwp   -  Nov 07, 2010

/voice $nick on Unreal voices

 Respond  
Jethro   -  Nov 06, 2010

ZirxZero, what the heck is "voice $nick?" Again, you fail to add a @ to the event. If the client is not opped when somebody joins, you'll get an error.

 Respond  
d8e93jf9vwp   -  Nov 06, 2010

A really simple one

on *:JOIN:#: {
  voice $nick
}
 Respond  
irchainscriptz   -  Nov 03, 2010

Too many of these autovoice snippets and most dont even bother with it..but nice the same. As they say practice makes perfect!! 0.o

 Respond  
Jethro   -  Nov 03, 2010

Hmmmm...ok then. :p

 Respond  
WorldDMT   -  Nov 03, 2010

about anti flood may be !%p [ $+ [ # ] ] is better than $wildsite

bcz if many users type !autovoice on/off the bot will flood

 Respond  
Jethro   -  Nov 03, 2010

Download, just add one:

on @*:join:#:{
  if (% [ $+ autovoice. $+ [ # ] ] == on) {
    pvoice 1 # $nick
  }
}
 Respond  
Jethro   -  Nov 03, 2010

Like WorldDMT said, using $iif to avoid repetition. But if you don't know much about $iif, you can still use one text with the if-elseif-else statement:

on $*:text:/^!autovoice\so(n|ff)/iS:#:{
  if (!%p [ $+ [ # ] ]) {
    inc -u5 $+(%,p,#)
    if $regml(1) = n {
      if !$nick(#,$nick,oh) {
        notice $nick 4 $+ ERROR - I will only function on channels where i am opped.
      }
      elseif (% [ $+ autovoice. $+ [ # ] ] == on) { 
        msg # $nick 4 $+ ERROR - Autovoice for $chan is already on
      }
      else {
        set % $+ autovoice. $+ # on
        msg # $nick 7Autovoice for channel 2[ $+ # $+ ]7 is now [ $+ 9 ON  $+ ]
      }
    }
    else {
      if !$nick(#,$nick,oh) { 
        notice $nick 4 $+ ERROR - I will only function on channels where i am opped.
      }
      elseif (% [ $+ autovoice. $+ [ # ] ] == off) {
        msg # $nick 4 $+ ERROR - Autovoice for # is already off.
      }
      else {
        set % $+ autovoice. $+ # off
        msg # $nick 7Autovoice for channel 2[ $+ # $+ ]7 is now [ $+ 4 OFF  $+ ]
      }
    }
  }
}

And you should really add a trigger control to avoid being spammed or flooded. And I don't see the need to notice and message the channel for op or halfop check at the same time. Lastly, you don't need the evaluation brackets [ ] when setting the dynamic var.

 Respond  
Memoli   -  Nov 03, 2010

and where is the on JOIN event for give autovoice if someone join the channel?

 Respond  
WorldDMT   -  Nov 03, 2010

u can use on event and add $iif to avoid repetitions

 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.