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.

autovoice script

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
s
sjones
Voice
Posts: 16
Joined: Fri Nov 04, 2005 4:06 pm

autovoice script

Post by sjones »

Hi guys,
I'm looking for a script that will voice everyone who enters a channel, but also keeps track when someone is devoiced so that if this user parts and joins again they are not voiced by the bot.

Do you think this would be possible?

Thanks for your help!
User avatar
avilon
Halfop
Posts: 64
Joined: Tue Jul 13, 2004 6:58 am
Location: Germany

Post by avilon »

Wrong forum! Script Requests

Code: Select all

bind join - "#yourchannel *" av:join
bind part - "#yourchannel *" av:part

proc av:join {nick host hand chan} {
	global dontvoice
	if ![info exists dontvoice($chan)] { set dontvoice($chan) [list] }
	if {[botisop $chan]&&[lsearch -exact $dontvoice($chan) $host]=="-1"} {
		utimer 2 [list pushmode $chan +v $nick]
	}
}

proc av:part {nick host hand chan {msg ""}} {
	global dontvoice
	if ![info exists dontvoice($chan)] { set dontvoice($chan) [list] }
	if {![isbotnick $nick]&&![isvoice $nick $chan]&&![isop $nick $chan]&&[lsearch -exact $dontvoice($chan) $host]=="-1"} {
		lappend dontvoice($chan) $host
		timer 5 [list set dontvoice($chan) [lreplace $dontvoice($chan) [set foo [lsearch -exact $dontvoice($chan) $host]] $foo]]
	}
} 
As always, not tested!
Last edited by avilon on Sat Nov 05, 2005 12:25 pm, edited 1 time in total.
N
NTHosts
Op
Posts: 100
Joined: Mon Oct 10, 2005 9:57 pm
Location: UK
Contact:

erm...

Post by NTHosts »

dood this is script requests :P
www.NT-Hosts.Net - More than just a host
User avatar
avilon
Halfop
Posts: 64
Joined: Tue Jul 13, 2004 6:58 am
Location: Germany

Post by avilon »

Oh.. really?
This thread was moved by a mod :lol:
s
sjones
Voice
Posts: 16
Joined: Fri Nov 04, 2005 4:06 pm

Post by sjones »

Thanks alot for the speedy reply everyone, and sorry for creating the thread in the wrong forum doh!

I've loaded this script, and when I op the bot it sets +m channel mode, but does not op anyone who enters the channel. I've no idea about tcl so I can't try to figure out what could be wrong with the code :(
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

There's no +m on op in avilon's code. Are you using some other script?
s
sjones
Voice
Posts: 16
Joined: Fri Nov 04, 2005 4:06 pm

Post by sjones »

Hehe no sorry, that's set in the bot's config for the channel, the channelmodes are +nmt so that's why it sets it to +m.
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Did you replace #yourchannel with the channel where you want the script to work?
s
sjones
Voice
Posts: 16
Joined: Fri Nov 04, 2005 4:06 pm

Post by sjones »

Yes I did :) and it voices people who enter now. If I devoice them, and they part and rejoin they do not get voiced, which is excellent. However If I voice them, and they then part and rejoin, the bot does not voice them again. Could I perhaps get this feature too, if you don't mind?

Sorry for the trouble guys - we're nearly there though :)
User avatar
avilon
Halfop
Posts: 64
Joined: Tue Jul 13, 2004 6:58 am
Location: Germany

Post by avilon »

Code: Select all

bind mode - "#yourchannel +v" av:mode

proc av:mode {nick host hand chan mode {target ""}} {
	global dontvoice
	if ![info exists dontvoice($chan)] return
	if {[set foo [lsearch -exact $dontvoice($chan) [getchanhost $target $chan]]]!="-1"} {
		set dontvoice($chan) [lreplace $dontvoice($chan) $foo $foo]
	}
}
s
sjones
Voice
Posts: 16
Joined: Fri Nov 04, 2005 4:06 pm

Post by sjones »

Thanks very much avilon, that's perfect :)
s
sjones
Voice
Posts: 16
Joined: Fri Nov 04, 2005 4:06 pm

Post by sjones »

Hi guys, for some reason this script does not work on either ip addresses of if the ident has ~.

Does anyone know how to overcome this?
s
sjones
Voice
Posts: 16
Joined: Fri Nov 04, 2005 4:06 pm

Post by sjones »

hi everyone, just tested it now, it's definately just if the host has a ~ in the ident, so if it's sjones@whatever it's fine, but if it's ~sjones@whatever it's not.

So, if they have a ~ in the ident, it will voice them after I devoic them and they part then join.
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

I don't think this should cause a problem but anyway, add this line to the first 2 procs (part and join)

Code: Select all

set host [string trimleft $host ~]
and this to the third (mode)

Code: Select all

set thost [string trimleft [getchanhost $target $chan] ~]
and replace

Code: Select all

if {[set foo [lsearch -exact $dontvoice($chan) [getchanhost $target $chan]]]!="-1"} {
with

Code: Select all

if {[set foo [lsearch -exact $dontvoice($chan) $thost]]!="-1"} {
s
sjones
Voice
Posts: 16
Joined: Fri Nov 04, 2005 4:06 pm

Post by sjones »

That's perfect, thank you so much :)
Post Reply