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

	<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-29T16:19:59-04:00</updated>

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

		<entry>
		<author><name><![CDATA[AdmiraL]]></name></author>
		<updated>2021-03-29T16:19:59-04:00</updated>

		<published>2021-03-29T16:19:59-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109681#p109681</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109681#p109681"/>
		<title type="html"><![CDATA[!add !del true and black IP (transformed from mrc to tcl)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109681#p109681"><![CDATA[
<blockquote class="uncited"><div>This code is not tested, but it may answer to your demands for blacklist.<br>It could seem complicated but it's just because I tried to make modules in it.<br><br>But globaly, I don't understand why you use a blacklist system when klines are for 5 minutes, and there is no system to rekill if an user which has IP in the file is coming.<br></div></blockquote>Thanks a lot, u r the best u have make perfect the first and second.<br><br><strong class="text-strong">now only one code is missing, the third one.<br><br>i think the third one is like badwords<br><br>when i have a ip 10.10.10.* in this list allow.txt and i make for example <span style="color:red">trueip 10.10.10.9 or trueip 10.10.10.14</span> detected automatic and says this IP its in my allow list.</strong><br>   <div class="codebox"><p>Code: </p><pre><code>ON *:TEXT:*trueip*:#egitim: {  var %f = allow.txt  if (!$file(%f)) { msg $chan ( $+ $nick $+ ): Error, file $qt(%f) does NOT exists or it is empty! | return }  if ($window(@temp)) { window -c $v1 }  window -hj1000000000 @temp  loadbuf @temp $qt(%f)  var %t = $line(@temp,0)  var %i = 1  while (%i &lt;= %t) {    var %w = $strip($line(@temp,%i))    if (!%w) { goto next }    if (%w iswm $2) || (%w == $2) { var %tot = $addtok(%tot,%w,32) }    :next    inc %i  }  window -c @temp  if (%tot) { msg $chan ( $+ $nick $+ ): $numtok(%tot,32) Matches: %tot }  else { msg $chan ( $+ $nick $+ ): No results founded! | /msg #egitim !add $2 }}</code></pre></div><span style="text-decoration:underline">EXAMPLE i have make a test and u can see.. give Kline!<br></span><br><strong class="text-strong">* 21:40:32 * Shooter trueip 109.201.137.45 <br>* 21:40:33 * @AdmiraL (Shooter): No results founded!<br>* 21:40:33 * @AdmiraL !addto 109.201.137.45<br>* 21:40:34 * K:Line added for *@109.201.137.45 on Mon Mar 29 19:40:33 2021 GMT (from Radio!Radio@NetAdmin</strong><br><br><span style="text-decoration:underline">when its in allow list than says: make nothing because ip is allow list<br></span><br><strong class="text-strong">* 20:44:11 * Shooter trueip 217.138.194.75<br>* 20:44:11 * @AdmiraL (Shooter): 1 Matches: 217.138.194.*</strong><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12900">AdmiraL</a> — Mon Mar 29, 2021 4:19 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2021-03-29T09:43:06-04:00</updated>

		<published>2021-03-29T09:43:06-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109675#p109675</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109675#p109675"/>
		<title type="html"><![CDATA[!add !del true and black IP (transformed from mrc to tcl)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109675#p109675"><![CDATA[
This code is not tested, but it may answer to your demands for blacklist.<br>It could seem complicated but it's just because I tried to make modules in it.<br><br>But globaly, I don't understand why you use a blacklist system when klines are for 5 minutes, and there is no system to rekill if an user which has IP in the file is coming.<br><div class="codebox"><p>Code: </p><pre><code>set ipchan #raspfrset ipdbfile databases/iplist.dbbind pub - !addto ip:addbind pub - !delto ip:delset iplist {}proc ip:add {nick uhost handle chan text} {if {[string tolower $chan] ne [string tolower $::ipchan]} {putserv "PRIVMSG $nick :You're not on the good channel"return}set ip [join [lindex [split $text] 0]]if {[ip:infile $ip] == 1} {putserv "PRIVMSG $::ipchan :$ip is already in database"return}ip:fin $ip}proc ip:del {nick uhost handle chan text} {if {[string tolower $chan] ne [string tolower $::ipchan]} {putserv "PRIVMSG $nick :You're not on the good channel"return}set ip [join [lindex [split $text] 0]]if {![ip:infile $ip] == 1} {putserv "PRIVMSG $::ipchan :$ip is not in database"return}ip:fout $ip}proc ip:infile {ip} {if {[llength $::iplist] == 0 &amp;&amp; [file exists $::iplist]} {set fi [open $::ipdbfile "r"]set ::iplist [split [read -nonewline $fi] "\n"]close $fi}if {[lsearch $::iplist $ip]==-1} {return 0} else {return 1}}proc ip:fin {ip} {lappend ::iplist $ipset fo [open $::ipdbfile "w"]foreach cip $::iplist {puts $fo $cip}close $foputserv "kline *@$ip 5m :halt"}proc ip:fout {ip} {set pos [lsearch $::iplist $ip]set ::iplist [lreplace $::iplist $pos $pos]set fo [open $::ipdbfile "w"]foreach cip $::iplist {puts $fo $cip}close $foputserv "kline -*@$ip"}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Mon Mar 29, 2021 9:43 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[AdmiraL]]></name></author>
		<updated>2021-02-21T17:31:23-04:00</updated>

		<published>2021-02-21T17:31:23-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109415#p109415</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109415#p109415"/>
		<title type="html"><![CDATA[!add !del true and black IP (transformed from mrc to tcl)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109415#p109415"><![CDATA[
Hello all..<br><br>I need a little help from everyone ..<br><br>With this code under, example if I do in my channel #egitim !addto 1.1.1.1 or !addto 1.1.* And then bot automatically makes the IP in this file blacklist.txt<br><div class="codebox"><p>Code: </p><pre><code>on *:TEXT:!addto *:#egitim:{  if ($nick ison #) &amp;&amp; ($2 = $read(blacklist.txt,w,$2)) &amp;&amp; ($2) { msg #egitim 47I can't add this IP 4IP:  $+ $2 $+  47because is in the List! | halt }  if ($nick ison #) &amp;&amp; ($2 != $read(blacklist.txt,s,$2)) &amp;&amp; ($2) { write blacklist.txt $2 | msg #egitim 4IP:  $+ $2 $+  47I have add in List! | kline *@ $+ $2 5m | halt }}</code></pre></div>If i want a ip delete, and when i do !delto 1.1.1.1 and the bot can automatically delete this IP from blacklist.txt<div class="codebox"><p>Code: </p><pre><code>on *:TEXT:!delto *:#egitim:{  if ($nick ison #) &amp;&amp; ($2 != $read(blacklist.txt,s,$2)) &amp;&amp; ($2) { //filter -ffcx blacklist.txt blacklist.txt $2 | msg #egitim 4IP:  $+ $2 $+  47I have deleted from the List! | kline -*@ $+ $2 | halt }}}</code></pre></div>and last code when I do trueip 1.1.1.1 and bot automatically puts this ip  in list allow.txt! if this IP is in list, bot says * Nick 1 or 2 IP are in my list! * and if there is no IP in this list allow.txt then automatically writes in this channel #egitim! add 1.1.1.1<div class="codebox"><p>Code: </p><pre><code>ON *:TEXT:*trueip*:#egitim: {  var %f = allow.txt  if (!$file(%f)) { msg $chan ( $+ $nick $+ ): Error, file $qt(%f) does NOT exists or it is empty! | return }  if ($window(@temp)) { window -c $v1 }  window -hj1000000000 @temp  loadbuf @temp $qt(%f)  var %t = $line(@temp,0)  var %i = 1  while (%i &lt;= %t) {    var %w = $strip($line(@temp,%i))    if (!%w) { goto next }    if (%w iswm $2) || (%w == $2) { var %tot = $addtok(%tot,%w,32) }    :next    inc %i  }  window -c @temp  if (%tot) { msg $chan ( $+ $nick $+ ): $numtok(%tot,32) Matches: %tot }  else { msg $chan ( $+ $nick $+ ): No results founded! | /msg #egitim !add $2 }}</code></pre></div>thank you if someone has time, i would be grateful.<br><br>AdmiraL<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12900">AdmiraL</a> — Sun Feb 21, 2021 5:31 pm</p><hr />
]]></content>
	</entry>
	</feed>
