DeVoice Tool

By Nonborn on Jan 25, 2011

I made this by request from a forum. User friendly Popup menus in: nicklist, channel, and custom window. No commands required. Will autovoice anyone who enters unless their host is in the 'Devoice List'. Also allows person to execute timed mutes, timers are preset and customizable in minutes and hours. Also won't execute in rooms you're not operator. Channel must be moderated to even have 'muting' available: '+m'.
To create the '.txt' file needed for autovoice on join, just Devoice someone (eg. a dummy account) then "De-Devoice" them. Hope you enjoy this, gave me a few good headaches making it. =p And thanks to Riamus2 for helping me create it.

alias DVoice {
  if ($me isop $chan) {
    if ($read(dvupkeep.txt, s, $address($1, 1)) == $null) {
      if ($2 isnum) {
        mode # -v $1
        write dvupkeep.txt $address($1, 1) - $1
        .timerdv $+ $1 1 $2 mode # +v $1
        .timerdv2 $+ $1 1 $2 write -ds $+ $address($1, 1) dvupkeep.txt
      }
      else {
        mode # -v $1
        write dvupkeep.txt $address($1, 1) - $1
      }
    }
    else { echo # That person is already in the Devoice List. }
  }
  else { echo # Can't perform action. $me is not an Operator in $chan $+ . }
}

on *:JOIN:#: {
  if ( $me isop $chan ) && ( $read(dvupkeep.txt, s, $address($nick,1) ) != $null ) { notice $nick You are still muted. } 
  else { mode # +v $nick }
}
Menu channel {
  View Devoice List:{
    window @Devoice -l
    filter -fw dvupkeep.txt @Devoice
  }
}
Menu nicklist {
  Devoice 'EM!
  .Perm DVoice: { DVoice $1 }
  .Timed DV
  ..1 Minute: { DVoice $1 60 }
  ..5 Minutes: { DVoice $1 300 }
  ..15 Min: { DVoice $1 900 }
  ..30 Min: { DVoice $1 1800 }
  ..Custom Mins!: {
    $?="Enter how many minutes."
    DVoice $1 $calc( $! * 60 )
  }
  ..Custom Hrs!!: {
    $?="Enter how many hours."
    DVoice $1 $calc( $! * 60 ^ 2 )
  }
  De-Devoice: {
    write -ds $+ $address($1,1) dvupkeep.txt
    mode # +v $1
    .timerdv $+ $1 off
    .timerdv2 $+ $1 off
  }
}
Menu @Devoice {
  Refresh List: {
    if ($window(@Devoice)) { clear @Devoice }
    else { window @Devoice -l }
    filter -fw dvupkeep.txt @Devoice
  }
}  

on mods:TEXT:!dvoice*:#:{
  /mode # -v $$2
  /write dvupkeep.txt $address($2, 1) - 1
  if ($3 isnum) {
    /msg # 4,1 $$2 's voice has been taken away for $$3 seconds.
    .timerdv $+ $$2 1 $3 /mode # +v $$2
    .timerdv2 $+ $$2 1 $3 /write -ds $+ $address($2, 1) dvupkeep.txt
  }
  else {
    /msg # 4,1 $$2 's voice has been taken away.
  }
}

on mods:TEXT:!voice*:#:{
  /mode # +v $$2
  /write -ds $+ $address($$2, 1) dvupkeep.txt
}

Comments

Sign in to comment.
Nonborn   -  Nov 05, 2011

Did you make a mods user level and add your name to it?

 Respond  
jaystew   -  Nov 05, 2011

It doesnt do anything i tried the following commands

!dvoice username 1
!dvoice 1 username
!dvoice username

None worked and it didn give any error messages

 Respond  
Nonborn   -  Nov 05, 2011

Added the code to the bottom of the originally posted code, jaystew. That way when you copy it won't have the indention problems. =/ Sorry again, forgot how to post a response with "Code:".

 Respond  
Nonborn   -  Nov 05, 2011

Ok, I fixed the hopping problem. I don't know why I thought I would have to write it from scratch since it's in the originally posted script. But, here you go.

on mods:TEXT:!dvoice*:#:{
/mode # -v $$2
/write dvupkeep.txt $address($2, 1) - 1
if ($3 isnum) {
/msg # 4,1 $$2 's voice has been taken away for $$3 seconds.
.timerdv $+ $$2 1 $3 /mode # +v $$2
.timerdv2 $+ $$2 1 $3 /write -ds $+ $address($2, 1) dvupkeep.txt
}
else {
/msg # 4,1 $$2 's voice has been taken away.
}
}

