| View previous topic :: View next topic |
| Author |
Message |
npax Voice
Joined: 24 Aug 2011 Posts: 2
|
Posted: Sat Mar 31, 2012 5:02 pm Post subject: botonchan for +inactive channel |
|
|
Why function [botonchan $chan] returns 1 for all bot's channels, including with +inactive option?
Same with [onchan $botnick $chan]
I use eggdrop 1.6.21
I know about [channel get $chan inactive] - it works, but the bot is not on inactive channels! |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Sat Mar 31, 2012 11:10 pm Post subject: Re: botonchan for +inactive channel |
|
|
| Quote: | <sp33chy> I am sp33chy, running eggdrop v1.6.17: 88 users (mem: 948k).
...
<sp33chy> OS: CYGWIN_NT-5.1 1.5.18(0.132/4/2)
<sp33chy> Tcl library: /cygdrive/f/sp33chy/lib/tcl8.4
<sp33chy> Tcl version: 8.4.11 (header version 8.4.11)
...
<speechles> .chanset #channel +inactive
<sp33chy> Successfully set modes { +inactive } on #channel.
<speechles> .tcl set a [botonchan #channel]
<sp33chy> Tcl: 0
<speechles> .tcl set a [onchan "sp33chy" "#channel"]
<sp33chy> Tcl: 0
<speechles> .chanset #channel -inactive
<sp33chy> Successfully set modes { -inactive } on #channel.
<speechles> .tcl set a [botonchan #channel]
<sp33chy> Tcl: 1
<speechles> .tcl set a [onchan "sp33chy" "#channel"]
<sp33chy> Tcl: 1 |
1.6.17 with tcl 8.4 ... This works as expected for me.... _________________ speechles' eggdrop tcl archive |
|
| Back to top |
|
 |
npax Voice
Joined: 24 Aug 2011 Posts: 2
|
Posted: Sun Apr 01, 2012 4:36 am Post subject: |
|
|
eggdrop v1.6.21
Tcl version: 8.5.10
trying script:
| Code: | bind pub m|m "!channels" pub:channels
proc pub:channels {nick host hand chan args} {
if {[lindex $args 0] == "on"} {
set active ""
foreach ch [channels] {
if {[botonchan $ch]} {
append active " $ch"
}
}
putserv "PRIVMSG $chan :Bot is on channels:$active"
} else {
putserv "PRIVMSG $chan :Channels list: [channels]"
}
}
|
commands:
!channels - all channels
!channels on - only active channels
both commands returns all channels, include +inactive ones
only if I replase
| Code: |
if {[botonchan $ch]} {
|
with
| Code: |
if {![channel get $ch inactive]} {
|
that works fine |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Sun Apr 01, 2012 6:00 am Post subject: |
|
|
Moved to Eggdrop Help section.
I've tested the same thing on my bot version 1.6.20 that's sitting on Undernet network (net-type 2) and I get the same result as you.
| Code: |
foreach cahn [channels] {
set status [channel get $chan inactive]
set onch [botonchan $chan]
putlog "chan: $chan | on channel: $onch | status: $status"
}
|
returns:
| Quote: |
chan: #chan1 | on channel: 1 | status: 0
chan: #chan2 | on channel: 1 | status: 1
|
This must be a bug or something.  _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
|