This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Current console channel

Old posts that have not been replied to for several years.
Locked
User avatar
arfer
Master
Posts: 436
Joined: Fri Nov 26, 2004 8:45 pm
Location: Manchester, UK

Current console channel

Post by arfer »

Can you tell me how to find the current console channel name programatically.

ie. The IRC channel that the bot would output a .say command to
s
spock
Master
Posts: 319
Joined: Thu Dec 12, 2002 8:40 pm

Post by spock »

Code: Select all

set c [lindex [console $idx] 0]
photon?
User avatar
arfer
Master
Posts: 436
Joined: Fri Nov 26, 2004 8:45 pm
Location: Manchester, UK

Post by arfer »

Cheers spock ... spot on
User avatar
arfer
Master
Posts: 436
Joined: Fri Nov 26, 2004 8:45 pm
Location: Manchester, UK

Post by arfer »

On second thoughts this doesnt seem to work

It notifies of leaving partyline, but not joining

Perhaps [lindex [console $idx] 0] is meaningless if i'm not already on the partyline

Can anybody help?

# is notify off (0) or on (1) by default
set vNotifyStatus 1

bind CHON -|- * pNotifyOnline

proc pNotifyOnline {hand idx} {
global vNotifyChannels
global vNotifyStatus
if {$vNotifyStatus == 1} {
set vDefaultChannel [lindex [console $idx] 0]
putserv "PRIVMSG $vDefaultChannel :[hand2nick $hand] \([getchanhost [hand2nick $hand]]\) joined the partyline \(idx $idx\)"
}
}

bind CHOF -|- * pNotifyOffline

proc pNotifyOffline {hand idx} {
global vNotifyChannels
global vNotifyStatus
if {$vNotifyStatus == 1} {
set vDefaultChannel [lindex [console $idx] 0]
putserv "PRIVMSG $vDefaultChannel :[hand2nick $hand] \([getchanhost [hand2nick $hand]]\) left the partyline"
}
}
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

This must be a bug or due to lazyness...the console channel is reported to be "***" in a proc invoked by a CHON bind. As a workaround, use CHJN instead. (make the mask "0" if you only want to monitor people joining the partyline)
Have you ever read "The Manual"?
User avatar
arfer
Master
Posts: 436
Joined: Fri Nov 26, 2004 8:45 pm
Location: Manchester, UK

Post by arfer »

Thanks but I can't seem to get CHJN to work in the script as it currently stands, perhaps because there's a limitation on the flags allowed (one of *, +, @, %)

I'm not sure I follow this exactly. Would a flag setting of * mean that it only reports owner as having joined the partyline?
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

arfer wrote:Thanks but I can't seem to get CHJN to work in the script as it currently stands, perhaps because there's a limitation on the flags allowed (one of *, +, @, %)

I'm not sure I follow this exactly. Would a flag setting of * mean that it only reports owner as having joined the partyline?
That's not flags...that's the flag argument passed to the proc invoked by the bind...check '.help whois' for a list of flags. Use "-" in the bind to make it trigger no matter who joins the channel. (You did notice the number of arguments is differen, right?)
Have you ever read "The Manual"?
User avatar
arfer
Master
Posts: 436
Joined: Fri Nov 26, 2004 8:45 pm
Location: Manchester, UK

Post by arfer »

thanks 'user'
than one worked just fine

i dunno, you experts would be lost without us newbies :P
Locked