| View previous topic :: View next topic |
| Author |
Message |
blake Master
Joined: 23 Feb 2009 Posts: 201
|
Posted: Sat Jan 02, 2010 3:42 pm Post subject: on voice |
|
|
Help changing to tcl
| Code: | on %*:VOICE:#CWCountdown: { mode # -v $vnick }
|
_________________ Blake
UKEasyHosting UKStormWatch |
|
| Back to top |
|
 |
username Op

Joined: 06 Oct 2005 Posts: 196 Location: Russian Federation, Podolsk
|
Posted: Sat Jan 02, 2010 5:56 pm Post subject: |
|
|
Try it:
| Code: | bind mode - * onvoice
proc onvoice {nick uhost hand chan mode victim} {
if {$mode == "+v" && $chan == "#CWCountdown"} {
putserv "MODE $chan :-v $victim"
}
}
|
_________________ Архив TCL скриптов для ботов Eggdrop/Windrop:
http://egghelp.ru/ |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Sun Jan 03, 2010 6:30 am Post subject: |
|
|
If you'd only want to catch +v modes, you could also use a more restrictive mask in your binding:
| Code: | bind mode - "% +v" yourproc
proc yourproc {nick host handle channel mode {target ""}} {
set tmp [split $mode]
if {$target == ""} {
set target [lindex $tmp 1]
}
pushmode $chan -v $target
} |
The above code also includes a compability-fix to make it work with older (1.3.17 and older) eggdrops.
If you'd further want to limit the script to a single channel, further retrict your mask:
| Code: | | bind mode - "#mychan +v" yourproc |
This also saves you the issue of the case-sensitive matching done with username's code. You could get around this by using the string compare or string equal commands with the -nocase option though.. _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
username Op

Joined: 06 Oct 2005 Posts: 196 Location: Russian Federation, Podolsk
|
Posted: Sun Jan 03, 2010 7:04 am Post subject: |
|
|
This is much better my code. It will be be a good lesson for me too. _________________ Архив TCL скриптов для ботов Eggdrop/Windrop:
http://egghelp.ru/ |
|
| Back to top |
|
 |
|