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

	<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>2019-04-22T16:28:41-04:00</updated>

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

		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2019-04-22T16:28:41-04:00</updated>

		<published>2019-04-22T16:28:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=107619#p107619</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=107619#p107619"/>
		<title type="html"><![CDATA[doubt of code]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=107619#p107619"><![CDATA[
Well, there are a few ways we can go here...<ul><li>Read the textfile to memory on startup</li><li>Read the textfile everytime the kick-binding triggers</li><li>A mix of the two... (advanced stuff)</li></ul>In the first two cases, the code is pretty much the same; just a matter when to call it:<div class="codebox"><p>Code: </p><pre><code>set fd [open "scripts/bd/bdreason.txt" "r"]set ::words [split [read $fd] "\n"]close $fd</code></pre></div>This would add each line in bdreason.txt as a separate item in the _::words_ variable. This code could either be included inside the spychan:kick proc, or at the start of the script (in place of the current set words "scripts...").<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Mon Apr 22, 2019 4:28 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[bwkzb]]></name></author>
		<updated>2019-04-19T16:00:36-04:00</updated>

		<published>2019-04-19T16:00:36-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=107607#p107607</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=107607#p107607"/>
		<title type="html"><![CDATA[doubt of code]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=107607#p107607"><![CDATA[
Thank you very much for responding and sorry for the delay.<br><br>and the variable so that the code reads the badwords of the reasons for the kicks in a .txt file as it would be<div class="codebox"><p>Code: </p><pre><code>set spy(home) "#canal1" set spy(chan) "#canal2" set words "scripts/bd/bdreason.txt" bind KICK -|- "$spy(chan) *" spychan:kick proc spychan:kick {nickname hostname handle channel target reason} {  global spy putserv "PRIVMSG $spy(home) :$channel * $target was kicked from $spy(chan) by $nickname $reason"   foreach bdreason $::words {     if {[string match -nocase "*$bdreason*" "$reason"]} {       putquick "SAJOIN $target #expulsed"       break     }   } }</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12684">bwkzb</a> — Fri Apr 19, 2019 4:00 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2019-04-09T13:17:11-04:00</updated>

		<published>2019-04-09T13:17:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=107589#p107589</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=107589#p107589"/>
		<title type="html"><![CDATA[doubt of code]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=107589#p107589"><![CDATA[
Let me see if I understood your question right:<br>You'd like to inspect all kick-reasons for certain keywords; if found, the target should be SAJOIN'd to some channel #expulsed?<br><br>In that case, most of the bits are already there; just some cleanup and proper syntax needed:<ul><li>Your brackets, {}, are misaligned causing your proc to end before the "} else {" section. This would most likely throw an error when you try to load the script.</li><li>Testing the kick-reason against "*" will always be true, which is pointless. Just send the PRIVMSG. Also, the PRIVMSG has a newline in it, which cannot be sent correctly.</li><li>Since you are only interrested in finding a match, not the total number of matches, there's no point in iterating through the list of patterns once a match has been found. Do the SAJOIN here and then break</li></ul><div class="codebox"><p>Code: </p><pre><code>set spy(home) "#canal1" set spy(chan) "#canal2" set words { *banned* }bind KICK -|- "$spy(chan) *" spychan:kickproc spychan:kick {nickname hostname handle channel target reason} {  putserv "PRIVMSG $spy(home) :$channel * $target was kicked from $spy(chan) by $nickname $reason"  foreach x $::words {    if {[string match -nocase "*$x*" "$reason"]} {      putquick "SAJOIN $target #expulsed"      break    }  }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Tue Apr 09, 2019 1:17 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[bwkzb]]></name></author>
		<updated>2019-04-09T17:21:46-04:00</updated>

		<published>2019-04-09T00:32:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=107588#p107588</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=107588#p107588"/>
		<title type="html"><![CDATA[doubt of code]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=107588#p107588"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>set spy(home) "#canal1"set spy(chan) "#canal2"set words { *banned* }bind KICK   -|- "$spy(chan) *"   spychan:kickproc spychan:kick { nickname hostname handle channel target reason } {global spyif {[string equal -nocase $channel $spy(chan)]} {putserv "PRIVMSG $spy(home) :$channel * $target was kicked from $spy(chan) by $nickname $reason"}} else {if {[string match "*" [string tolower $reason]]} {     set results 0     foreach x $::words {     if {[string match -nocase *$x* $reason]} {     incr results     }     }     if {$results &gt; 0} { putquick "SAJOIN $target #expulsed" }}</code></pre></div>how it could be transformed or added to this code that reads the kicks of users and bots with a certain reason.<br>For example, read the reason of the kick ("banned") and read that reason and send them back with a SAJOIN to a channel #expulsed<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12684">bwkzb</a> — Tue Apr 09, 2019 12:32 am</p><hr />
]]></content>
	</entry>
	</feed>
