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

	<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-01-27T08:48:00-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2006-10-31T19:21:19-04:00</updated>

		<published>2006-10-31T19:21:19-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=67607#p67607</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=67607#p67607"/>
		<title type="html"><![CDATA[include nickname on quotation]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=67607#p67607"><![CDATA[
Contact the author then, I won't be reading through the code to figure this out.<br><br>Edit: Glad you found the solution <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=3085">Sir_Fz</a> — Tue Oct 31, 2006 7:21 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[fredvil]]></name></author>
		<updated>2007-01-27T08:48:00-04:00</updated>

		<published>2006-10-31T19:16:39-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=67606#p67606</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=67606#p67606"/>
		<title type="html"><![CDATA[include nickname on quotation]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=67606#p67606"><![CDATA[
Sir_Fz,<br><br>i got it... i put <div class="codebox"><p>Code: </p><pre><code>set arg "$arg -$n"</code></pre></div> after  <div class="codebox"><p>Code: </p><pre><code>set c [string tolower $c]</code></pre></div> and it works... thanks a lot<br><div class="codebox"><p>Code: </p><pre><code>proc qb:addpub {n uh h c arg} { global qb qbl set c [string tolower $c] set arg "$arg -$n" foreach b $qb(noaddchan) {if {[string match -nocase $c $b]} {return}} set arg [qb:rs $arg] if {[string length $arg] &gt; $qb(max)} {puthelp "NOTICE $n :Quote exceeds $qb(max) characters. Yours has [string length $arg]."; return} if {[llength $arg] == 0} {puthelp "NOTICE $n :Usage: ${qb(trigger)}addquote &lt;quote&gt;"; return} if {$qb(chanspec)} {  foreach e [array names qbl] {if {[string match "#[lindex [split $e #] 2]" $c] &amp;&amp; [string match -nocase $qbl($e) $arg]} {set index [lindex [split $e #] 1]}}  } else {  foreach e [array names qbl] {if {[string match -nocase $qbl($e) $arg]} {set index [lindex [split $e #] 0]}}    } if {[info exists index]} {puthelp "NOTICE $n :The quote you tried to add already exists (index #$index)."; return} qb:findnn $c; set index $qb(nextind)#$qb(nextcind)$c; set qbl($index) $arg; lappend qb(new) $index; qb:saveqts if {$qb(chanspec)} {set index $qb(nextcind)} else {set index $qb(nextind)} puthelp "NOTICE $n :Added Quote #${index}: \"[qb:dr $arg]\"" if {[llength $qb(new)] == 1} {  if {$qb(sendnote) != ""} {   if {[info commands sendnote] != ""} {    if {[validuser $qb(sendnote)]} {sendnote QuoteBot $qb(sendnote) "New quotes available. Use .newquotes to list them."}   }  } } if {$qb(logactions)} {qb:log "ADD PUB $n $c (#$index) [qb:dr $arg]"}}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7056">fredvil</a> — Tue Oct 31, 2006 7:16 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[fredvil]]></name></author>
		<updated>2006-10-31T18:38:23-04:00</updated>

		<published>2006-10-31T18:38:23-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=67605#p67605</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=67605#p67605"/>
		<title type="html"><![CDATA[include nickname on quotation]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=67605#p67605"><![CDATA[
hello Sir_Fz, this what ive got after adding <span style="color:red">set arg "($n) $arg"</span>. the nick is included on the quote when adding it but when i display the quote, the nick isn't there. pls check below, i added <span style="text-decoration:underline">testing 123</span> and got a bot reply <span style="text-decoration:underline">Added Quote #75: "(clarck) testing 123"</span> but when i diplay the quote 75 my nick is not included on the quote.<br><blockquote class="uncited"><div>[06:12] &lt;clarck&gt; .addquote testing 123<br>[06:12] -botnick- Added Quote #75: "(clarck) testing 123"<br>[06:12] &lt;clarck&gt; .quote 75<br>[06:12] &lt;botnick&gt; (#75) testing 123</div></blockquote>you help is very much appreciated<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7056">fredvil</a> — Tue Oct 31, 2006 6:38 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2006-10-31T11:10:27-04:00</updated>

		<published>2006-10-31T11:10:27-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=67596#p67596</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=67596#p67596"/>
		<title type="html"><![CDATA[include nickname on quotation]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=67596#p67596"><![CDATA[
Try adding <div class="codebox"><p>Code: </p><pre><code>set arg "($n) $arg"</code></pre></div>after<div class="codebox"><p>Code: </p><pre><code>if {$qb(chanspec)} {set index $qb(nextcind)} else {set index $qb(nextind)}</code></pre></div>in the qb:addpub proc.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Tue Oct 31, 2006 11:10 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[fredvil]]></name></author>
		<updated>2006-10-31T07:35:30-04:00</updated>

		<published>2006-10-31T07:35:30-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=67591#p67591</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=67591#p67591"/>
		<title type="html"><![CDATA[include nickname on quotation]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=67591#p67591"><![CDATA[
hello guys need your help.... i am using a quotebot and u just want to know if it is posible if someone add a quotation, his/her nickname will  automatically included on the quotation. this is for us to monitor and trace unwanted post quote... thank you very much in advance.<br><br>here is the script:<br><div class="codebox"><p>Code: </p><pre><code># ^-- don't remove this line#   ___              _       ____        _#  / _ \ _   _  ___ | |_ ___| __ )  ___ | |_# | | | | | | |/ _ \| __/ _ \  _ \ / _ \| __|# | |_| | |_| | (_) | ||  __/ |_) | (_) | |_#  \__\_\\__,_|\___/ \__\___|____/ \___/ \__|#                2.0 by Baerchen, August 2001#              for eggdrop 1.4.x+ &amp; TCL 8.3.3#                   baerchen@germany-chat.net## Please report bugs. Thanks.## CONFIGURATION## qb(workdir) is the location for the cache files. Leave leading &amp; trailing /'s as is.set qb(workdir) "/usr/home/blah/eggdrop/scripts/"# Do you want to use channel-specific quotes? If so, quotes added in channel #a aren't# available in channel #b and vice versa. If not, all quotes are available everywhere.# You don't have to decide now, you can en- and disable this feature later as you want.# 0 = do not, 1 = yes pleaseset qb(chanspec) 0# qb(noaddchan) is a list of channels which aren't allowed to add quotesset qb(noaddchan) ""# qb(noquotechan) is a list of channels you don't want the bot to quote toset qb(noquotechan) ""# qb(max) is the maximum characters a quote is allowed to have.set qb(max) 999# Next one will let the bot answer to his nick when mentioned in the channel. Put your bot's# name within the ** and uncoment the line. Example: bind pubm - *LamestBot* qb:answer # bind pubm - ** qb:answer# qb(logactions) defines whether you want to log additions or deletions of quotes# 0 = do not, 1 = yes pleaseset qb(logactions) 1# qb(trigger) is the character that triggers a command.set qb(trigger) "."# qb(sendnote) defines whether QuoteBot sends a note to a user when there are# new quotes available. To disable, set to "". To enable, insert a valid handle# and make sure the notes module is loaded.set qb(sendnote) ""# CODEBASE BELOWbind pub - ${qb(trigger)}addquote qb:addpubbind pub - ${qb(trigger)}quote qb:quotebind pub n|n ${qb(trigger)}delquote qb:delpubbind pub m|m ${qb(trigger)}talk qb:initbind dcc - addquote qb:adddccbind dcc n delquote qb:deldccbind dcc n listquotes qb:listquotesbind dcc n newquotes qb:newquotesbind dcc n copyquotes qb:copybind dcc n delchanquotes qb:delchanproc qb:read {} { global qb qbl qbt set old "$qb(workdir)quotebot.dat"; set new "$qb(workdir)QuoteBot.dat" if {[file exists $old]} {  set fid [open $old r]; gets $fid l; set qb(nextind) 1; set qb(nextcind) 1  while {![eof $fid]} {   gets $fid l; if {$l == ""} {continue}   regsub -all \\\* $l !%08 l; regsub -all \\\? $l !%09 l   set qbl($qb(nextind)#$qb(nextcind)#quotebot) $l; incr qb(nextind); incr qb(nextcind)  }  close $fid; file rename -force $old $old.old; qb:saveqts; set qb(conversion) 1 } if {[file exists $new]} {  set fid [open $new r]; gets $fid l; if {$l != "0"} {set qb(new) $l}  while {![eof $fid]} {gets $fid l; if {$l == ""} {continue}; set qbl([lindex $l 0]) [lrange $l 1 end]}  close $fid } if {[file exists $qb(workdir)quotebot.cfg]} {  file rename -force $qb(workdir)quotebot.cfg $qb(workdir)QuoteBot.cfg; set fid [open $qb(workdir)QuoteBot.cfg r]  while {![eof $fid]} {   gets $fid l; if {$l == ""} {continue}   set qbt([lindex $l 0]) "[lindex $l 1] [lindex $l 2] [timer [lindex $l 2] "qb:scheduled [lindex $l 0]"]"  }  close $fid } if {[file exists $qb(workdir)quotebot.log]} {file rename -force $qb(workdir)quotebot.log $qb(workdir)QuoteBot.log}}proc qb:saveqts {} { global qb qbl set fid [open $qb(workdir)QuoteBot.dat w] if {$qb(new) == ""} {puts $fid "0"} else {puts $fid $qb(new)} foreach e [array names qbl] {set el [split $e #]; puts $fid "$e $qbl($e)"} close $fid}proc qb:savecfg {} { global qb qbt set fid [open $qb(workdir)QuoteBot.cfg w] foreach e [array names qbt] {puts $fid "$e [lindex $qbt($e) 0] [lindex $qbt($e) 1]"} close $fid}proc qb:log {input} { global qb set log "$qb(workdir)QuoteBot.log" if {[file exists $log]} {set fid [open $log a]} else {set fid [open $log w]} puts $fid "$input"; close $fid}proc qb:addpub {n uh h c arg} { global qb qbl set c [string tolower $c] foreach b $qb(noaddchan) {if {[string match -nocase $c $b]} {return}} set arg [qb:rs $arg] if {[string length $arg] &gt; $qb(max)} {puthelp "NOTICE $n :Quote exceeds $qb(max) characters. Yours has [string length $arg]."; return} if {[llength $arg] == 0} {puthelp "NOTICE $n :Usage: ${qb(trigger)}addquote &lt;quote&gt;"; return} if {$qb(chanspec)} {  foreach e [array names qbl] {if {[string match "#[lindex [split $e #] 2]" $c] &amp;&amp; [string match -nocase $qbl($e) $arg]} {set index [lindex [split $e #] 1]}}  } else {  foreach e [array names qbl] {if {[string match -nocase $qbl($e) $arg]} {set index [lindex [split $e #] 0]}}    } if {[info exists index]} {puthelp "NOTICE $n :The quote you tried to add already exists (index #$index)."; return} qb:findnn $c; set index $qb(nextind)#$qb(nextcind)$c; set qbl($index) $arg; lappend qb(new) $index; qb:saveqts if {$qb(chanspec)} {set index $qb(nextcind)} else {set index $qb(nextind)} puthelp "NOTICE $n :Added Quote #${index}: \"[qb:dr $arg]\"" if {[llength $qb(new)] == 1} {  if {$qb(sendnote) != ""} {   if {[info commands sendnote] != ""} {    if {[validuser $qb(sendnote)]} {sendnote QuoteBot $qb(sendnote) "New quotes available. Use .newquotes to list them."}   }  } } if {$qb(logactions)} {qb:log "ADD PUB $n $c (#$index) [qb:dr $arg]"}}proc qb:adddcc {h idx arg} { global qb qbl if {$qb(chanspec)} {  if {[llength $arg] &lt; 2} {putdcc $idx "Usage: ${qb(trigger)}addquote &lt;channel&gt; &lt;quote&gt;"; return}  set c [string tolower [lindex $arg 0]]; set arg [lrange [qb:rs $arg] 1 end]  if {![string match #* $c]} {putdcc $idx "Usage: addquote &lt;channel&gt; &lt;quote&gt;"; return}  foreach b $qb(noaddchan) {if {[string match -nocase $c $b]} {return}}  foreach e [array names qbl] {if {[string match "#[lindex [split $e #] 2]" $c] &amp;&amp; [string match -nocase $qbl($e) $arg]} {set index [lindex [split $e #] 1]}}  if {[info exists index]} {putdcc $idx "The quote you tried to add already exists for $c (index #$index)."; return}  qb:findnn $c; set index $qb(nextind)#$qb(nextcind)$c; set qbl($index) $arg; lappend qb(new) $index; qb:saveqts  putdcc $idx "Added Quote #$qb(nextcind) for $c: \"[qb:dr $arg]\""  } else {  set c #quotebot; set arg [qb:rs $arg]  if {[string length $arg] &gt; $qb(max)} {putdcc $idx "Quote exceeds $qb(max) characters. Yours has [string length $arg]."; return}  if {[llength $arg] == 0} {putdcc $idx "Usage: ${qb(trigger)}addquote &lt;quote&gt;"; return}  foreach e [array names qbl] {if {[string match -nocase $qbl($e) $arg]} {set index [lindex [split $e #] 0]}}  if {[info exists index]} {putdcc $idx "The quote you tried to add already exists (index #$index)."; return}  qb:findnn $c; set index $qb(nextind)#$qb(nextcind)$c; set qbl($index) $arg; lappend qb(new) $index; qb:saveqts  putdcc $idx "Added Quote #$qb(nextind): \"[qb:dr $arg]\"" } if {[llength $qb(new)] == 1} {  if {$qb(sendnote) != ""} {   if {[info commands sendnote] != ""} {    if {[validuser $qb(sendnote)]} {sendnote QuoteBot $qb(sendnote) "New quotes available. Use .newquotes to list them."}   }  } } if {$qb(logactions)} {qb:log "ADD PUB $h $c (#$index) [qb:dr $arg]"}}proc qb:newquotes {h idx arg} { global qb qbl set len [llength $qb(new)] putdcc $idx "$len new quote(s) have arrived. There are [array size qbl] quotes in the database." if {$len &gt; 0} {  if {$qb(chanspec)} {   putdcc $idx "(No.) (Channel: No.) Quote"   foreach e $qb(new) {set el [split $e #]; putdcc $idx "(#[lindex $el 0]) (#[lindex $el 2]: #[lindex $el 1]) [qb:dr $qbl($e)]"}   } else {   putdcc $idx "(No.) Quote"   foreach e $qb(new) {set el [split $e #]; putdcc $idx "(#[lindex $el 0]) [qb:dr $qbl($e)]"}  }   set qb(new) ""; qb:saveqts  }}proc qb:listquotes {h idx arg} { global qb qbl set argu $arg; set arg [string tolower [qb:rs $arg]]; set list "" if {![string match #* $arg]} {  if {$arg == ""} {set insert ""; foreach e [array names qbl] {lappend list $e}} else {   set insert "matching \"[qb:dr $argu]\""   foreach e [array names qbl] {if {[string match -nocase *$arg* $qbl($e)]} {lappend list $e}}  } } else {  if {$qb(chanspec)} {   set insert "for channel $argu"   foreach e [array names qbl] {if {[string match -nocase "#[lindex [split $e #] 2]" $arg]} {lappend list $e}}   } else {   set insert "matching \"[qb:dr $argu]\""   foreach e [array names qbl] {if {[string match -nocase *$arg* $qbl($e)]} {lappend list $e}}  } } if {[llength $list] &gt; 0} {  set nlist ""; foreach e $list {lappend nlist "[lindex [split $e #] 0] $e"}; set list ""  set nlist [lsort -decreasing -integer -index 0 $nlist]; foreach e $nlist {lappend list [lindex $e 1]}  putdcc $idx "Found [llength $list] quotes (out of [array size qbl]) $insert, latest first."  if {$qb(chanspec)} {   putdcc $idx "(No.) (Channel: No.) Quote"   foreach e $list {set el [split $e #]; putdcc $idx "(#[lindex $el 0]) (#[lindex $el 2]: #[lindex $el 1]) [qb:dr $qbl($e)]"}   } else {   putdcc $idx "(No.) Quote"   foreach e $list {set el [split $e #]; putdcc $idx "(#[lindex $el 0]) [qb:dr $qbl($e)]"}  }  } else {putdcc $idx "Found no matches to your query."}}proc qb:quote {n uh h c arg} { global qb qbl foreach e $qb(noquotechan) {if {[string match -nocase $c $e]} {return}} set arg [qb:rs $arg]; regsub -all \\*|\\? $arg "" arg if {![info exists qb(${c}results)]} {set qb(${c}results) ""} if {![info exists qb(${c}last)]} {set qb(${c}last) ""} if {$arg == ""} {puthelp "PRIVMSG $c :[qb:random $c]"; return} if {[string is integer $arg]} {  if {$qb(chanspec)} {   foreach e [array names qbl] {if {[string match *#$arg$c $e]} {puthelp "PRIVMSG $c :(#[lindex [split $e #] 1]) [qb:dr $qbl($e)]"; return}}   } else {   foreach e [array names qbl] {if {[string match ${arg}#* $e]} {puthelp "PRIVMSG $c :(#[lindex [split $e #] 0]) [qb:dr $qbl($e)]"; return}}  }  puthelp "NOTICE $n :Can't find index $arg"; return } if {[string match -nocase $arg $qb(${c}last)]} {  set e [lindex $qb(${c}results) 0]; set qb(${c}results) [lreplace $qb(${c}results) 0 0]; set len [llength $qb(${c}results)]  if {$qb(chanspec)} {set el [lindex [split $e #] 1]} else {set el [lindex [split $e #] 0]}  puthelp "PRIVMSG $c :(#$el) [qb:dr $qbl($e)] ($len left)"  if {$len == 0} {unset qb(${c}results); set qb(${c}last) ""; return} else {set qb(${c}last) $arg}  return } set qb(${c}results) "" if {$qb(chanspec)} {  foreach e [array names qbl] {   if {[string match "#[lindex [split $e #] 2]" $c] &amp;&amp; [string match -nocase *$arg* $qbl($e)]} {lappend qb(${c}results) $e}}  } else {   foreach e [array names qbl] {if {[string match -nocase *$arg* $qbl($e)]} {lappend qb(${c}results) $e}} } set len [llength $qb(${c}results)] if {$len == 0} {puthelp "NOTICE $n :Found no quotes matching \"[qb:dr $arg]\""; unset qb(${c}results); set qb(${c}last) ""; return} set qb(${c}results) [lsort -decreasing $qb(${c}results)]; set e [lindex $qb(${c}results) 0] if {$qb(chanspec)} {set el [lindex [split $e #] 1]} else {set el [lindex [split $e #] 0]} puthelp "PRIVMSG $c :(#$el) [qb:dr $qbl($e)] ($len match(es), latest first)" set qb(${c}results) [lreplace $qb(${c}results) 0 0]; set qb(${c}last) $arg}proc qb:answer {n uh h c a} { global qb qbl foreach e $qb(noquotechan) {if {[string match -nocase $e $c]} {return}} puthelp "PRIVMSG $c :[qb:random $c]"}proc qb:init {n uh h c arg} { global qb qbt set ch [string tolower $c]; set switch [string tolower [lindex [split $arg] 0]]; set rate [lindex $arg 1] if {($switch != "on") &amp;&amp; ($switch != "off")} {puthelp "NOTICE $n :Usage: talk &lt;on|off&gt; \[minutes\]"; return} if {$rate == ""} {set rate 30} elseif {![string is integer $rate]} {puthelp "NOTICE $n :Use an integer instead of $rate"; return} switch $switch {  "on" {   if {([info exists qbt($ch)]) &amp;&amp; ([lindex $qbt($ch) 0] == "on")} {    killtimer [lindex $qbt($ch) 2]    set qbt($ch) "on $rate [timer $rate "qb:scheduled $ch"]"   } else {set qbt($ch) "on $rate [timer $rate "qb:scheduled $ch"]"}   puthelp "PRIVMSG $c :Enabled quoting for $c with $rate minutes intervall"  }  "off" {   if {([info exists qbt($ch)]) &amp;&amp; ([lindex $qbt($ch) 0] == "on")} {    killtimer [lindex $qbt($ch) 2]; unset qbt($ch)    puthelp "PRIVMSG $c :Disabled quoting for $c"   } else {puthelp "NOTICE $n :Quoting was not enabled for $c"}  }  }   qb:savecfg}proc qb:scheduled {c} { global qb qbl qbt puthelp "PRIVMSG $c :[qb:random $c]" set rate [lindex $qbt($c) 1]; set qbt($c) "on $rate [timer $rate "qb:scheduled $c"]"}proc qb:delpub {n uh h c arg} { global qb qbl set c [string tolower $c]; regsub -all \\*|\\? $arg "" arg; set arg [split [qb:rs $arg]]; set del ""; set nodel ""; set i 0 if {[llength $arg] == 0} {puthelp "NOTICE $n :Usage: ${qb(trigger)}delquote &lt;index ?index index ..?|mask&gt;"; return} if {[string is integer [lindex $arg 0]]} {  if {$qb(chanspec)} {   foreach e $arg {    set f 0    foreach el [array names qbl] {     set ele [split $el #]     if {[string match "#[lindex $ele 2]" $c] &amp;&amp; [string match -nocase [lindex $ele 1] $e]} {unset qbl($el); lappend del $e; set f 1; qb:delnew [lindex $ele 0]}    }   if {!$f} {lappend nodel $e}   }  } else {   foreach e $arg {    set f 0    foreach el [array names qbl] {     set ele [lindex [split $el #] 0]     if {[string match -nocase $ele $e]} {unset qbl($el); lappend del $e; set f 1; qb:delnew $ele}    }   if {!$f} {lappend nodel $e}   }  }  qb:saveqts  if {$del != ""} {puthelp "NOTICE $n :Deleted indices [join $del ", "]"; if {$qb(logactions)} {qb:log "DEL PUB $n $c [qb:dr $arg]"}}  if {$nodel != ""} {puthelp "NOTICE $n :I can't find indices [join $nodel ", "]"}  return } set arg [join $arg] if {$qb(chanspec)} {  foreach e [array names qbl] {   if {[string match "#[lindex [split $e #] 2]" $c] &amp;&amp; [string match -nocase *$arg* $qbl($e)]} {unset qbl($e); incr i; qb:delnew [lindex [split $e #] 0]}  } } else {  foreach e [array names qbl] {   if {[string match -nocase *$qbl($e)* $arg]} {unset qbl($e); incr i; qb:delnew [lindex [split $e #] 0]}  }   } if {!$i} {puthelp "NOTICE $n :Can't find a quote matching \"[qb:dr $arg]\""; return} else {  puthelp "NOTICE $n :Removed $i quote(s) matching \"[qb:dr $arg]\""; qb:saveqts  if {$qb(logactions)} {qb:log "DEL PUB $n $c [qb:dr $arg]"} }}proc qb:deldcc {h idx arg} { global qb qbl set del ""; set nodel ""; set i 0; regsub -all \\*|\\? $arg "" arg if {$qb(chanspec)} {  if {[llength $arg] &lt; 2} {putdcc $idx "Usage: ${qb(trigger)}delquote &lt;channel&gt; &lt;index ?index index ..?|mask&gt;"; return}  set c [string tolower [lindex $arg 0]]; set arg [lrange [qb:rs $arg] 1 end]  if {![string match #* $c]} {putdcc $idx "Usage: ${qb(trigger)}delquote &lt;channel&gt; &lt;index ?index index ..?|mask&gt;"; return}  if {[string is integer [lindex $arg 0]]} {   foreach e $arg {    set f 0    foreach el [array names qbl] {     set ele [split $el #]     if {[string match "#[lindex $ele 2]" $c] &amp;&amp; [string match -nocase [lindex $ele 1] $e]} {unset qbl($el); lappend del $e; set f 1; qb:delnew [lindex $ele 0]}    }    if {!$f} {lappend nodel $e}   }   if {$del != ""} {putdcc $idx "Deleted indices [join $del ", "] for $c"; if {$qb(logactions)} {qb:log "DEL DCC $h $c [qb:dr $arg]"}}   if {$nodel != ""} {putdcc $idx "I can't find indices [join $nodel ", "] for $c"}   qb:saveqts; return  }  foreach e [array names qbl] {   if {[string match "#[lindex [split $e #] 2]" $c] &amp;&amp; [string match -nocase *$arg* $qbl($e)]} {unset qbl($e); incr i; qb:delnew [lindex [split $e #] 0]}  }  if {!$i} {putdcc $idx "Can't find a quote for $c matching \"[qb:dr $arg]\""; return} else {   putdcc $idx "Removed $i quote(s) for $c matching \"[qb:dr $arg]\""; qb:saveqts  }  if {$qb(logactions)} {qb:log "DEL DCC $h $c [qb:dr $arg]"} } else {  if {[llength $arg] == 0} {putdcc $idx "Usage: ${qb(trigger)}delquote &lt;index ?index index ..?|mask&gt;"; return}  set arg [qb:rs $arg]  if {[string is integer [lindex $arg 0]]} {   foreach e $arg {    set f 0    foreach el [array names qbl] {     set ele [lindex [split $el #] 0]     if {[string match -nocase $ele $e]} {unset qbl($el); lappend del $e; set f 1; qb:delnew $ele}    }    if {!$f} {lappend nodel $e}   }   if {$del != ""} {putdcc $idx "Deleted indices [join $del ", "]"; if {$qb(logactions)} {qb:log "DEL DCC $h [qb:dr $arg]"}}   if {$nodel != ""} {putdcc $idx "I can't find indices [join $nodel ", "]"}   qb:saveqts; return  }  foreach e [array names qbl] {if {[string match -nocase *$qbl($e)* $arg]} {unset qbl($e); incr i; qb:delnew [lindex [split $e #] 0]}}    if {!$i} {putdcc $idx "Can't find a quote matching \"[qb:dr $arg]\""; return} else {   putdcc $idx "Removed $i quote(s) matching \"[qb:dr $arg]\""; qb:saveqts   if {$qb(logactions)} {qb:log "DEL DCC $h [qb:dr $arg]"}  } }}proc qb:copy {h idx arg} { global qb qbl if {!$qb(chanspec)} {putdcc $idx "Command not available (script option \"channel specific quotes\" is disabled)"; return} set fromc [string tolower [lindex $arg 0]]; set toc [string tolower [lindex $arg 1]] if {$fromc == $toc || [llength $arg] != 2} {putdcc $idx "Usage: copyquotes &lt;fromchannel&gt; &lt;tochannel&gt;"; return} qb:findnn $toc; set l "" foreach e [array names qbl] {if {[string match "#[lindex [split $e #] 2]" $fromc]} {lappend l $qbl($e)}} if {[llength $l] == 0} {putdcc $idx "Can't find any quotes for $fromc."; return} foreach e $l {set qbl($qb(nextind)#$qb(nextcind)$toc) $e; incr qb(nextind); incr qb(nextcind)} qb:saveqts; putdcc $idx "Done. Copied [llength $l] quotes from $fromc to $toc" if {$qb(logactions)} {qb:log "CPY DCC $h from $fromc to $toc"}}proc qb:delchan {h idx arg} { global qb qbl if {!$qb(chanspec)} {putdcc $idx "Command not available (script option \"channel specific quotes\" is disabled)"; return} set c [string tolower $arg]; set l "" if {[llength $arg] != 1} {putdcc $idx "Usage: delchanquotes &lt;channel&gt;"; return} foreach e [array names qbl] {if {[string match "#[lindex [split $e #] 2]" $c]} {lappend l $e}} if {[llength $l] == 0} {putdcc $idx "Can't find any quotes for $c."; return} foreach e $l {unset qbl($e)}; qb:saveqts; putdcc $idx "Done. Deleted [llength $l] quotes from $c." if {$qb(logactions)} {qb:log "DLC DCC $h $c"}}proc qb:delnew {what} { global qb qbl set pos [lsearch $qb(new) $what]; if {$pos &gt; -1} {set qb(new) [lreplace $qb(new) $pos $pos]}}proc qb:random {c} { global qb qbl set l "" if {$qb(chanspec)} {  foreach e [array names qbl] {if {[string match "#[lindex [split $e #] 2]" $c]} {lappend l $e}}; set i 1  } else {  foreach e [array names qbl] {lappend l $e}; set i 0 } if {[llength $l] &gt; 0} {set e [lindex $l [rand [llength $l]]]} else {return}   set e [lindex $l [rand [llength $l]]]; return "(#[lindex [split $e #] $i]) [qb:dr $qbl($e)]" }proc qb:findnn {c} { global qb qbl set alist ""; set clist ""; set a [array names qbl] foreach e $a {lappend alist [lindex [split $e #] 0]} set qb(nextind) [expr [lindex [lsort -decreasing -integer $alist] 0] + 1] foreach e $a {  set el [split $e #]  if {[string match "#[lindex $el 2]" $c]} {lappend clist [lindex $el 1]} } set qb(nextcind) [expr [lindex [lsort -decreasing -integer $clist] 0] + 1]}proc qb:rs {i} { global numversion regsub -all \\\\ $i !%01 i; regsub -all \\\[ $i !%02 i; regsub -all \\\] $i !%03 i regsub -all \\\} $i !%04 i; regsub -all \\\{ $i !%05 i; regsub -all \\\^ $i !%06 i regsub -all \\\" $i !%07 i; regsub -all \\\* $i !%08 i; regsub -all \\\? $i !%09 i if {$numversion &lt; 1060400} {  regsub -all Ä $i AE i; regsub -all ä $i ae i; regsub -all Ö $i OE i  regsub -all ö $i oe i; regsub -all Ü $i UE i; regsub -all ü $i ue i  regsub -all ß $i ss i; regsub -all Ý $i Y i; regsub -all ý $i y i } return $i}proc qb:dr {i} { regsub -all !%01 $i \\ i; regsub -all !%02 $i \[ i; regsub -all !%03 $i \] i regsub -all !%04 $i \} i; regsub -all !%05 $i \{ i; regsub -all !%06 $i \^ i regsub -all !%07 $i \" i; regsub -all !%08 $i \* i; regsub -all !%09 $i \? i return $i}if {[array exist qbt]} {unset qbt}foreach t [timers] {if {[lsearch -regexp $t qb:scheduled] &gt; -1} {killtimer [lindex $t 2]}}set qb(new) ""; set qb(conversion) 0; qb:readif {$qb(new) != ""} {set qbinsert ", [llength $qb(new)] new"} else {set qbinsert ""}putlog "TCL LOADED: QuoteBot v2.0 by Baerchen. [llength [array names qbl]] Quotes in database${qbinsert}."if {$qb(conversion)} { putlog "            Converted old database. Quotes assigned to channel #quotebot" putlog "            Use command .copyquotes to assign them to other channels" putlog "            This is _only_ needed if you chose to have channel specific quotes"}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7056">fredvil</a> — Tue Oct 31, 2006 7:35 am</p><hr />
]]></content>
	</entry>
	</feed>
