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 

Join/changenick script

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


Joined: 06 Dec 2008
Posts: 30

PostPosted: Sun Oct 18, 2009 3:24 pm    Post subject: Join/changenick script Reply with quote

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
View user's profile Send private message
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Sun Oct 18, 2009 5:31 pm    Post subject: Reply with quote

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


Joined: 06 Dec 2008
Posts: 30

PostPosted: Sun Oct 18, 2009 6:49 pm    Post subject: Reply with quote

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
View user's profile Send private message
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Sun Oct 18, 2009 6:52 pm    Post subject: Reply with quote

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