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

	<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>2015-11-23T06:50:20-04:00</updated>

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

		<entry>
		<author><name><![CDATA[aboutme]]></name></author>
		<updated>2015-11-23T06:50:20-04:00</updated>

		<published>2015-11-23T06:50:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=104560#p104560</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=104560#p104560"/>
		<title type="html"><![CDATA[Need Help , Blacklist tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=104560#p104560"><![CDATA[
Features: support ip, host, resolve , CIDR<br><br>- blacklist file<br>example: set blacklist(file) "scripts/blacklist.txt"<br>- special flag<br>example: only user with flag +B can use commands addban, remban and banlist ( this flag can be settable only from perm owner )<br><br>1. Procedures:<br>- addban<br>example: partyline command .addban *!*@10.1.1.1 reason time<br>example CIDR: partyline command: addban *!*@10.1.1.1/8 reason time<br>- remban<br>example: partyline command .remban *!*@10.1.1.1<br>- banlist<br>example: partyline command: .banlist ( show the current list with all bans )<br>if is possible to order bans a-z after adding or removing some ban ( but if that load the bot better not )<br><br>2. bantype:<br>- IP: all users join from host/ip will be ban with mask *!*@10.1.1.1 or *!*@some.host.com ( example: use set ipban [maskhost $host 2] )<br>- HEX: all users join from type: *!*@*.html.chat, *!*@*.xs4all.nl, *!*@*.kiwiirc.com or *!*@*.mibbit.com will be ban with the banmask *!*ident@*.html.chat ( example: use set hexban [maskhost $host 3] )<br><br>3. exempt:<br>- by default eggdrop don't check other eggdrops/bots<br>- flag I gives user exempt and he wouldn't be checked<br><br>4. Putidx<br>- addban example: putidx $idx "SYNTAX: \003.addban \002&lt;nick&gt;\002!\002&lt;user&gt;\002@\002&lt;host&gt;\002 \[reason\] \[bantime\]\003"<br>- addban check for existing ban: putidx $idx "[string map {! \002!\002 @ \002@\002} \002$blnick\002] has been \002added\002 to the blacklist."<br>- remban example: putidx $idx "SYNTAX: \003.remban \002&lt;nick&gt;\002!\002&lt;user&gt;\002@\002&lt;host&gt;\002\003"<br>- remban message: putidx $idx "[string map {! \002!\002 @ \002@\002} \002$blnick\002] was \002deleted\002 from the blacklist."<br>- remban check: putidx $idx "[string map {! \002!\002 @ \002@\002} \002$blnick\002] was \002not\002 found in the blacklist."<br>- banlist example: putidx $idx "SYNTAX: \003.Showing the banlist!\003" , putidx $idx "SYNTAX: \003.End of the banlist!\003"<br>- ban is added: putidx $idx "[string map {! \002!\002 @ \002@\002} \002$blnick\002] has been \002added\002 to the blacklist.<br>- ban already exist: putidx $idx "[string map {! \002!\002 @ \002@\002} \002$blnick\002] already \002exists\002 in the blacklist."<br>- Empty banlist: putidx $idx "There are \002no\002 bans in the blacklist."<br><br>5. Handle<br>- Showing handle of user set the ban ( if is possible to show and date like )<br>- example reason: (Violation of the rules section 2 of regulation! 13/04/2014 Kiril@Valhalla)<br><br>Note:<br>if user join with host eggdrop resolve host to ip and check in database ( blacklist ).<br>if blacklist file does not exist than create one!<br>Check if IP is already added in blacklist!<br><br>Legend:<br>- Time: .addban *!*@10.1.1.1 [censored] ya 60 ( that means ban is for 60 min )<br>- Time: .addban *!*@10.1.1.1/16 [censored] ya 0 ( that means ban is permanent )<br><br>Logic:<br>user join for example from host [05:20:36] * ShakeIT46982 (<a href="mailto:d4059ee1@elitsat.html.chat">d4059ee1@elitsat.html.chat</a>) has joined #gyuvetch<br>TO DO Procedures:<br>1. Convert HEX to IP ( d4059ee1 -&gt; 212.5.158.225 )<br>2. Convert HOST to IP ( Resolve ) if is need it like linux.com -&gt; 140.211.167.50 ( for users join via IRC client not webchat )<br>3. Compare IP with banlist using matchcidr or whatever is need it!<br>4. Set Channel ban depends from that is it from *!*@*.html.chat or it is host/ip see 2. bantype<br><br>HELP materials:<br><br>- hex2ip Procedure:<br><br>proc bl:h2d {hex} {<br># Simple check to validate proper hex string<br>if {[regexp {^[a-fA-F0-9]{8}$} $hex]} {<br>set dec [expr 0x$hex]<br>set o1 [expr {($dec &gt;&gt; 24) &amp; 0xff}]<br>set o2 [expr {($dec &gt;&gt; 16) &amp; 0xff}]<br>set o3 [expr {($dec &gt;&gt; <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_cool.gif" width="15" height="15" alt="8)" title="Cool"> &amp; 0xff}]<br>set o4 [expr {$dec &amp; 0xff}]<br><br>return "$o1.$o2.$o3.$o4"<br>}<br>return 0<br>}<br><br>- Checking for perm owner<br><br>proc ispermowner {hand} {<br>global owner<br>regsub -all -- , [string tolower $owner] "" owners<br>if {([matchattr $hand n]) &amp;&amp; \<br>([lsearch -exact $owners [string tolower $hand]] != -1)} then {<br>return 1<br>}<br>return 0<br>}<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12582">aboutme</a> — Mon Nov 23, 2015 6:50 am</p><hr />
]]></content>
	</entry>
	</feed>