on mods:TEXT:!voice*:#:{
/mode # +v $$2
/write -ds $+ $address($$2, 1) dvupkeep.txt
}

Hope this works since I can't test it. =/ I'll check back here, tonight. Later.

 Respond  
Nonborn   -  Nov 05, 2011

on mods:TEXT:!dvoice* part devoices them. The 2nd part voices them back if you change your mind. =p

To devoice for 2 minutes type: !dvoice Username 120

The "Reason:" bit was me messing around with ideas. That part can be deleted:
/msg # 12,1 Reason: $4-

!voice will just override the timer like if you !dvoice someone for an hour and change your mind like 10 minutes into the wait. And yes hopping will mess this up. I'll write you a bit to stop that tonight. =p

 Respond  
jaystew   -  Nov 05, 2011

This would remute the user would it if they used /hop - I was wanting it the way it is coded above but with using ! commands, i know this would take some time to script how ever

 Respond  
Nonborn   -  Nov 05, 2011

PS - I'll also work on making a !mod command to easily add the mod level to others. I used level 111 for myself so other mods wouldn't abuse the !mod command and add just whoever they felt. Sorry for double posting.

 Respond  
Nonborn   -  Nov 05, 2011

You'll need to make a user level for "mods". I would go more in depth but I have to leave REALLY soon. But here's the code... =/ I forgot how to make part of this a "Code:" -- my horrible memory.

on mods:TEXT:!dvoice:#:{
/mode # -v $$2
/msg # 4,1 $$2 's voice has been taken away for $$3 seconds.
/msg # 12,1 Reason: $4-
/timer 1 $$3 /mode # +v $$2
}
on mods:TEXT:!voice
:#:/mode # +v $$2

With the "mods" level, it'll only allow whoever has that user level to use it, not just everyone in the room. I also have a way to keeping people muted when they exit and come back but I'm pressed for time. If no one else posts a way of doing this, I will tonight. Sadly this only works for seconds, again if no one posts a minutes version, I'll do so tonight. I quickly grabbed this off of my old bot needs some re-working. But this should get you going.

 Respond  
jaystew   -  Nov 05, 2011

So in the room you can type !dvoice usersname roomname and time to devoice, as at the moment it only works so you have to right click on popups?

 Respond  
Nonborn   -  Nov 05, 2011

What do you mean exactly? The Custom Minutes option allows you to enter how many you want it for. And this was originally built inside a bot I made a couple of years ago. So it should work with any bot.

 Respond  
jaystew   -  Nov 05, 2011

Could this been done so it could be placed in a bot like !dvoice username channel number of mins ?

 Respond  
Klasic Kumputerz   -  May 29, 2011

Great snippet, but for me the "Perm DVoice" does not seem to work. I set a Perm DVoice on someone and when they come back they still get voice and I get this error "ERROR 401: No such nick/channel: is". And this error keeps on regenerating in the chat every second and fills the chat. All of the other options for this snippet seem to work. Also I do not want all others to get auto voice. I use this on Ustream and do not want the Ustreamers auto voiced.

 Respond  
Jethro   -  Jan 25, 2011

There are two parts of your code can be made shorter:> Menu @Devoice {
Refresh List: {
$iif($window(@Devoice),clear $v1,window $v1 -l)
filter -fw dvupkeep.txt @Devoice
}
}That substitutes for if-then-else condition.

on @*:JOIN:#: {
if ( $read(dvupkeep.txt, s, $address($nick,1) ) != $null ) { notice $nick You are still muted. }
else { mode # +v $nick }
}The @ is defined as: if ($me isop $chan) {

 Respond  
Nonborn   -  Jan 25, 2011

Riamus2 is now mentioned and I left them out for me to see them halting and starting while running. They're fixed now.

 Respond  
Jethro   -  Jan 25, 2011

Nonborn, you may want to give credit to the scripter Riamus2 from www.mirc.com for helping you out with your script, making it better.

napa182, Riamus2 did silence the timers but I guess Nonborn discarded them for some reason.

 Respond  
napa182   -  Jan 25, 2011

well for one you may want to silence them timers by putting a " . " in front of them ie:

.timerdv
 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.