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

	<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>2005-06-26T11:42:41-04:00</updated>

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

		<entry>
		<author><name><![CDATA[r0t3n]]></name></author>
		<updated>2005-06-26T11:42:41-04:00</updated>

		<published>2005-06-26T11:42:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=51397#p51397</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=51397#p51397"/>
		<title type="html"><![CDATA[badword script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=51397#p51397"><![CDATA[
Hmm, theres a error somewhere in the script, whenever i type !badword add/del word or !badword list nothjing happens, the bot does not report a erro in dcc, and the bot does not reply. Please help!!<br><div class="codebox"><p>Code: </p><pre><code>bind pub - * badwords:checkbind pub - !badword bad:wordsproc badwords:check {nick host hand chan text} {  global badword botnick  if {[channel get $chan "badwords"]} {    if {![matchattr $hand o|o $chan] &amp;&amp; ![matchattr $hand of|of $chan]} {      set $fp [open "/scripts/inc/badwords.db" "r"]      set data [read -nonewline $fp]       close $fp      set lines [split $data "\n"]      if [string match "$text" $lines] {        set badword(word,$chan) $lines        set userhost(badword,$chan) [getchanhost $nick $chan]        if {[string match "*users.quakenet.org" $userhost(badword,$chan)]} {          set userhost *!*@[lindex [split $userhost "@"] 1]          newchanban $chan $userhost $botnick "$lines is a badword, banned for 2 minutes." 2          putquick "MODE $chan -o+b $nick $userhost"          putquick "KICK $chan $nick :$lines is a badword, banned for 2 minutes."          timer 2 [list pushmode $chan -b $userhost]          timer 2 [list putserv "PRIVMSG $nick :Your are now unbanned in $chan for saying a badword: $lines."]        }      }      }  }}proc bad:words {nick host hand chan text} {  set cmd [lindex [split $text] 1]  set info [join [lrange [split $text] 2 end]]   switch -exact -- [string tolower $cmd] {     "add" {      if {![matchattr $hand nm|]} {        putserv "NOTICE $nick :Error: you do not have access to this command, global +n or +m needed."        } elseif {($info == "")} {        putserv "NOTICE $nick :Error: please enter a badword to add to the database, use !badword add word."        } elseif {($info != "") &amp;&amp; [matchattr $hand nm|]} {        set fs [open "/scripts/inc/badwords.db" "a"]        put $fs $info        close $fs        putlog "The word: $info was add to the badwords database by $nick at [timestamp]"       }    }    "del" {      if {![matchattr $hand nm|]} {        putserv "NOTICE $nick :Error: you do not have access to this command, global +n or +m needed."        } elseif {($info == "")} {        putserv "NOTICE $nick :Error: please enter a badword to remove from the database, use !badword del word."        } elseif {($info != "") &amp;&amp; [matchattr $hand nm|]} {        set fs [open "scripts/inc/badwords.db" r]         set data [read -nonewline $fs]         close $fs         if { [set i [lsearch -exact $lines $info]] == -1 } {           puthelp "NOTICE $nick :Error: badword '$info' wasn't found in the database."           } else {           set lines [lreplace $lines $i $i]           set data [join $lines \n]           set fs [open "scripts/inc/badwords.db" w]           puts -nonewline $fs $data           close $fs           puthelp "NOTICE $nick :'$info' is nolonger a badword."          putlog "The word: $info was removed from the badwords database by $nick at [timestamp]"         }      }    }    "list" {      if {![matchattr $hand nm|]} {        putserv "NOTICE $nick :Error: you do not have access to this command, global +n or +m needed."        } elseif {![file exist "/scripts/inc/badwords.db"] {        putserv" NOTICE $nick :Error: The badwords database was not found."        } else {        set $fp [open "/scripts/inc/badwords.db" "r"]        set data [read -nonewline $fp]         close $fp        set lines [split $data "\n"]        putserv "NOTICE $nick :Badwords List"        putserv "NOTICE $nick :$lines        putserv "NOTICE $nick :End of list"      }    }  }}putlog "BADWORDS.TCL LOADED!!"</code></pre></div>Please help!!<br><br>Thanks in advance!!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6300">r0t3n</a> — Sun Jun 26, 2005 11:42 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[r0t3n]]></name></author>
		<updated>2005-06-26T10:26:49-04:00</updated>

		<published>2005-06-26T10:26:49-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=51393#p51393</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=51393#p51393"/>
		<title type="html"><![CDATA[badword script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=51393#p51393"><![CDATA[
ok, thanks De Kus!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6300">r0t3n</a> — Sun Jun 26, 2005 10:26 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2005-06-25T19:47:02-04:00</updated>

		<published>2005-06-25T19:47:02-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=51377#p51377</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=51377#p51377"/>
		<title type="html"><![CDATA[badword script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=51377#p51377"><![CDATA[
i suggest using something like:<br><div class="codebox"><p>Code: </p><pre><code>    set fs [open "scripts/inc/badwords.db" r]        set data [read -nonewline $fs]    close $fs     if { [set i [lsearch -exact $lines $info]] == -1 } {        puthelp "NOTICE $nick :Error: badword '$info' wasn't found in the database."    } else {        set lines [lreplace $lines $i $i]        set data [join $lines \n]        set fs [open "scripts/inc/badwords.db" w]            puts -nonewline $fs $data        close $fs         puthelp "NOTICE $nick :'$info' is nolonger a badword."    }</code></pre></div>btw. I fixed a lot of syntax errors, but I don't if I found all <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy">.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2382">De Kus</a> — Sat Jun 25, 2005 7:47 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[r0t3n]]></name></author>
		<updated>2005-06-25T19:09:20-04:00</updated>

		<published>2005-06-25T19:09:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=51375#p51375</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=51375#p51375"/>
		<title type="html"><![CDATA[badword script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=51375#p51375"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>"del" {if {![matchattr $hand nm|]} {putserv "NOTICE $nick :Error: you do not have access to this command, global +n or +m needed."} elseif {($info == "")} {putserv "NOTICE $nick :Error: please enter a badword to remove from the database, use !badword del word."} elseif {($info != "") &amp;&amp; [matchattr $hand nm|]} {set $fs [open "/scripts/inc/badwords.db" "a"]    set data [read -nonewline $fs]     close $fs    set lines [split $data "\n"]    if [string match "$info" $lines] {    set line_to_delete $lines</code></pre></div>This is a part of a badwords script im making, i just wondered, how do i remove whats in the $info var, i have read the basic file operations in the tcl faq, but it doesnt help me. Its got to search for the line, and then find out the line number, and then remove. Please help!!<br><br>Thanks in advance!!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6300">r0t3n</a> — Sat Jun 25, 2005 7:09 pm</p><hr />
]]></content>
	</entry>
	</feed>
