| View previous topic :: View next topic |
| Author |
Message |
ein7opf Voice
Joined: 16 Aug 2006 Posts: 19
|
Posted: Wed Aug 16, 2006 9:34 am Post subject: addchannel on allvoive.tcl |
|
|
hi,
i have got a question about allvoice.tcl
the option is:
set avchan "" /// this means that allvoice is enabled on all channels.
set avchan "#channel" /// works only on inserted channel.
i want that autovice is enabled for 2 channels.
how can i add more than 1 channel?
i don`t know what i have to put in there to make it work. |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Wed Aug 16, 2006 12:08 pm Post subject: |
|
|
and we don't know what allvoice.tcl is _________________ connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code |
|
| Back to top |
|
 |
ein7opf Voice
Joined: 16 Aug 2006 Posts: 19
|
Posted: Wed Aug 16, 2006 12:36 pm Post subject: |
|
|
sorry. here is the script i`m talkin abot.
| Code: | ## 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" |
|
|
| Back to top |
|
 |
dusk Halfop

Joined: 06 Mar 2005 Posts: 91 Location: Belgium
|
Posted: Wed Aug 16, 2006 1:42 pm Post subject: |
|
|
I guess you just leave a space between two inserted chans. | Code: |
set avchan "#channel1 #channel2" |
GRTZ _________________ me likes me eggie  |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Wed Aug 16, 2006 2:42 pm Post subject: |
|
|
Something like this would be better:
| Code: |
set avchat [list "#channel1" "#channel2"]
|
foreach really works much better on lists than strings..
Also, think lsearch would be faster than manually scanning through the whole list using foreach
| Code: |
set avchan [list]
#set avchan [list [string tolower "#mychan"] [string tolower "#mychan2"]]
bind join - * avjoin
proc avjoin {nick uhost hand chan} {
global avchan botnick
if {$nick == $botnick} {return 0}
set chan [string tolower $chan]
if {[botisop $chan] && ([llength $avchan] == 0 || [lsearch $avchan $chan] >= 0)} {
pushmode $chan +v $nick
return 0
}
} |
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..) _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
ein7opf Voice
Joined: 16 Aug 2006 Posts: 19
|
Posted: Wed Aug 16, 2006 8:26 pm Post subject: |
|
|
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?
so long i allvoice all my channel. |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Thu Aug 17, 2006 6:18 am Post subject: |
|
|
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. _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
ein7opf Voice
Joined: 16 Aug 2006 Posts: 19
|
Posted: Thu Aug 17, 2006 7:39 am Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Thu Aug 17, 2006 11:16 am Post subject: |
|
|
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.. _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Thu Aug 17, 2006 4:50 pm Post subject: |
|
|
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.
| Code: |
setudef flag allvoice
bind join - * avjoin
proc avjoin {nick uhost hand chan} {
if {[isbotnick $nick] || ![channel get $chan allvoice] || ![botisop $chan]} {
return
}
pushmode $chan +v $nick
}
|
Just ".chanset #channel +allvoice" to enable the *all voice* on a specific channel and to disable it. _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
ein7opf Voice
Joined: 16 Aug 2006 Posts: 19
|
Posted: Sat Aug 19, 2006 7:48 am Post subject: |
|
|
| i am running eggdrop V1.6.17 |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Sat Aug 19, 2006 8:07 am Post subject: |
|
|
@caesar: Nice one (Makes me wonder why I did'nt think of that myself)
2ein7opf: Well, think you've stumbled across a possible new utf-8 bug :/
Do you get any coredumps when it crashes? Any context-backtraces? _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
ein7opf Voice
Joined: 16 Aug 2006 Posts: 19
|
Posted: Sat Aug 19, 2006 8:08 am Post subject: |
|
|
thank you caesar. now everything is working fine.
thank all of you for quick responding and nice ideas. |
|
| Back to top |
|
 |
|