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

	<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-11-18T00:48:19-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Stefano1990]]></name></author>
		<updated>2019-11-18T00:48:19-04:00</updated>

		<published>2019-11-18T00:48:19-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=107937#p107937</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=107937#p107937"/>
		<title type="html"><![CDATA[Hello]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=107937#p107937"><![CDATA[
This was a BlackList script , i change it to a Whitelist Script for privat channel protection to add innocent real user hostmask as trusted exemp host on whitelist file database , now dont need reason when i add trusted users hostmask<br><br>&lt;@Stef&gt; .t *!*@*.AEE21FF0.IP<br>-Bot-test- Done. *!*@*.AEE21FF0.IP added on whitelist.<br><br>&lt;@Stef&gt; .t *!*@*.AEE21FF0.IP<br>-Bot-test- Sorry. This hostmask exist already on whitelist<br><br>&lt;@Stef&gt; .wl<br>-Bot-test- whitelist entrys<br>-Bot-test- Nr. Owner             Hostmask<br>-Bot-test- #1  Stef                 *!*@*.AEE21FF0.IP<br>-Bot-test- End of list.<br><br>&lt;@Stef&gt; .ut *!*@*.AEE21FF0.IP<br>-Bot-test- Done. Hostmask is removed from whitelist.<br><br>Now if someone can help to add a code raw 340 userip nick on join event to take out the hidden hostmask from users vhost to be check if their hostmask exist on whitelist file to not be kick-ban will be very helpfull<br> <br><br>This is the code what is doing on join with raw 340 check userip nick<br><br>* Joins: Test1 (<a href="mailto:test@test.test">test@test.test</a>) <br> &lt;&amp;Bot-test&gt; Test1 just joined #Test with hostmask of: <a href="mailto:test@test.test">test@test.test</a><br>* Bot-test sets mode: +b *!*@test.test<br><br>* Test1 was kicked by Bot-test (This Channel Is Restricted)<br>&lt;&amp;Bot-test&gt;  +<a href="mailto:test@2D5F7E1.3AA808D4.AEE21FF0.IP">test@2D5F7E1.3AA808D4.AEE21FF0.IP</a> <br><div class="codebox"><p>Code: </p><pre><code>bind join - "#Test *" do_userip_on_join###proc do_userip_on_join {nick uhost handle chan} {global chan_where_doing_useripset chan_where_doing_userip $chanputserv "privmsg $chan :$nick just joined $chan with hostmask of: $uhost"bind raw - "340" watch_for_useripputserv "userip $nick"utimer 3 [list unbind raw - "340" watch_for_userip]}######proc watch_for_userip {from keyword text} {global chan_where_doing_userip#putserv "privmsg $chan_where_doing_userip :text is: $text"putserv "privmsg $chan_where_doing_userip : [lindex [split $text =] 1] "}</code></pre></div>Here: on proc whitelist:join<br><div class="codebox"><p>Code: </p><pre><code>#Tcl kick-Ban On Join channel Only Users Without hostmask added on whitelistset whitelist_file "scripts/dbase/whitelist"bind PUB  m|- .wl  whitelist:listbind PUB  m|- .t   whitelist:addbind PUB  m|- .ut   whitelist:delbind TIME -|- "* * * * *" whitelist:sentrybind JOIN -|- *            whitelist:joinproc whitelist:list {nickname hostname handle channel arguments} { global whitelist  set entrys 0  puthelp "NOTICE $nickname :whitelist entrys"  puthelp "NOTICE $nickname :Nr. Owner           Hostmask"  foreach entry [array names whitelist] {    incr entrys    set owner [lindex $whitelist($entry) 0]    while {[string length $owner] &lt; 15} {      set owner "$owner "    }    if {[string length $entrys] &lt; 2} {      set target "$entrys "    } else {      set target $entrys    }    puthelp "NOTICE $nickname :#$target $owner $entry"  }  puthelp "NOTICE $nickname :End of list."}proc whitelist:add {nickname hostname handle channel arguments} { global whitelist  set arguments [whitelist:clean $arguments]  set banmask [whitelist:validate:host [lindex $arguments 0]]  if {([regexp -all -- {!} $banmask] &gt; 1) || ([regexp -all -- {@} $banmask] &gt; 1)} {    puthelp "NOTICE $nickname :Sorry, couldn't add that hostmask."    return  }  set owner $handle  if {[regexp {^(\d{1,2}|[0-3][0-6][0-5])$} [lindex $arguments 1]]} {   set expire {[expr ([lindex $arguments 1] * 86400) + [unixtime]]}   set reason "Ok"  } else {   set expire 0   set reason "Ok"  }  if {[llength $reason] &gt;= 1} {    if {![info exists whitelist($banmask)]} {      set whitelist($banmask) "$owner $expire $reason"      puthelp "NOTICE $nickname :Done. $banmask added on whitelist."      whitelist:sentry    } else {      puthelp "NOTICE $nickname :Sorry. This hostmask exist already on whitelist"    }  } else {    puthelp "NOTICE $nickname :You forgot to type a whitelist reason."  }}proc whitelist:del {nickname hostname handle channel arguments} { global whitelist  set arguments [whitelist:clean $arguments]  set banmask [lindex $arguments 0]  set success 0  if {[regexp {^#([0-9]+)$} $banmask tmp number]} {    set item 0    foreach entry [array names whitelist] {      incr item      if {$item == $number} {        unset whitelist($entry)        set success 1      }    }  } else {    if {[info exists whitelist($banmask)]} {      unset whitelist($banmask)      set success 1    }  }  if {$success == 0} {    puthelp "NOTICE $nickname :Couldn't delete the requested ban. Use .wl to view them."  } else {    puthelp "NOTICE $nickname :Done. Hostmask is removed from whitelist."  }}proc whitelist:sentry {{minute "0"} {hour "0"} {day "0"} {week "0"} {year "0"}} { global whitelist  foreach channel [channels] {    if {![botisop $channel]} {continue}    foreach target [chanlist $channel] {      set userhost [whitelist:weirdclean "$target![getchanhost $target]"]      foreach entry [array names whitelist] {        set expire [lindex $whitelist($entry) 1]        if {$expire &gt;= [unixtime] || ($expire == 0)} {          set reason [lrange [whitelist:clean $whitelist($entry)] 2 end]          set whitehost [whitelist:weirdclean $entry]          if {[string match -nocase $whitehost $userhost]} {            putquick "MODE $channel -b $whitehost $entry"          }        } else {          unset whitelist($entry)        }      }    }  }  whitelist:save}bind pub o|o .pro whitelist_controlproc whitelist_control {nick host handle chan args} {global botnickif { ![channel get $chan whitelist] &amp;&amp; [string compare $args "on"] == 0 } {channel set $chan +whitelistputserv "NOTICE $nick :whitelist: enabled on $chan"} elseif { [channel get $chan whitelist] &amp;&amp; [string compare $args "off"] == 0 } {channel set $chan -whitelistputserv "NOTICE $nick :whitelist: disabled on $chan"}}setudef flag whitelistproc whitelist:join {nickname hostname handle channel} {if { ![channel get $channel whitelist] } {  return 0  }global whitelistif {![botisop $channel]} {return}set userhost [whitelist:weirdclean "$nickname![getchanhost $nickname]"]set iswhite 0foreach entry [array names whitelist] {#       set reason [lrange [whitelist:clean $whitelist($entry)] 2 end]set whitehost [whitelist:weirdclean $entry]if {[string match -nocase $whitehost $userhost]} {set iswhite 1break}}if {$iswhite == 0} {putquick "MODE $channel +b [maskhost $userhost 4]"putquick "KICK $channel $nickname :This Channel Is Restricted"}}proc whitelist:validate:host {i} {  regsub -all {\*+} $i {*} i  array set ban {    ident *    host *  }  set ban(nick) $i  if {[regexp -- {!} $i]} {    regexp -- {^(.+?)!(.*?)(@(.*))?$} $i tmp ban(nick) ban(ident) tmp ban(host)  } elseif {[regexp -- {@} $i]} {    regexp -- {^(.+!)?(.*?)(@(.*))?$} $i tmp ban(nick) ban(ident) tmp ban(host)  }  foreach item [array names ban] {    if {[string length $ban($item)] &lt; 1} {      set ban($item) *    }  }  return $ban(nick)!$ban(ident)@$ban(host)}proc whitelist:load {} { global whitelist whitelist_file  regexp {(\S+/)?} $whitelist_file tmp whitelist_dir  if {$whitelist_dir != ""} {    if {![file isdirectory $whitelist_dir]} {      file mkdir $whitelist_dir      putlog "Created directory: $whitelist_dir"    }  }  if {![file exists $whitelist_file]} {    array set whitelist {}    return  }  if {[array exists whitelist]} {    array unset whitelist  }  set file [open $whitelist_file r]  while {![eof $file]} {    gets $file line    if {[regexp -- {(\S+)\s(\S+)\s(\S+)\s(.+)} $line tmp banmask owner expire reason]} {      if {$expire &gt;= [unixtime] || ($expire == 0)} {        set whitelist($banmask) "$owner $expire $reason"      }    }  }  close $file}proc whitelist:save {} { global whitelist whitelist_file  set file "[open $whitelist_file w]"  foreach entry [array names whitelist] {    puts $file "$entry $whitelist($entry)"  }  close $file}proc whitelist:weirdclean {i} {   regsub -all -- \\\\ $i \001 {i}   regsub -all -- \\\[ $i \002 {i}   regsub -all -- \\\] $i \003 {i}   regsub -all -- \\\} $i \004 {i}   regsub -all -- \\\{ $i \005 {i}   return $i}proc whitelist:clean {i} {   regsub -all -- \\\[ $i \\\\\[ {i}   regsub -all -- \\\] $i \\\\\] {i}   regsub -all -- \\\} $i \\\\\} {i}   regsub -all -- \\\{ $i \\\\\{ {i}   regsub -all -- \\\" $i \\\\\" {i}   return $i}whitelist:loadputlog "Script loaded: whitelist"</code></pre></div>Need and protection anti massjoin flood code<br>to set mode +i when is match massjoin flood 5:2 <br>the users hostmask who are not in whitelist exemp file <br>and to unset mode -i after 20second<br>if someone can help thank you in advance<br><div class="codebox"><p>Code: </p><pre><code># Mass joins, set mode on joins:seconds #set mj(flood) 5:2# Set channel mode(s) on flood detected. ## - set empty to disable setting channel modes (ex. set mj(mode) "") #set mj(mode) "i"# Remove these channel modes after how many seconds? #set mjp(mrem) 20</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12745">Stefano1990</a> — Mon Nov 18, 2019 12:48 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Stefano1990]]></name></author>
		<updated>2019-11-16T14:50:58-04:00</updated>

		<published>2019-11-16T14:50:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=107932#p107932</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=107932#p107932"/>
		<title type="html"><![CDATA[Hello]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=107932#p107932"><![CDATA[
can anyone to help to add this code raw340 userip on other proc whitelist:join<br><div class="codebox"><p>Code: </p><pre><code>bind join - "#test *" do_userip_on_join###proc do_userip_on_join {nick uhost handle chan} {global chan_where_doing_useripset chan_where_doing_userip $chanputserv "privmsg $chan :$nick just joined $chan with hostmask of: $uhost"bind raw - "340" watch_for_useripputserv "userip $nick"utimer 3 [list unbind raw - "340" watch_for_userip]}######proc watch_for_userip {from keyword text} {global chan_where_doing_userip#putserv "privmsg $chan_where_doing_userip :text is: $text"putserv "privmsg $chan_where_doing_userip : [lindex [split $text =] 1] "}</code></pre></div>now need to add here in this proc join below to match users hostmask address  with vhost to read the whitelist file exemp host<br><div class="codebox"><p>Code: </p><pre><code>proc whitelist:join {nickname hostname handle channel} {if { ![channel get $channel whitelist] } {  return 0  }global whitelistif {![botisop $channel]} {return}set userhost [whitelist:weirdclean "$nickname![getchanhost $nickname]"]set iswhite 0foreach entry [array names whitelist] {#       set reason [lrange [whitelist:clean $whitelist($entry)] 2 end]set whitehost [whitelist:weirdclean $entry]if {[string match -nocase $whitehost $userhost]} {set iswhite 1break}}if {$iswhite == 0} {putquick "MODE $channel +b [maskhost $userhost 4]"putquick "KICK $channel $nickname :This Channel is restricted"}}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12745">Stefano1990</a> — Sat Nov 16, 2019 2:50 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Stefano1990]]></name></author>
		<updated>2019-11-13T13:29:46-04:00</updated>

		<published>2019-11-13T13:29:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=107926#p107926</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=107926#p107926"/>
		<title type="html"><![CDATA[new whitelist script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=107926#p107926"><![CDATA[
Yes now is work as whitelist is ban what is not added on whitelist<br>is work perfectly<br><br>the proc join you fixed thank you Spike^^<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12745">Stefano1990</a> — Wed Nov 13, 2019 1:29 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2019-11-13T13:16:39-04:00</updated>

		<published>2019-11-13T13:16:39-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=107925#p107925</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=107925#p107925"/>
		<title type="html"><![CDATA[whitelist 0.1]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=107925#p107925"><![CDATA[
<blockquote class="uncited"><div>This script was blacklist need to make change first the ban patern to ban on join only what is not added on whitelist</div></blockquote>This edited process should change the basic function from a blacklist (ban anyone in the list) to a whitelist script (ban anyone NOT in the list) <br><br>Replace the entire existing proc whitelist:join with this edited process...<br><div class="codebox"><p>Code: </p><pre><code>proc whitelist:join {nickname hostname handle channel} { global whitelist  if {![botisop $channel]} {return}  set userhost [whitelist:weirdclean "$nickname![getchanhost $nickname]"]  set iswhite 0  foreach entry [array names whitelist] {#    set reason [lrange [whitelist:clean $whitelist($entry)] 2 end]    set whitehost [whitelist:weirdclean $entry]    if {[string match -nocase $whitehost $userhost]} {      set iswhite 1      break    }  }  if {$iswhite == 0} {    putquick "MODE $channel +b [maskhost $userhost 4]"  }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Wed Nov 13, 2019 1:16 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Stefano1990]]></name></author>
		<updated>2019-11-16T00:52:51-04:00</updated>

		<published>2019-11-11T11:19:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=107924#p107924</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=107924#p107924"/>
		<title type="html"><![CDATA[new whitelist script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=107924#p107924"><![CDATA[
Tcl On Join Channel ban only the User who are not in whitelist<br><br>This script was blacklist need to make change first the ban patern to ban on join only what is not added on whitelist<br>and second to make check up /userip nick on join to match their hidden hostmask from vhost and to check if exist on whitelist and to allow, if the hostmask dont exist on whitelist to make ban +b *!*@*.domain<br><br># Need to fix and add this 5 things  :<br># 1.To take off the reason when i add hostmask on whitelist.<br># 2.On Join Channel need to check users with vhost /userip nick and to match their hostmask with whitelist exemp hostmask <br># 3.When i add a hostmask to remove the ban from channel.   <br># 5.Type of ban the user on join +b *!*@*.domain when hostmask dont exist on whitelist exemp<br><br># Thank You In Advance For Your Help <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><div class="codebox"><p>Code: </p><pre><code>set whitelist_file "scripts/dbase/whitelist"bind PUB  m|- .wl  whitelist:listbind PUB  m|- .aw  whitelist:addbind PUB  m|- .dw   whitelist:delbind TIME -|- "* * * * *" whitelist:sentrybind JOIN -|- *            whitelist:joinproc whitelist:list {nickname hostname handle channel arguments} { global whitelist  set entrys 0  puthelp "NOTICE $nickname :whitelist entrys"  puthelp "NOTICE $nickname :Nr. Owner           Hostmask"  foreach entry [array names whitelist] {    incr entrys    set owner [lindex $whitelist($entry) 0]    while {[string length $owner] &lt; 15} {      set owner "$owner "    }    if {[string length $entrys] &lt; 2} {      set target "$entrys "    } else {      set target $entrys    }    puthelp "NOTICE $nickname :#$target $owner $entry"  }  puthelp "NOTICE $nickname :End of list."}proc whitelist:add {nickname hostname handle channel arguments} { global whitelist  set arguments [whitelist:clean $arguments]  set banmask [whitelist:validate:host [lindex $arguments 0]]  if {([regexp -all -- {!} $banmask] &gt; 1) || ([regexp -all -- {@} $banmask] &gt; 1)} {    puthelp "NOTICE $nickname :Sorry, couldn't add that hostmask."    return  }  set owner $handle  if {[regexp {^(\d{1,2}|[0-3][0-6][0-5])$} [lindex $arguments 1]]} {   set expire [expr ([lindex $arguments 1] * 86400) + [unixtime]]   set reason [join [lrange $arguments 2 end]]  } else {   set expire 0   set reason [join [lrange $arguments 1 end]]  }  if {[llength $reason] &gt;= 1} {    if {![info exists whitelist($banmask)]} {      set whitelist($banmask) "$owner $expire $reason"      puthelp "NOTICE $nickname :Done. $banmask added on whitelist (reason: $reason)."      whitelist:sentry    } else {      puthelp "NOTICE $nickname :Sorry. This hostmask exist already on whitelist"    }  } else {    puthelp "NOTICE $nickname :You forgot to type a whitelist reason."  }}proc whitelist:del {nickname hostname handle channel arguments} { global whitelist  set arguments [whitelist:clean $arguments]  set banmask [lindex $arguments 0]  set success 0  if {[regexp {^#([0-9]+)$} $banmask tmp number]} {    set item 0    foreach entry [array names whitelist] {      incr item      if {$item == $number} {        unset whitelist($entry)        set success 1      }    }  } else {    if {[info exists whitelist($banmask)]} {      unset whitelist($banmask)      set success 1    }  }  if {$success == 0} {    puthelp "NOTICE $nickname :Couldn't delete the requested ban. Use .wl to view them."  } else {    puthelp "NOTICE $nickname :Done. Hostmask is removed from whitelist."  }}proc whitelist:sentry {{minute "0"} {hour "0"} {day "0"} {week "0"} {year "0"}} { global whitelist  foreach channel [channels] {    if {![botisop $channel]} {continue}    foreach target [chanlist $channel] {      set userhost [whitelist:weirdclean "$target![getchanhost $target]"]      foreach entry [array names whitelist] {        set expire [lindex $whitelist($entry) 1]        if {$expire &gt;= [unixtime] || ($expire == 0)} {          set reason [lrange [whitelist:clean $whitelist($entry)] 2 end]          set whitehost [whitelist:weirdclean $entry]          if {[string match -nocase $whitehost $userhost]} {            putquick "MODE $channel -b $whitehost $entry"          }        } else {          unset whitelist($entry)        }      }    }  }  whitelist:save}proc whitelist:join {nickname hostname handle channel} { global whitelist  if {![botisop $channel]} {return}  set userhost [whitelist:weirdclean "$nickname![getchanhost $nickname]"]  foreach entry [array names whitelist] {    set reason [lrange [whitelist:clean $whitelist($entry)] 2 end]    set whitehost [whitelist:weirdclean $entry]    if {[string match -nocase $whitehost $userhost]} {      putquick "MODE $channel +b $whitehost $entry"    }  }}proc whitelist:validate:host {i} {  regsub -all {\*+} $i {*} i  array set ban {    ident *    host *  }  set ban(nick) $i  if {[regexp -- {!} $i]} {    regexp -- {^(.+?)!(.*?)(@(.*))?$} $i tmp ban(nick) ban(ident) tmp ban(host)  } elseif {[regexp -- {@} $i]} {    regexp -- {^(.+!)?(.*?)(@(.*))?$} $i tmp ban(nick) ban(ident) tmp ban(host)  }  foreach item [array names ban] {    if {[string length $ban($item)] &lt; 1} {      set ban($item) *    }  }  return $ban(nick)!$ban(ident)@$ban(host)}proc whitelist:load {} { global whitelist whitelist_file  regexp {(\S+/)?} $whitelist_file tmp whitelist_dir  if {$whitelist_dir != ""} {    if {![file isdirectory $whitelist_dir]} {      file mkdir $whitelist_dir      putlog "Created directory: $whitelist_dir"    }  }  if {![file exists $whitelist_file]} {    array set whitelist {}    return  }  if {[array exists whitelist]} {    array unset whitelist  }  set file [open $whitelist_file r]  while {![eof $file]} {    gets $file line    if {[regexp -- {(\S+)\s(\S+)\s(\S+)\s(.+)} $line tmp banmask owner expire reason]} {      if {$expire &gt;= [unixtime] || ($expire == 0)} {        set whitelist($banmask) "$owner $expire $reason"      }    }  }  close $file}proc whitelist:save {} { global whitelist whitelist_file  set file "[open $whitelist_file w]"  foreach entry [array names whitelist] {    puts $file "$entry $whitelist($entry)"  }  close $file}proc whitelist:weirdclean {i} {  regsub -all -- \\\\ $i \001 i  regsub -all -- \\\[ $i \002 i  regsub -all -- \\\] $i \003 i  regsub -all -- \\\} $i \004 i  regsub -all -- \\\{ $i \005 i  return $i}proc whitelist:clean {i} {  regsub -all -- \\\\ $i \\\\\\\\ i  regsub -all -- \\\[ $i \\\\\[ i  regsub -all -- \\\] $i \\\\\] i  regsub -all -- \\\} $i \\\\\} i  regsub -all -- \\\{ $i \\\\\{ i  regsub -all -- \\\" $i \\\\\" i  return $i}whitelist:loadputlog "Script loaded: whitelist"</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12745">Stefano1990</a> — Mon Nov 11, 2019 11:19 am</p><hr />
]]></content>
	</entry>
	</feed>
