| View previous topic :: View next topic |
| Author |
Message |
sjones Voice
Joined: 04 Nov 2005 Posts: 16
|
Posted: Fri Nov 04, 2005 4:09 pm Post subject: autovoice script |
|
|
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! |
|
| Back to top |
|
 |
avilon Halfop

Joined: 13 Jul 2004 Posts: 64 Location: Germany
|
Posted: Fri Nov 04, 2005 5:48 pm Post subject: |
|
|
Wrong forum! Script Requests
| Code: | 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 |
|
| Back to top |
|
 |
NTHosts Op
Joined: 10 Oct 2005 Posts: 100 Location: UK
|
Posted: Sat Nov 05, 2005 12:07 pm Post subject: erm... |
|
|
dood this is script requests  _________________ www.NT-Hosts.Net - More than just a host |
|
| Back to top |
|
 |
avilon Halfop

Joined: 13 Jul 2004 Posts: 64 Location: Germany
|
Posted: Sat Nov 05, 2005 12:15 pm Post subject: |
|
|
Oh.. really?
This thread was moved by a mod  |
|
| Back to top |
|
 |
sjones Voice
Joined: 04 Nov 2005 Posts: 16
|
Posted: Sun Nov 06, 2005 10:10 am Post subject: |
|
|
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  |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sun Nov 06, 2005 10:25 am Post subject: |
|
|
There's no +m on op in avilon's code. Are you using some other script? _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
sjones Voice
Joined: 04 Nov 2005 Posts: 16
|
Posted: Sun Nov 06, 2005 10:44 am Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sun Nov 06, 2005 6:35 pm Post subject: |
|
|
Did you replace #yourchannel with the channel where you want the script to work? _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
sjones Voice
Joined: 04 Nov 2005 Posts: 16
|
Posted: Thu Nov 10, 2005 3:21 pm Post subject: |
|
|
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  |
|
| Back to top |
|
 |
avilon Halfop

Joined: 13 Jul 2004 Posts: 64 Location: Germany
|
Posted: Thu Nov 10, 2005 4:49 pm Post subject: |
|
|
| Code: | 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]
}
} |
|
|
| Back to top |
|
 |
sjones Voice
Joined: 04 Nov 2005 Posts: 16
|
Posted: Thu Nov 10, 2005 5:04 pm Post subject: |
|
|
Thanks very much avilon, that's perfect  |
|
| Back to top |
|
 |
sjones Voice
Joined: 04 Nov 2005 Posts: 16
|
Posted: Sat Nov 12, 2005 6:42 pm Post subject: |
|
|
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? |
|
| Back to top |
|
 |
sjones Voice
Joined: 04 Nov 2005 Posts: 16
|
Posted: Sat Nov 12, 2005 7:07 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sat Nov 12, 2005 7:50 pm Post subject: |
|
|
I don't think this should cause a problem but anyway, add this line to the first 2 procs (part and join)
| Code: | | set host [string trimleft $host ~] |
and this to the third (mode)
| Code: | | set thost [string trimleft [getchanhost $target $chan] ~] |
and replace
| Code: | | if {[set foo [lsearch -exact $dontvoice($chan) [getchanhost $target $chan]]]!="-1"} { |
with
| Code: | | if {[set foo [lsearch -exact $dontvoice($chan) $thost]]!="-1"} { |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
sjones Voice
Joined: 04 Nov 2005 Posts: 16
|
Posted: Sat Nov 12, 2005 8:00 pm Post subject: |
|
|
That's perfect, thank you so much  |
|
| Back to top |
|
 |
|