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 

botonchan for +inactive channel

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


Joined: 24 Aug 2011
Posts: 2

PostPosted: Sat Mar 31, 2012 5:02 pm    Post subject: botonchan for +inactive channel Reply with quote

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


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

PostPosted: Sat Mar 31, 2012 11:10 pm    Post subject: Re: botonchan for +inactive channel Reply with quote

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


Joined: 24 Aug 2011
Posts: 2

PostPosted: Sun Apr 01, 2012 4:36 am    Post subject: Reply with quote

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


Joined: 14 Oct 2001
Posts: 3584
Location: Mint Factory

PostPosted: Sun Apr 01, 2012 6:00 am    Post subject: Reply with quote

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. Rolling Eyes
_________________
I tawt I taw a puddy tat!
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 -> Eggdrop 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