This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

script to autovoice nicks that start with lower case letter

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
S
ScaryBikerGuy
Voice
Posts: 2
Joined: Wed Feb 11, 2009 6:46 pm

script to autovoice nicks that start with lower case letter

Post by ScaryBikerGuy »

Hi folks,

I've googled and checked the archive, but haven't been able to locate a TCL script for our little eggdrop which will auto voice nicks on entry to a room.

The catch is that nicks which should be auto-voiced should only be those that have a lower case letter as the 1st letter...and has to work with nicks that contain curly or square brackets.

Any help or pointers would be truly appreciated.

Regards,
-Ray
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

Code: Select all

setudef flag autovoicejoin

bind join - * join:autovoice

proc join:autovoice {nick host hand chan} {
	if {[channel get $chan "autovoicejoin"]} {
		foreach letter [split $nick ""] {
			if {![regexp {[a-zA-Z]} $letter]} { continue }
			if {[string equal [string tolower $letter] $letter]} {
				pushmode $chan +v $nick
				break
			} else {
				pushmode $chan -v $nick
				break
			}
		}
	flushmode $chan
	}
}
If the nick is [-{eggy}-] or {{_egg_}} the script will know, the first letter is lowercase and voice the person. You didn't mention what to do when non alphabetical chars are used, and what I've done is skip them, until we find the first letter used. If it's lowercase indeed, the person is voiced, otherwise it will devoice them. Which most ircd's won't issue the devoice to a user already devoiced, so really nothing happens that was just for you, to edit later and add something denoting lowercase is favored, etc..

To use it dcc chat your bot and .chanset #yourchan +autovoicejoin
S
ScaryBikerGuy
Voice
Posts: 2
Joined: Wed Feb 11, 2009 6:46 pm

Post by ScaryBikerGuy »

wow...thank you so much!

the irc network won't allow non letter 1st chars so we are just perfectly set.

thanks so much!!

-R
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

why not use regexp? :)

Post by user »

Code: Select all

proc join:autovoice {nick uhost hand chan} {
	if {[channel get $chan autovoicejoin]&&[regexp {^[^A-Za-z]*[a-z]} $nick]} {
		pushmode $chan +v $nick
	}
}
Have you ever read "The Manual"?
S
Salik83
Voice
Posts: 6
Joined: Sun Apr 19, 2009 5:12 pm
Location: Pk

Need little help

Post by Salik83 »

hello guys,

i have some autovoice tcl, but i just want to add some ips so user wont get voice matching those ips.
or some code that will add user if global op or master type in channel .human nick and nick will automatically added to the channel +g list? :/ sorry for my bad english!
L
Lord_Haus
Voice
Posts: 1
Joined: Tue Nov 23, 2010 11:15 am

lower autovoice

Post by Lord_Haus »

I copied that small script and tried it, it crashed the bot, soo was it a add on to another script that i missed? if so what script was it be added to so i can use it for my bot.
Post Reply