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

	<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-03-26T10:50:01-04:00</updated>

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

		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2021-03-26T10:50:01-04:00</updated>

		<published>2021-03-26T10:50:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109635#p109635</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109635#p109635"/>
		<title type="html"><![CDATA[How to get version]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109635#p109635"><![CDATA[
Nadae asked me an example of script which forbid all clients version different of (in example) "Kiwi IRC" and "mIRC", working for everybody but "lololo".<br><br>I did it (sorry guys, with french comments) : <a href="https://gitlab.com/-/snippets/2095934" class="postlink">https://gitlab.com/-/snippets/2095934</a><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Fri Mar 26, 2021 10:50 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2021-03-26T08:53:34-04:00</updated>

		<published>2021-03-26T08:53:34-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109634#p109634</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109634#p109634"/>
		<title type="html"><![CDATA[How to get version]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109634#p109634"><![CDATA[
perhaps this will be of use:<br><div class="codebox"><p>Code: </p><pre><code> set acnick {    "John"}bind raw - NOTICE server:noticesproc server:notices {from keyword text} {    global  acnick      if {[string match -nocase "*client connecting on*" $text]} {        set nick [lindex [split $text] 9]        set hostmask [lindex [split $text] 10]    foreach i [string tolower $acnick] {   if {![string match -nocase  $i $nick]} {          putserv "PRIVMSG $nick :\001VERSION\001"   }}        return 0      }      if {[string match -nocase "*client connecting at*" $text]} {        set nick [lindex [split $text] 8]        set hostmask [lindex [split $text] 9]   foreach i [string tolower $acnick] {   if {![string match -nocase  $i $nick]} {          putserv "PRIVMSG $nick :\001VERSION\001"   }}        return 0      }}set badclient {   "mirc"}bind ctcr -|- "VERSION" ctcr:checkproc ctcr:check {nick host hand dest keyword text} { if {$keyword == "VERSION"} {       foreach checknick $::badclient {           if {[string match -nocase *$checknick* [stripcodes bcruag $text]]} {                              putquick "GLINE $host 1h :You match a Bad Client. This is not Permitted on \017\002\00306 $::network. \017  Please Use another Client and Reconnect."           }       }   }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Fri Mar 26, 2021 8:53 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2021-03-25T18:44:26-04:00</updated>

		<published>2021-03-25T18:44:26-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109633#p109633</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109633#p109633"/>
		<title type="html"><![CDATA[How to get version]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109633#p109633"><![CDATA[
No, the ban version block is here to forbid some client version, not to forbid all but one or two.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Thu Mar 25, 2021 6:44 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Nadae]]></name></author>
		<updated>2021-03-25T14:54:06-04:00</updated>

		<published>2021-03-25T14:54:06-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109629#p109629</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109629#p109629"/>
		<title type="html"><![CDATA[How to get version]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109629#p109629"><![CDATA[
<blockquote class="uncited"><div>If you use unrealircd, you can use the <a href="https://www.unrealircd.org/docs/Ban_version_block" class="postlink">ban version</a> feature</div></blockquote> CrazyCat with unrealircd is it possible to choose: if the version is different from ...?<br>In this case it is written how?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12905">Nadae</a> — Thu Mar 25, 2021 2:54 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ComputerTech]]></name></author>
		<updated>2021-03-25T11:07:09-04:00</updated>

		<published>2021-03-25T11:07:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109626#p109626</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109626#p109626"/>
		<title type="html"><![CDATA[How to get version]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109626#p109626"><![CDATA[
heh yeah, was doing that code this morning at 5am and hadn't slept, will try fix it after work.<br><br>Thanks caesar  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12849">ComputerTech</a> — Thu Mar 25, 2021 11:07 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2021-03-25T08:56:46-04:00</updated>

		<published>2021-03-25T08:56:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109625#p109625</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109625#p109625"/>
		<title type="html"><![CDATA[How to get version]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109625#p109625"><![CDATA[
Thats even a better approach thanks CrazyCat<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Thu Mar 25, 2021 8:56 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2021-03-25T08:37:49-04:00</updated>

		<published>2021-03-25T08:37:49-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109624#p109624</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109624#p109624"/>
		<title type="html"><![CDATA[How to get version]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109624#p109624"><![CDATA[
If you use unrealircd, you can use the <a href="https://www.unrealircd.org/docs/Ban_version_block" class="postlink">ban version</a> feature<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Thu Mar 25, 2021 8:37 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2021-03-25T08:19:48-04:00</updated>

		<published>2021-03-25T08:19:48-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109623#p109623</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109623#p109623"/>
		<title type="html"><![CDATA[How to get version]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109623#p109623"><![CDATA[
well first you need to know what IRCD is it running in and does bot have IRCOP<br>privileges<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Thu Mar 25, 2021 8:19 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2021-03-25T12:53:22-04:00</updated>

		<published>2021-03-25T02:29:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109622#p109622</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109622#p109622"/>
		<title type="html"><![CDATA[How to get version]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109622#p109622"><![CDATA[
<strong class="text-strong">1.</strong> <em class="text-italics">string match</em> expects two <strong class="text-strong">arg</strong>uments (two strings), while in:<div class="codebox"><p>Code: </p><pre><code>if {![string match -nocase "$nicks"]} {</code></pre></div>and:<div class="codebox"><p>Code: </p><pre><code>if {![string match -nocase "*[string tolower $version]*"]} { </code></pre></div>you are missing one of them. You should ditch looping over a list and use <em class="text-italics">lsearch</em> (that means <em class="text-italics">list search</em>) directly instead.<div class="codebox"><p>Code: </p><pre><code>% set bv_nicks {"john" "paddy"}"john" "paddy"% set nick "something"something% lsearch -nocase $bv_nicks $nick-1% set nick PaddyPaddy% lsearch -nocase $bv_nicks $nick1</code></pre></div><strong class="text-strong">2.</strong> In this code<div class="codebox"><p>Code: </p><pre><code>foreach nicks $bv_nicks {     if {![string match -nocase "$nicks"]} {        return 0     } </code></pre></div>if you want to stop the iteration or skip one element use <em class="text-italics">break</em> or <em class="text-italics">continue</em>, depending on what you want to achieve. For example:<div class="codebox"><p>Code: </p><pre><code>% set numbers { 1 2 3 4 5 6 } 1 2 3 4 5 6% foreach number [split $numbers] {        if {$number == 3} {                continue        }        puts $number}12456</code></pre></div>Notice that 3 is missing, and in this:<div class="codebox"><p>Code: </p><pre><code>% foreach number [split $numbers] {        if {$number == 3} {                break        }        puts $number}12</code></pre></div>notice that the execution has been stopped when number is 3.<br><br><strong class="text-strong">3.</strong> In this code:<div class="codebox"><p>Code: </p><pre><code>if {![isbotnick $nick]} {</code></pre></div>you can test the TRUE state instead of FALSE one and return, so this saves you of the keeping in mind you have one } to add somewhere at the end.<br><br><strong class="text-strong">4.</strong> In this code:<div class="codebox"><p>Code: </p><pre><code>proc Client_Connect {from key arg} {  putserv "PRIVMSG $from :\001VERSION\001"}</code></pre></div>I have my doubts that using <em class="text-italics">$from</em> is the client you want to version check, most likely that's the server itself sending you something in the <em class="text-italics">$arg</em> (avoid using <strong class="text-strong">arg</strong> as it has some special meaning in TCL) with client information and you need to parse the details from the line it sends. Might want to do some research first.<br><br>Oh, and don't use <em class="text-italics">return 0</em> if you don't want to have an actual 0 (zero) returned in a function or whatnot.<br><br>I've moved the topic to the correct section.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Thu Mar 25, 2021 2:29 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ComputerTech]]></name></author>
		<updated>2021-03-25T17:42:13-04:00</updated>

		<published>2021-03-25T00:02:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109621#p109621</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109621#p109621"/>
		<title type="html"><![CDATA[How to get version]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109621#p109621"><![CDATA[
First of all:  this is "Scripting Help" this post is better in "Script Requests"<br><br>Second:<div class="codebox"><p>Code: </p><pre><code># set allow nicksset bv_nicks {"john" "paddy"}# Set allow versionsset bv_versions {"version1" "version2"} bind raw - NOTICE Client_Connectbind ctcr - VERSION ctcr:bv_ctcpproc Client_Connect {from key arg} {  putserv "PRIVMSG $from :\001VERSION\001"}proc ctcr:bv_ctcp {nick host hand dest key arg} {global bv_versions bv_nicksif {![isbotnick $nick]} {   foreach nicks $bv_nicks {     if {![string match -nocase "$nicks"]} {      return 0     }foreach version $bv_versions {if {![string match -nocase "*[string tolower $version]*"]} { return 0}}    putquick "gline $host 30m :Bad Version"} }}</code></pre></div>Untested  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=":wink:" title="Wink"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12849">ComputerTech</a> — Thu Mar 25, 2021 12:02 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Nadae]]></name></author>
		<updated>2021-03-24T20:35:07-04:00</updated>

		<published>2021-03-24T20:35:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109620#p109620</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109620#p109620"/>
		<title type="html"><![CDATA[How to get version]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109620#p109620"><![CDATA[
Hello,<br><br>I would like that for each person who connects, we can get their ctcp version. And that if the person is not the nickname "John" and the version of the person does not correspond to what I want it is gline for 30 minutes.<br><br>How to do ?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12905">Nadae</a> — Wed Mar 24, 2021 8:35 pm</p><hr />
]]></content>
	</entry>
	</feed>
