| View previous topic :: View next topic |
| Author |
Message |
JKM Voice
Joined: 06 Dec 2008 Posts: 30
|
Posted: Sun Oct 18, 2009 3:24 pm Post subject: Join/changenick script |
|
|
Neither of these scripts are working, and I'm wondering what's wrong. | Code: | set tagChans "#chan"
bind join - {% TAG|*} voice:user
bind nick - {% TAG|*} voice:user
bind nick - * devoice:user
bind join - #chan2 msg:chanjoin
proc voice:user {nick uhost hand chan {nn ""}} {
if {$nn == ""} {set nn $nick}
if {[lsearch -exact [split [string tolower #chan]] [string tolower $chan]] != -1 && ![isvoice $nn $chan]} {
pushmode $chan +v $nn
}
}
proc devoice:user {nick uhost hand chan nn} {
if {[lsearch -exact [split [string tolower #chan]] [string tolower $chan]] != -1 && ![string match -nocase tag|* $nn] &&
[isvoice $nn $chan]} {
pushmode $chan -v $nn
}
}
proc msg:gsjoin {nick host handle chan text} {
putserv "PRIVMSG $chan :Hey, $nick! Welcome."
} |
|
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Sun Oct 18, 2009 5:31 pm Post subject: |
|
|
tagChans = list of channels to care about
tagTag = tag we are checking for
| Code: | set tagChans "#chan1 #chan2 #etc"
set tagTag "TAG|"
bind join - "% $tagTag*" voice:user
bind nick - "% $tagTag*" voice:user
bind nick - * devoice:user
bind join - #chan2 msg:chanjoin
proc voice:user {nick uhost hand chan {nn ""}} {
if {$nn == ""} {set nn $nick}
if {[lsearch -exact [split [string tolower $::tagChans]] [string tolower $chan]] != -1 && ![isvoice $nn $chan]} {
pushmode $chan +v $nn
}
}
proc devoice:user {nick uhost hand chan nn} {
if {[lsearch -exact [split [string tolower $::tagChans]] [string tolower $chan]] != -1 && ![string match -nocase $::tagTag* $nn] &&
[isvoice $nn $chan]} {
pushmode $chan -v $nn
}
}
proc msg:gsjoin {nick host handle chan text} {
putserv "PRIVMSG $chan :Hey, $nick! Welcome."
} |
_________________ speechles' eggdrop tcl archive |
|
| Back to top |
|
 |
JKM Voice
Joined: 06 Dec 2008 Posts: 30
|
Posted: Sun Oct 18, 2009 6:49 pm Post subject: |
|
|
Thanks, but this one doesn't work either:
| Code: |
bind join - #chan2 msg:chanjoin
proc msg:chanjoin {nick host handle chan text} {
putserv "PRIVMSG $chan :Hey, $nick! Welcome."
} | (Just a welcome message to everyone that joins) |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Sun Oct 18, 2009 6:52 pm Post subject: |
|
|
That is because join has only 4 arguments passed nick, host, handle and channel. Yet you've included text making it 5. Joins do not pass this additional argument for text. Simply change it to look as it does below: | Code: | bind join - #chan2 msg:chanjoin
proc msg:chanjoin {nick host handle chan} {
putserv "PRIVMSG $chan :Hey, $nick! Welcome."
} |
_________________ speechles' eggdrop tcl archive |
|
| Back to top |
|
 |
|