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.

on voice

Help for those learning Tcl or writing their own scripts.
Post Reply
b
blake
Master
Posts: 201
Joined: Mon Feb 23, 2009 9:42 am
Contact:

on voice

Post by blake »

Help changing to tcl

Code: Select all

on %*:VOICE:#CWCountdown: { mode # -v $vnick }
User avatar
username
Op
Posts: 196
Joined: Thu Oct 06, 2005 9:20 am
Location: Russian Federation, Podolsk
Contact:

Post by username »

Try it:

Code: Select all

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/
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

If you'd only want to catch +v modes, you could also use a more restrictive mask in your binding:

Code: Select all

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: Select all

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
User avatar
username
Op
Posts: 196
Joined: Thu Oct 06, 2005 9:20 am
Location: Russian Federation, Podolsk
Contact:

Post by username »

This is much better my code. It will be be a good lesson for me too.
Архив TCL скриптов для ботов Eggdrop/Windrop:
http://egghelp.ru/
Post Reply