Unique Auto Voicer

By Cheiron on Mar 06, 2008

unlike most most voicers you see on here or on the mIRC clients, this one is most unusual... my last one i did looked at case-sensitive voicing.. ie if the nick was labelled without a capital letter ie helen.. then it got a voice. it would check the beginning of the name for characters like {[^ etc where you find alot of names have been taken and so need adjusting in order to keep them.. for example helen.. if that was taken you would need to say... put {helen} orhelen or ^helen for example.. the script happily ignored those characters and looked for the first letter before applying the voice..

This time i have gone one step further. as well as looking for the same first letter as my last script did, this snippet now monitors nick changes in channel and alters the voice accordingly.

it still works on a lowercase name getting a voice on joining a channel, but this time if that name changes to a capital letter start.. ie helen becomes Helen.. the script will remove the voice. similiarly.. if John joined channel for example, he would not get a voice.. but if he then changed from John to john.. the script will now voice him right away in channel.

result being.. full automation of voicing without any manual intervention from an op.

all that is required for this to work is to add your channel where i have put #Channel and load into a fresh remotes. this script works with all mIRC from 6.16 to the current 6.31. it will not run on Yourbot IRC though as i found out lol.... such a nice bot that is coughs

[A big thankyou to sdamon for helping me debug my original script]

PLEASE NOTE... where i have put #channel .. replace the "channel" with your channel name. ie #gamers or #diverse

as i had run into issues trying to convert it from a UpperCase nick getting the voice to the lowercase nick getting the voice. it turned out also a reason it wouldnt work IS because i had it running on the ever faithful Yourbot IRC.. sighs i will learn sometime lol.. thoughts, comments and ratings from all you nice folk out there?

#uppercheck on

alias -l _c return #channel
alias startwithupper {
  if ( $1 ) {
    return $isupper($left($regsubex($$1,/\W+/g,$null),1))
  }
  else return $false
}

on @*:JOIN:#channel:{
  if ( $startwithupper($nick) == $false ) {
    mode $_c +v $nick
  }
}

on @*:NICK:{
  if ( ( $startwithupper($newnick) == $false ) && ( $newnick !isvoice $_c ) ) {
    ; New nick is with upper case and previous is unvoiced
    mode $_c +v $newnick
  }
  if ( ( $startwithupper($newnick) == $true ) && ( $newnick isvoice $_c ) ) {
    ; New nick is with lower case and previous is voiced
    mode $_c -v $newnick
  }
}

#uppercheck end

Comments

Sign in to comment.
cupcake   -  Nov 11, 2010

Works great, tested it looked interesting, Good Job Cheiron.

 Respond  
Cheiron   -  Jun 14, 2010

hi kohinoor .. which version are you using.. my script or the edit from Jethro_ or EL's ?

 Respond  
kohinoor   -  Jun 14, 2010

ehhhh.... why can't i get it to work? help

 Respond  
Jethro   -  Sep 04, 2009

@Taerar: You can do it this way:

on @!*:JOIN:#channel: {
  var %x = $isupper($left($regsubex($nick,/\W+/g,$null),1))
  mode $chan $iif(!%x,-v $nick,+v $nick)
}
on !@*:NICK: {
  var %x = $isupper($left($regsubex($newnick,/\W+/g,$null),1))
  if ($newnick ison #channel) && (%x) { mode #channel $iif(%x,+v $newnick) }
  else { mode #channel -v $newnick } 
}

Change #channel to your actual channel name

 Respond  
Cheiron   -  Sep 04, 2009
#uppercheck on

alias -l _c return #channel
alias startwithupper {
  if ( $1 ) {
    return $isupper($left($regsubex($$1,/\W+/g,$null),1))
  }
  else return $true
}

on *:JOIN:#channel:{
  if ( $startwithupper($nick) == $true ) {
    mode $_c +v $nick
  }
}

on *:NICK:{
  if ( ( $startwithupper($newnick) == $true ) && ( $newnick !isvoice $_c ) ) {
    ; New nick is with upper case and previous is unvoiced
    mode $_c +v $newnick
  }
  if ( ( $startwithupper($newnick) == $false ) && ( $newnick isvoice $_c ) ) {
    ; New nick is with lower case and previous is voiced
    mode $_c -v $newnick
  }
}

#uppercheck end

there ya go :D

 Respond  
Taerar   -  Sep 04, 2009

I've been playing with this script but I am at ends, I want it to do the opposite. I want it to voice upper case names and then devoice if they change to lower.

  • Rips hair out * x.x;
 Respond  
chexie   -  May 18, 2009

im totally green about scripts so im easy to impress, but i love this thing. thanks :)

 Respond  
Cheiron   -  Apr 06, 2008

many thanks for the feedback ToadKing. much appreciated my more unique snippets have found a working home heh. :)

 Respond  
ToadKing   -  Apr 06, 2008

