## allvoice.tcl
## - voices everyone in a channel when they join
# What channels should this work on?
# - note, "" is for all channels
set avchan ""
## Begin the code
bind join - * avjoin
proc avjoin {nick uhost hand chan} {
global avchan botnick
if {$nick == $botnick} {return 0}
if {$avchan == "" && [botisop $chan]} {
pushmode $chan +v $nick
return 0
}
set chan [string tolower $chan]
foreach i [string tolower $avchan] {
if {$i == $chan && [botisop $chan]} {
pushmode $chan +v $nick
return 0
}
}
}
putlog "Loaded allvoice.tcl by guppy"
foreach really works much better on lists than strings..
Also, think lsearch would be faster than manually scanning through the whole list using foreach
Anyway, using list when setting avchan would be mandatory (unless you really got a fetish of building valid list-structures manually ), rewritten code is purely optional, guppy's original code should work fine I guess (or well, "string tolower" should'nt damage the list-structure, but that's just my guess..)
hey, thank you for responding so fast.
both ways to put the channels in are causing a crashed down eggdrop.
your scipt works fine! thx for this great idea!
i think the problem is the name of one channel it have to work on.
the channelname includes specieal characters the channelname is #°o°.gn
and your postet script work on every channel except #°o°.gn
is there a way to make it work with these characters used in the channelname?
Does the script crash, or does your whole eggdrop crash?
Extended character-sets have been an issue with eggdrop possibly since the beginning of times (well, sorta). Some older eggies had some seriuos issues with utf-8 and tcl, tho that's supposed to be somewhat solved now.
Unfortunately, I can't think of a quick-fix right now.
when i use "allvoice.tcl" and try to add the channel #°o°.gn (in both ways of tryn to put in "chan1" "chan2" or "chan1 chan2") my my whole eggdrop chrashes down. when i use your script everything is fine but nothing happens on #°o°.gn when somebody joins. on every other channel it works fine.
To summarize then; using list-commands on "broken" lists with extended charset crashes your bot. This means you've stumbled across a bug in either eggdrop or tcl.
Could you post some info on which version of eggdrop and tcl you're using. Also, if your bot generates any debug-info on crash, that would also be nice..
I would go for something less complicated than having to edit the .tcl file each time I want either to add or remove a channel from the *allvoice* channels list. I'd go for a user defined channel setting, like allvoice for instance, that can be enabled/disabled via dcc chat or telnet with the eggdrop.