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

	<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>2007-05-24T14:41:48-04:00</updated>

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

		<entry>
		<author><name><![CDATA[nsrafk]]></name></author>
		<updated>2007-05-24T14:41:48-04:00</updated>

		<published>2007-05-24T14:41:48-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72955#p72955</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72955#p72955"/>
		<title type="html"><![CDATA[Ban masks]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72955#p72955"><![CDATA[
Oh, thanks so much! That was very helpful! You're good at explaining man. Thanks!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8985">nsrafk</a> — Thu May 24, 2007 2:41 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2007-05-24T13:21:35-04:00</updated>

		<published>2007-05-24T13:21:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72954#p72954</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72954#p72954"/>
		<title type="html"><![CDATA[Ban masks]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72954#p72954"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>getchanhost $nick $chan</code></pre></div>returns user@host<div class="codebox"><p>Code: </p><pre><code>split [getchanhost $nick $chan] @</code></pre></div>returns a list containing 'user' and 'host' {user host}.<br>The index of 'user' is 0 and the index of 'host' is 1. Since you want the host,  you use:<div class="codebox"><p>Code: </p><pre><code>lindex [split [getchanhost $nick $chan] @] 1</code></pre></div>so, to get *!*@host:<div class="codebox"><p>Code: </p><pre><code>set mask *!*@[lindex [split [getchanhost $nick $chan] @] 1]</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Thu May 24, 2007 1:21 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nsrafk]]></name></author>
		<updated>2007-05-24T11:10:08-04:00</updated>

		<published>2007-05-24T11:10:08-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72950#p72950</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72950#p72950"/>
		<title type="html"><![CDATA[Ban masks]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72950#p72950"><![CDATA[
ok, it seems that i really need to read now.. cos that i have no clue on hwo to do.. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>EDIT:<br>seems like the first way to do it with split is the easiest way to do it. How would i put it then? Something like;<div class="codebox"><p>Code: </p><pre><code>[strip [getchanhost $nick $chan] "@"]</code></pre></div>And then im lost with the lindex stuff. Can u please show me a working example of this? Sorry for being stupid at this hehe <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=8985">nsrafk</a> — Thu May 24, 2007 11:10 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2007-05-24T10:46:41-04:00</updated>

		<published>2007-05-24T10:46:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72948#p72948</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72948#p72948"/>
		<title type="html"><![CDATA[Ban masks]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72948#p72948"><![CDATA[
For this, there are several options. Two most common would be to either split the hostmask into a list (using <a href="http://www.tcl.tk/man/tcl8.4/TclCmd/split.htm" class="postlink">split</a> with "@" as split-character), and then, using <a href="http://www.tcl.tk/man/tcl8.4/TclCmd/lindex.htm" class="postlink">lindex</a>, select the last list-element; or, using <a href="http://www.tcl.tk/man/tcl8.4/TclCmd/string.htm" class="postlink">string first</a> to find the location of the @, and then use "string range" to select a substring..<br><br>In either case you would have no further need for the "string trimleft".<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Thu May 24, 2007 10:46 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nsrafk]]></name></author>
		<updated>2007-05-24T10:34:11-04:00</updated>

		<published>2007-05-24T10:34:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72947#p72947</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72947#p72947"/>
		<title type="html"><![CDATA[Ban masks]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72947#p72947"><![CDATA[
One last thing - how would the proc look like if i would set bans like *!*@host.com ? <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=8985">nsrafk</a> — Thu May 24, 2007 10:34 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nsrafk]]></name></author>
		<updated>2007-05-24T10:23:02-04:00</updated>

		<published>2007-05-24T10:23:02-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72946#p72946</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72946#p72946"/>
		<title type="html"><![CDATA[Ban masks]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72946#p72946"><![CDATA[
Thanks mate. Works perfect.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8985">nsrafk</a> — Thu May 24, 2007 10:23 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2007-05-24T10:04:01-04:00</updated>

		<published>2007-05-24T10:04:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72943#p72943</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72943#p72943"/>
		<title type="html"><![CDATA[Ban masks]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72943#p72943"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>proc getmask {nick chan} {  return *!*[string trimleft [getchanhost $nick $chan] "~"]}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Thu May 24, 2007 10:04 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nsrafk]]></name></author>
		<updated>2007-05-24T09:11:12-04:00</updated>

		<published>2007-05-24T09:11:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72942#p72942</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72942#p72942"/>
		<title type="html"><![CDATA[Ban masks]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72942#p72942"><![CDATA[
It works, thanks. There's just one problem though. It sets bane like this:<br><br>*!*~<a href="mailto:ident@host.com">ident@host.com</a> <br><br>is there a way to strip the ~ ?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8985">nsrafk</a> — Thu May 24, 2007 9:11 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nsrafk]]></name></author>
		<updated>2007-05-24T09:04:06-04:00</updated>

		<published>2007-05-24T09:04:06-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72941#p72941</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72941#p72941"/>
		<title type="html"><![CDATA[Ban masks]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72941#p72941"><![CDATA[
Ok, thanks. Ill try it and see if it works <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=8985">nsrafk</a> — Thu May 24, 2007 9:04 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2007-05-24T07:48:11-04:00</updated>

		<published>2007-05-24T07:48:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72940#p72940</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72940#p72940"/>
		<title type="html"><![CDATA[Ban masks]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72940#p72940"><![CDATA[
Changing the "getmask" proc to something like this should work;<div class="codebox"><p>Code: </p><pre><code>proc getmask {nick chan} {  return *!*[getchanhost $nick $chan]}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Thu May 24, 2007 7:48 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nsrafk]]></name></author>
		<updated>2007-05-24T07:32:20-04:00</updated>

		<published>2007-05-24T07:32:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72939#p72939</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72939#p72939"/>
		<title type="html"><![CDATA[Ban masks]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72939#p72939"><![CDATA[
Hi all. I've downloaded 'CCAS Netbots Edition' by Loki. (Complete Channel Administration System) <br><br>I have a question, to change to banmask the script uses.<br>In the script i see:<div class="codebox"><p>Code: </p><pre><code># The following proc makes a proper hostmask for use with banning, etc..#------------------------------------------------------------------------------------------------------------proc getmask {nick chan} {  set mask [string trimleft [maskhost [getchanhost $nick $chan]] *!]  set mask *!*$mask  return $mask}#------------------------------------------------------------------------------------------------------------# The following proc makes a proper hostmask for use with banning, etc..#------------------------------------------------------------------------------------------------------------proc warnban {nick mask chan bantime warn rest} {  global color1loki rulebreaker pbannounceif {$warn == 0} { set rulebreaker($mask) "0 [unixtime]" }if {![info exists rulebreaker($mask)]} {set rulebreaker($mask) "$warn [unixtime]"}if {[expr [unixtime] - [lindex $rulebreaker($mask) 1]] &gt; 259200} {set rulebreaker($mask) "$warn [unixtime]"}if {[lindex $rulebreaker($mask) 0] &lt; 1} {foreach activeban [banlist $chan] {if {[lindex $activeban 0] == $mask} {return 1}}puthelp "PRIVMSG $nick :$color1loki You have triggered an AutoBan: $rest \(Perm Ban\)"putlog "\0033 4 $nick \($mask\) has been Auto Perm Banned"puthelp "PRIVMSG $pbannounce :4 $nick \($mask\) has been Auto Perm Banned from $chan \(5 Reason: $rest\) Type !override to undo"set rulebreaker(overmask) "$mask"newban $mask "Autoban" $rest 20000unset rulebreaker($mask)putkick $chan $nick "AutoBan: $rest \(Perm Banned\)"} elseif {[lindex $rulebreaker($mask) 0] == 1} {foreach activeban [banlist $chan] {if {[lindex $activeban 0] == $mask} {set rulebreaker($mask) "[expr [lindex $rulebreaker($mask) 0] - 1] [lindex $rulebreaker($mask) 1]"return 1}}if {$bantime != 0} {puthelp "PRIVMSG $nick :$color1loki You have triggered an AutoBan: $rest \[Last Warning\] \($bantime min ban\)"newchanban $chan $mask "Autoban" $rest $bantime}set rulebreaker($mask) "[expr [lindex $rulebreaker($mask) 0] - 1] [lindex $rulebreaker($mask) 1]"putkick $chan $nick "AutoBan: $rest !-Last Warning-! \($bantime min ban\)"} else {foreach activeban [banlist $chan] {if {[lindex $activeban 0] == $mask} {set rulebreaker($mask) "[expr [lindex $rulebreaker($mask) 0] - 1] [lindex $rulebreaker($mask) 1]"return 1}}if {$bantime != 0} {puthelp "PRIVMSG $nick :$color1loki You have triggered an AutoBan: $rest \[1st Warning\] \($bantime min ban\)"newchanban $chan $mask "Autoban" $rest $bantime}set rulebreaker($mask) "[expr [lindex $rulebreaker($mask) 0] - 1] [lindex $rulebreaker($mask) 1]"putkick $chan $nick "AutoBan: $rest !-Warning-! \($bantime min ban\)"}return 1}</code></pre></div>When using this my eggdrop sets a ban like this:<br><strong class="text-strong">*!*Love@*.quakenet.org</strong><br>I want the ban to look something like:<br><strong class="text-strong">*!*<a href="mailto:Love@GeRbeNsEn.users.quakenet.org">Love@GeRbeNsEn.users.quakenet.org</a></strong><br><br>I've tried to mess around with this, but im too stupid to make it work lol.<br><br>Thanks for any help!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8985">nsrafk</a> — Thu May 24, 2007 7:32 am</p><hr />
]]></content>
	</entry>
	</feed>
