egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

on voice

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
blake
Master


Joined: 23 Feb 2009
Posts: 201

PostPosted: Sat Jan 02, 2010 3:42 pm    Post subject: on voice Reply with quote

Help changing to tcl

Code:
on %*:VOICE:#CWCountdown: { mode # -v $vnick }

_________________
Blake
UKEasyHosting UKStormWatch
Back to top
View user's profile Send private message Visit poster's website
username
Op


Joined: 06 Oct 2005
Posts: 196
Location: Russian Federation, Podolsk

PostPosted: Sat Jan 02, 2010 5:56 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Sun Jan 03, 2010 6:30 am    Post subject: Reply with quote

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
View user's profile Send private message
username
Op


Joined: 06 Oct 2005
Posts: 196
Location: Russian Federation, Podolsk

PostPosted: Sun Jan 03, 2010 7:04 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber