<?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/20901" />

	<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>2021-01-07T02:13:18-04:00</updated>

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

		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2021-01-07T02:13:18-04:00</updated>

		<published>2021-01-07T02:13:18-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109322#p109322</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109322#p109322"/>
		<title type="html"><![CDATA[Join Module]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109322#p109322"><![CDATA[
You don't need to do if {statement} and then do the same if but negate it like here:<div class="codebox"><p>Code: </p><pre><code> if {[validchan $chan} {      puthelp "NOTICE $nick :$::fzcom(logo): I'm already on $chan"      return 0   }   if {![validchan $chan]} {    channel add $chan    puthelp "NOTICE $nick :$fzcom(logo):$chan added in my chanlist."   } </code></pre></div>you can use <em class="text-italics">if then else</em> instead like this:<div class="codebox"><p>Code: </p><pre><code>if {[validchan $chan} {puthelp "NOTICE $nick :$::fzcom(logo): I'm already on $chan"} else {channel add $chanputhelp "NOTICE $nick :$fzcom(logo):$chan added in my chanlist."} </code></pre></div>And to extend the <em class="text-italics">botonchan</em> suggestion would be something easy like:<div class="codebox"><p>Code: </p><pre><code>if {[validchan $chan} {if {![botonchan $chan]} {puthelp "NOTICE $nick :$::fzcom(logo): $chan channel is in my chanlist, but for some reason I'm not on it."} else {puthelp "NOTICE $nick :$::fzcom(logo): I'm already on $chan"}} else {channel add $chanputhelp "NOTICE $nick :$fzcom(logo):$chan added in my chanlist."} </code></pre></div>You can take this one notch further and:<br>1. bind the <em class="text-italics">need</em> for op, unban, invite, limit, and key (basically <em class="text-italics">bind need *</em>) and store the actual <em class="text-italics">need</em> in a variable and you can know exactly what he needs.<br>2. and with a channel get see if channel is +inactive:<div class="codebox"><p>Code: </p><pre><code>if {[channel get $chan inactive]} {# your message here}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Thu Jan 07, 2021 2:13 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2021-01-06T19:40:40-04:00</updated>

		<published>2021-01-06T19:40:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109321#p109321</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109321#p109321"/>
		<title type="html"><![CDATA[Join Module]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109321#p109321"><![CDATA[
thanks crazycat yes i tested and saw what i did<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Wed Jan 06, 2021 7:40 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2021-01-06T18:56:28-04:00</updated>

		<published>2021-01-06T18:56:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109320#p109320</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109320#p109320"/>
		<title type="html"><![CDATA[Join Module]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109320#p109320"><![CDATA[
nice try simo, but you made an error:<br>$chan is the chan where the command is typed, the destination chan is (we'll call it $c):<div class="codebox"><p>Code: </p><pre><code>set c [join  [lindex [split $arg] 0]]</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Wed Jan 06, 2021 6:56 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2021-01-06T17:17:33-04:00</updated>

		<published>2021-01-06T17:17:33-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109319#p109319</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109319#p109319"/>
		<title type="html"><![CDATA[Join Module]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109319#p109319"><![CDATA[
this is what i came up with so far :<br><div class="codebox"><p>Code: </p><pre><code>"join" {   if {![check:auth $nick $hand]} {return 0}   if {![matchattr $hand n|n $chan]} {    puthelp "NOTICE $nick :$fzcom(logo): You do not have access to use this command."    return 0   } if {[validchan $chan} {      puthelp "NOTICE $nick :$::fzcom(logo): I'm already on $chan"      return 0   }   if {![validchan $chan]} {    channel add $chan    puthelp "NOTICE $nick :$fzcom(logo):$chan added in my chanlist."   }    return 0  }</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Wed Jan 06, 2021 5:17 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2021-01-06T06:29:47-04:00</updated>

		<published>2021-01-06T06:29:47-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109318#p109318</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109318#p109318"/>
		<title type="html"><![CDATA[Join Module]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109318#p109318"><![CDATA[
<blockquote class="uncited"><div>Ceaser Sir, can you please add this into <a href="fzcommands.tcl" class="postlink">fzcommands.tcl</a>?</div></blockquote>With our contributions, you have all the elements to add this part.<br>Can't you try by yourself before asking ? It's the better way to learn.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Wed Jan 06, 2021 6:29 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Goga]]></name></author>
		<updated>2021-01-06T04:59:15-04:00</updated>

		<published>2021-01-06T04:59:15-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109317#p109317</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109317#p109317"/>
		<title type="html"><![CDATA[Join Module]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109317#p109317"><![CDATA[
Ceaser Sir, can you please add this into <a href="fzcommands.tcl" class="postlink">fzcommands.tcl</a>?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12883">Goga</a> — Wed Jan 06, 2021 4:59 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2021-01-06T02:06:54-04:00</updated>

		<published>2021-01-06T02:06:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109316#p109316</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109316#p109316"/>
		<title type="html"><![CDATA[Join Module]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109316#p109316"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>   if {![matchattr $hand n|n $chan]} {      puthelp "NOTICE $nick :$::fzcom(logo): You do not have access to use this command."      return 0   }</code></pre></div>this part won't ever be triggered because the bind is already tied to n|n:<div class="codebox"><p>Code: </p><pre><code>bind pub n|n !join makejoin</code></pre></div>Instead of:<div class="codebox"><p>Code: </p><pre><code>   if {[llength [split $text]]!=1} {      puthelp "NOTICE $nick :$::fzcom(logo): the command is !join #newchannel"      return 0   }   if {[string index $text 0]!="#"} {      puthelp "NOTICE $nick :$::fzcom(logo): the channel name must begin with #"      return 0   }</code></pre></div>I would go with:<div class="codebox"><p>Code: </p><pre><code>if {[scan $text {%s} c] != 1} {puthelp "NOTICE $nick :$::fzcom(logo): the command is !join #newchannel"return}if {[string first # $c] != 1} {puthelp "NOTICE $nick :$::fzcom(logo): the channel $c doesn't seem valid as must start with an #" return}</code></pre></div>As for <em class="text-italics">validchan</em> it doesn't care if the channel name is upper, lower or mixed case. Just tested this as wasn't 100% sure about it.<br><br>On a side note keep i mind that the <em class="text-italics">validchan</em> returns 1 only if the bot knows the channel, but isn't necessarily ON the channel at the said moment, so might want to extend it with <em class="text-italics">botonchan</em> to see if he's on the channel or not to avoid user confusion, meaning user will tell it to join, channel is known but for some reason (like bot's hostmask is banned, it's set to invite only or locked with some other mode, channel is set to +inactive, and whatnot) the bot can't join it and will attempt to add an existing channel and user won't see it join it.. thus creates some confusion. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Wed Jan 06, 2021 2:06 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Goga]]></name></author>
		<updated>2021-01-06T00:37:07-04:00</updated>

		<published>2021-01-06T00:37:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109315#p109315</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109315#p109315"/>
		<title type="html"><![CDATA[Join Module]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109315#p109315"><![CDATA[
For your information, that was <a href="https://tclarchive.org/download.php?id=1172" class="postlink">fzcommands.tcl</a> part in which I want to add !join command.<br>I added your given bind but it didn't work<br>Can you help me more?<br><br><span style="color:red">Moderator edit: Next time post the link to the script if it's in the TCL Archive, don't clog the forum with it.</span><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12883">Goga</a> — Wed Jan 06, 2021 12:37 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2021-01-05T07:21:10-04:00</updated>

		<published>2021-01-05T07:21:10-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109312#p109312</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109312#p109312"/>
		<title type="html"><![CDATA[Join Module]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109312#p109312"><![CDATA[
That's quite the same.<br><br>As I don't know your full script, here is the basic version<div class="codebox"><p>Code: </p><pre><code>bind pub n|n !join makejoinproc makejoin {nick uhost handle chan text} {   if {![check:auth $nick $hand]} {return 0}   if {![matchattr $hand n|n $chan]} {      puthelp "NOTICE $nick :$::fzcom(logo): You do not have access to use this command."      return 0   }   if {[llength [split $text]]!=1} {      puthelp "NOTICE $nick :$::fzcom(logo): the command is !join #newchannel"      return 0   }   if {[string index $text 0]!="#"} {      puthelp "NOTICE $nick :$::fzcom(logo): the channel name must begin with #"      return 0   }   if {[validchan [string tolower $text]} {      puthelp "NOTICE $nick :$::fzcom(logo): I'm already on $text"      return 0   }   channel add [string tolower $text]}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Tue Jan 05, 2021 7:21 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Goga]]></name></author>
		<updated>2021-01-06T00:35:35-04:00</updated>

		<published>2021-01-05T06:24:14-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109311#p109311</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109311#p109311"/>
		<title type="html"><![CDATA[Join Module]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109311#p109311"><![CDATA[
that TCL name was Fzcomands.tcl<br>If you want me to post whole file, I will. <br>I only want to add !Join command in this TCL.<br>If you can help me out.<br>Thanks.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12883">Goga</a> — Tue Jan 05, 2021 6:24 am</p><hr />
]]></content>
	</entry>
	</feed>