Works like a charm! Thanks a million and keep up the good work.

 Respond  
EL   -  Mar 10, 2008

lol yeah i think i ll have to regex Perv outta connecting to my server tho lol.An an thanks i ll post a code some time soon i think.`-.-

 Respond  
Cheiron   -  Mar 10, 2008

hehehe.. well as avenue q sang... \"the internet is for porn\" so why not have Perv instead of Guest or Anon lol. thanks for the rating and welcome back :)

 Respond  
EL   -  Mar 10, 2008

Yes works.Nice nick selection btw XD

 Respond  
Cheiron   -  Mar 10, 2008

Yes. the first thing the script does is look for the first Letter of the nick. it will ignore anything before the first letter ( the ^ { [ ` ) etc. then it decides whether the first letter is a Capital or not. if it is not a capital, then it will give a voice. if the letter is a capital then it will not voice it. if however the nick changes from a lowercased to an upper case or vice versa, then the script will auto voice or devoice accordingly as per this example..

<09:43pm> oops 11<09:44pm> * afk` is now known as Perv3949 06<09:44pm> * Cheiron sets mode: -v Perv3949 11<09:44pm> * Perv3949 is now known as afk 06<09:44pm> * Cheiron sets mode: +v afk 11<09:44pm> * afk is now known as Perv40394 06<09:44pm> * Cheiron sets mode: -v Perv40394 11<09:44pm> * Perv40394 is now known as afk`` 06<09:44pm> * Cheiron sets mode: +v afk`` <09:45pm> lol <09:46pm> stupid irc smart eh
 Respond  
EL   -  Mar 10, 2008

Ahh nice like i said in the PM i sent you back,very unique as well.Ah an i was messin around for a few more minutes an i think you can make this even shorter.I made this in like a few minutes 2 lol i just thought of it after i sent the PM so i ll post it here.:

;Change the #channelname to a channel you have op in.
on @*:NICK:{
  if ($regex($newnick,/^[A-Z]/) == 1) { 
    mode #channelname +v $newnick
  }
  else {
    mode #channelname -v $nick
  }
}
on @*:JOIN:#channelname:{
  if ($regex($nick,/^[A-Z]/) == 1) {
    mode $chan +v $nick
  }
}

Tested it a few time seems to work.Good stuff anyways nice an refreshing to see codes done differently.\"Rate it or Hate it?\"...7/10.`-.-

P.S: Yea can add a loop to voice an devoice for multi channels depending on how many channel your bots on i guess.

 Respond  
Lindrian   -  Mar 09, 2008

The regex works, I havent tested your script.

 Respond  
Cheiron   -  Mar 09, 2008

nods still a bit out of my comprehension atm but i am slowly getting there on the learning side of things. just struggling to grasp the more advanced stuff atm. but appreciate the feedback as i do have a good readup on the help files on comments made by people.

many thanks Lindrian :)

ps.. did you test it at all to see it working?

 Respond  
Lindrian   -  Mar 09, 2008

ah.
You could just use:
$regex(nick,$1,/(\\w)/)
and
$isupper($regml(nick,1))

 Respond  
Cheiron   -  Mar 06, 2008

some nicks obviously are taken so in order to keep the nick, people use characters infront of the nick.. ie.. ^helen {helen} [helen] `helen etc..... what the script is doing is ignoring those characters until it finds the first letter. then it checks whether it is upper or lower case. if it is lowercase, then mode +v is given.. on change to an Uppercase letter at the start of the name.. the script will remove the voice. hope that clears it up.. the regex is there to sift through the code.. this was the original

uppercheck on

alias startwithupper {
if ( $1 == $null ) {
return $false
}
return $isupper($left($$1,1))
}

on @*:JOIN:#Channel:{
if ( $startwithupper($nick) == $true ) {
mode #Channel +v $nick
}
}

on @*:NICK:{
if ( ( $startwithupper($newnick) == $true ) && ( $newnick !isvoice #Channel ) ) {
; New nick is with upper case and previous is unvoiced
mode #Channel +v $newnick
}
if ( ( $startwithupper($newnick) == $false ) && ( $newnick isvoice #Channel ) ) {
; New nick is with lower case and previous is voiced
mode #Channel -v $newnick
}
}

uppercheck end

but that was for an uppercase nick getting the voice. sdamon did the debug for me with help from Warder to clean it up.\"i\'ve updated your code to check $1 whilst removing characters such as ` and {. I\'ve also dumped that long channel name into a local alias ($_c) to return it; makes it easier and cleaner\"

hope that answers your questions :)

 Respond  
Lindrian   -  Mar 06, 2008

I dont get this alias

alias startwithupper {
  if ( $1 ) {
    return $isupper($left($regsubex($$1,/\\W+/g,$null),1))
  }
  else return $false
}

Whats it supposed to do? Why do you use regsubex?

 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.