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

	<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>2020-03-08T12:44:47-04:00</updated>

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

		<entry>
		<author><name><![CDATA[AlbozZz]]></name></author>
		<updated>2020-03-08T12:44:47-04:00</updated>

		<published>2020-03-08T12:44:47-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=108053#p108053</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=108053#p108053"/>
		<title type="html"><![CDATA[exemp script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=108053#p108053"><![CDATA[
Now the script is work great, but need to change the commands and remove channel name, when i add IP in exemp.txt file list,<br><br>someone can help here, how to change this public comand , thx in advance <br><br>!exemp help   change in   !help<br><br>!exemp list     change in   !list<br><br>!exemp del 1  change in    !del 75.34.37.12 | 75.34.37.* | 75.34.*<br><br>!exemp add    change in    !add 75.34.37.12 | 75.34.37.* | 75.34.*<br><br>and to remove the name channel when i add Ip on exemp.txt list<br>to add only the IP <br><br><div class="codebox"><p>Code: </p><pre><code>proc check_ip {ip} {set file [open "exemp.txt" r]set fdata [split [read $file] \n]close $fileforeach entry $fdata {if {[string match $entry $ip]} {return 1}}return 0}bind pub n|n !exemp  exemp:cmdset exemp(file) "exemp.txt"if {![file exists $exemp(file)]} {set file [open $exemp(file) w]close $file}proc exemp:cmd {nick host hand chan arg} {global exempset arg0 [lindex [split $arg] 0]set arg1 [lindex [split $arg] 1]if {$arg0 == ""} {putserv "NOTICE $nick :EXEMP Use: \002!exemp help\002 for more informations."return}switch $arg0 {add {if {$arg1 == ""} {putserv "NOTICE $nick :EXEMP Use: \002!exemp help\002 for more informations."return}set file [open $exemp(file) a]puts $file "$chan $arg1"close $fileputserv "NOTICE $nick :EXEMP I added\002 $arg1 \002in my ExempList."}list {set file [open $exemp(file) "r"]set read [read -nonewline $file]close $fileset data [split $read "\n"]set i 0if {$data == ""} { putserv "NOTICE $nick :EXEMP There are\002 no IP \002added to ExempList."return}putserv "NOTICE $nick :EXEMP The list of IP added in my ExempList."foreach line $data {set read_chan [lindex [split $line] 0]if {[string match -nocase $read_chan $chan]} {set i [expr $i +1]set read_blackchan [lindex [split $line] 1]putserv "NOTICE $nick :$i.) $read_blackchan"}}}del {array set exempdel [list]if {![regexp {.*?(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}).*?\((.*?)\)} $arg1]} {putserv "NOTICE $nick :EXEMP Use: \002!exemp help\002 for more informations."return}set file [open $exemp(file) "r"]set data [read -nonewline $file]close $fileset lines [split $data "\n"]set counter -1set line_counter -1set current_place -1foreach line $lines {set line_counter [expr $line_counter + 1]set read_chan [lindex [split $line] 0]if {[string match -nocase $read_chan $chan]} {set counter [expr $counter + 1]set exempdel($counter) $line_counter}}foreach place [array names exempdel] {if {$place == [expr $arg1 - 1]} {set current_place $exempdel($place)}}if {$current_place == "-1"} {putserv "NOTICE $nick :EXEMP The entry number\002 $arg1 \002does not exist."return}set delete [lreplace $lines $current_place $current_place]set files [open $exemp(file) "w"]puts $files [join $delete "\n"]close $filesset file [open $exemp(file) "r"]set data [read -nonewline $file]close $fileif {$data == ""} {set files [open $exemp(file) "w"]close $files}putserv "NOTICE $nick :EXEMP The entry number\002 $arg1 \002was removed from ExempList."}help {putserv "NOTICE $nick :EXEMP You can add IP using: \002!exemp add &lt;IP&gt;\002 "putserv "NOTICE $nick :EXEMP To see all the IP in ExempList use:\002 !exemp list\002"putserv "NOTICE $nick :EXEMP To delete a IP use:\002 !exemp del &lt;number&gt;\002 (from the ExempList)"}}}</code></pre></div>this is how works the script for now.<br><div class="codebox"><p>Code: </p><pre><code>&lt;+BoB&gt; !exemp add 75.34.37.12 -TestBot- EXEMP I added 75.34.37.12 in my ExempList. &lt;+BoB&gt; !exemp list -TestBot- EXEMP The list of IP added in my ExempList. -TestBot- 1.) 75.34.37.12&lt;BoB&gt; !exemp del 1 -TestBot- EXEMP The entry number 1 was removed from ExempList.&lt;BoB&gt; !exemp list-TestBot- EXEMP There are no  IP added to ExempList.&lt;+BoB&gt; !exemp del 75.34.37.12 -TestBot- EXEMP Use: !exemp help for more informations. &lt;+BoB&gt; !exemp help -TestBot- EXEMP You can add IP using: !exemp add &lt;IP&gt; -TestBot- EXEMP To see all the IP in ExempList use: !exemp list -TestBot- EXEMP To delete a IP use: !exemp del &lt;number&gt; (from the ExempList)</code></pre></div>This is the way how is adding now the ip on exemp.txt wrong :<br>need to remove the channel and to be only on #opers chan to use the all commands !list !help !add !del<br><div class="codebox"><p>Code: </p><pre><code>#Test 75.34.37.12</code></pre></div>the right way to add every IP in exemp.txt without name channel only the IP like this:<br><div class="codebox"><p>Code: </p><pre><code>75.34.37.12 75.34.37.* 75.34.*</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12845">AlbozZz</a> — Sun Mar 08, 2020 12:44 pm</p><hr />
]]></content>
	</entry>
	</feed>
