<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/17107" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2009-08-18T15:15:51-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/17107</id>

		<entry>
		<author><name><![CDATA[arfer]]></name></author>
		<updated>2009-08-18T15:15:51-04:00</updated>

		<published>2009-08-18T15:15:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=89956#p89956</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=89956#p89956"/>
		<title type="html"><![CDATA[Check if a user is inside a specific channel]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=89956#p89956"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code># whoischan.tcl# functions in any IRC bot channel where colour output is allowed# note that a user will appear not to be in a channel if the channel mode is +s (secret) unless the bot is on the same channel# syntax (assuming default command trigger !)# !channel &lt;nick&gt; ?#channel?# !channel &lt;nick&gt; without the optional ?#channel? returns all the channels &lt;nick&gt; is on# !channel &lt;nick&gt; ?#channel? confirms whether &lt;nick&gt; is on that specific ?#channel? or not# set here the time allowed in seconds for a response to the network /WHOISset vChanWhoisTime 20# set here the command triggerset vChanWhoisTrigger !proc pChanWhoisTrigger {} {    global vChanWhoisTrigger    return $vChanWhoisTrigger}bind PUB - [pChanWhoisTrigger]channel pChanWhoisSendbind RAW - 312 pChanWhoisInfobind RAW - 402 pChanWhoisOfflinebind RAW - 319 pChanWhoisChannelsbind RAW - 318 pChanWhoisEndproc pChanWhoisCancelUtimer {} {    foreach item [utimers] {        if {[string equal pChanWhoisTimeout [lindex $item 1]]} {            killutimer [lindex $item 2]        }    }    return 0}proc pChanWhoisCancelWhois {} {    global vChanWhoisSourceNick vChanWhoisTargetNick vChanWhoisSourceChan vChanWhoisTargetChan vChanWhoisResult    if {[info exists vChanWhoisSourceNick]} {unset vChanWhoisSourceNick}    if {[info exists vChanWhoisTargetNick]} {unset vChanWhoisTargetNick}    if {[info exists vChanWhoisSourceChan]} {unset vChanWhoisSourceChan}    if {[info exists vChanWhoisTargetChan]} {unset vChanWhoisTargetChan}    if {[info exists vChanWhoisResult]} {unset vChanWhoisResult}    return 0}proc pChanWhoisChannels {from keyword text} {    global vChanWhoisTargetNick vChanWhoisResult    if {[info exists vChanWhoisTargetNick]} {        set target [lindex [split [stripcodes bcruag $text]] 1]        if {[string equal -nocase $target $vChanWhoisTargetNick]} {            set vChanWhoisResult [string trimleft [join [lrange [split [stripcodes bcruag $text]] 2 end]] :]        }    }    return 0}proc pChanWhoisEnd {from keyword text} {    global vChanWhoisSourceChan vChanWhoisTargetChan vChanWhoisSourceNick vChanWhoisTargetNick vChanWhoisResult    if {[info exists vChanWhoisTargetNick]} {        set target [lindex [split [stripcodes bcruag $text]] 1]        if {[string equal -nocase $target $vChanWhoisTargetNick]} {            if {[info exists vChanWhoisResult]} {                switch -- [string length $vChanWhoisTargetChan] {                    0 {putserv "PRIVMSG $vChanWhoisSourceChan :($vChanWhoisSourceNick) (\00310whois\003) .. channels for $vChanWhoisTargetNick are $vChanWhoisResult"}                    default {                        set vChanWhoisResult [regsub -all -- {[+@]} $vChanWhoisResult ""]                        if {[lsearch -exact [split [string tolower $vChanWhoisResult]] [string tolower $vChanWhoisTargetChan]] != -1} {                            putserv "PRIVMSG $vChanWhoisSourceChan :($vChanWhoisSourceNick) (\00310whois\003) .. $vChanWhoisTargetNick is on $vChanWhoisTargetChan"                        } else {putserv "PRIVMSG $vChanWhoisSourceChan :($vChanWhoisSourceNick) (\00310whois\003) .. $vChanWhoisTargetNick is not on $vChanWhoisTargetChan"}                    }                }            } else {putserv "PRIVMSG $vChanWhoisSourceChan :($vChanWhoisSourceNick) (\00310whois\003) .. $vChanWhoisTargetNick is online but not on any channels"}            pChanWhoisCancelWhois        }    }    return 0}proc pChanWhoisInfo {from keyword text} {    global vChanWhoisTargetNick    if {[info exists vChanWhoisTargetNick]} {        set target [lindex [split [stripcodes bcruag $text]] 1]        if {[string equal -nocase $target $vChanWhoisTargetNick]} {            pChanWhoisCancelUtimer        }    }    return 0}proc pChanWhoisOffline {from keyword text} {    global vChanWhoisSourceNick vChanWhoisTargetNick vChanWhoisSourceChan    if {[info exists vChanWhoisTargetNick]} {        set target [lindex [split [stripcodes bcruag $text]] 1]        if {[string equal -nocase $target $vChanWhoisTargetNick]} {            putserv "PRIVMSG $vChanWhoisSourceChan :($vChanWhoisSourceNick) (\00304error\003) .. $vChanWhoisTargetNick is not online"            pChanWhoisCancelUtimer            pChanWhoisCancelWhois        }    }    return 0}proc pChanWhoisSend {nick uhost hand chan text} {    global vChanWhoisSourceChan vChanWhoisTargetChan vChanWhoisSourceNick vChanWhoisTargetNick vChanWhoisTime    set arguments [string trim $text]    switch -- [llength [split $arguments]] {        1 {set vChanWhoisTargetChan ""}        2 {set vChanWhoisTargetChan [lindex [split $arguments] 1]}        default {            putserv "PRIVMSG $chan :($nick) (\00304error\003) .. correct syntax is [pChanWhoisTrigger]channel &lt;nick&gt; ?#channel?"            return 0        }    }    set vChanWhoisTargetNick [lindex [split $arguments] 0]    if {[regexp -- {^[\x41-\x7D][-\d\x41-\x7D]*$} $vChanWhoisTargetNick]} {        if {([string length $vChanWhoisTargetChan] == 0) || ([regexp -- {^#} $vChanWhoisTargetChan])} {            set vChanWhoisSourceNick $nick            set vChanWhoisSourceChan $chan            putserv "WHOIS $vChanWhoisTargetNick $vChanWhoisTargetNick"            utimer $vChanWhoisTime pChanWhoisTimeout        } else {putserv "PRIVMSG $chan :($nick) (\00304error\003) .. $vChanWhoisTargetChan is not a valid channel name"}    } else {putserv "PRIVMSG $chan :($nick) (\00304error\003) .. $vChanWhoisTargetNick is not a valid nick"}    return 0}proc pChanWhoisTimeout {} {    global vChanWhoisSourceNick vChanWhoisTargetNick vChanWhoisSourceChan    putserv "PRIVMSG $vChanWhoisSourceChan :($vChanWhoisSourceNick) (\00304error\003) .. whois operation timed out awaiting channel info for $vChanWhoisTargetNick"    pChanWhoisCancelWhois    return 0}# eof</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5705">arfer</a> — Tue Aug 18, 2009 3:15 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[arfer]]></name></author>
		<updated>2009-08-18T09:55:22-04:00</updated>

		<published>2009-08-18T09:55:22-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=89952#p89952</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=89952#p89952"/>
		<title type="html"><![CDATA[Check if a user is inside a specific channel]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=89952#p89952"><![CDATA[
You need to elaborate a little.<br><br>The code required to establish if a nickname is on one of the same IRC channels as the bot is easy.<br><br>onchan &lt;nick&gt; ?channel?<br><br>However, finding out if a nickname is on any specific IRC channel (or indeed online at all) is rather more difficult. It would require sending a network /WHOIS and interpreting the appropriate RAW responses.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5705">arfer</a> — Tue Aug 18, 2009 9:55 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[boehmi]]></name></author>
		<updated>2009-08-18T08:38:35-04:00</updated>

		<published>2009-08-18T08:38:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=89950#p89950</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=89950#p89950"/>
		<title type="html"><![CDATA[Check if a user is inside a specific channel]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=89950#p89950"><![CDATA[
As the title says i want to check if a nickname is inside a specific channel<br>but i have absolutely no idea how to do this or what i have to look for <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><br><br>Can you help me?<br><br>Thank you<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10592">boehmi</a> — Tue Aug 18, 2009 8:38 am</p><hr />
]]></content>
	</entry>
	</feed>
