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

	<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>2010-10-17T17:10:51-04:00</updated>

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

		<entry>
		<author><name><![CDATA[SL0RD]]></name></author>
		<updated>2010-10-17T17:10:51-04:00</updated>

		<published>2010-10-17T17:10:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=94787#p94787</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=94787#p94787"/>
		<title type="html"><![CDATA[Info/command database]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=94787#p94787"><![CDATA[
yea that worked, thanks a lot<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10253">SL0RD</a> — Sun Oct 17, 2010 5:10 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[tomekk]]></name></author>
		<updated>2010-10-17T16:54:22-04:00</updated>

		<published>2010-10-17T16:54:22-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=94786#p94786</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=94786#p94786"/>
		<title type="html"><![CDATA[Info/command database]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=94786#p94786"><![CDATA[
yap, cause the files on the disk are case sensitive,<br><br>try to change:<div class="codebox"><p>Code: </p><pre><code>set trigger_name [lindex $input_data 1]</code></pre></div>to:<div class="codebox"><p>Code: </p><pre><code>set trigger_name [string tolower [lindex $input_data 1]]</code></pre></div>lemme know about it, if this will not work then i will check it on some egg.<br><br>//<br>anyway, thanks for info - this is a bug <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><br>[a-zA-Z] will not work with:<div class="codebox"><p>Code: </p><pre><code>set cmd_name [string tolower [lindex $input_data 0]]</code></pre></div>because command name will be always 'tolower'<br><br>this should be fixed but i'm kinda lazy ass..<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10332">tomekk</a> — Sun Oct 17, 2010 4:54 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SL0RD]]></name></author>
		<updated>2010-10-17T16:51:08-04:00</updated>

		<published>2010-10-17T16:51:08-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=94785#p94785</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=94785#p94785"/>
		<title type="html"><![CDATA[Info/command database]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=94785#p94785"><![CDATA[
ok, well i tried that and the commands wouldnt work. I even tried changing it to just A-Z and command in all caps wouldn't work.<br>When i had it as [a-zA-Z0-9] only lowercase commands would work, it would allow me to add, del, and modify them. but they just wouldn't work<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10253">SL0RD</a> — Sun Oct 17, 2010 4:51 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[tomekk]]></name></author>
		<updated>2010-10-17T16:45:54-04:00</updated>

		<published>2010-10-17T16:45:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=94784#p94784</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=94784#p94784"/>
		<title type="html"><![CDATA[Info/command database]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=94784#p94784"><![CDATA[
change:<div class="codebox"><p>Code: </p><pre><code>set trigger_regexp {^\![a-z]+$}</code></pre></div>to:<div class="codebox"><p>Code: </p><pre><code>set trigger_regexp {^\![a-zA-Z0-9]+$}</code></pre></div>it this case, commands will be case sensitive, <br>if you want to make !TEST same as !test you have to tweak some code inside this script<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10332">tomekk</a> — Sun Oct 17, 2010 4:45 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SL0RD]]></name></author>
		<updated>2010-10-17T13:26:37-04:00</updated>

		<published>2010-10-17T13:26:37-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=94775#p94775</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=94775#p94775"/>
		<title type="html"><![CDATA[Info/command database]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=94775#p94775"><![CDATA[
Thanks a lot, that works great BUT I have one more request, is it possible to have commands with numbers and capital letters in them?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10253">SL0RD</a> — Sun Oct 17, 2010 1:26 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[tomekk]]></name></author>
		<updated>2010-05-21T09:57:31-04:00</updated>

		<published>2010-05-21T09:57:31-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=93138#p93138</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=93138#p93138"/>
		<title type="html"><![CDATA[Info/command database]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=93138#p93138"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code># Author: tomekk# e-mail:  tomekk/@/oswiecim/./eu/./org# home page: http://tomekk.oswiecim.eu.org/## Version 0.1## This file is Copyrighted under the GNU Public License.# http://www.gnu.org/copyleft/gpl.html# if you want to use this script on your chan, type in eggdrop console (via telnet or DCC chat)# .chanset #channel_name +triggers# and later .save# trigger name regexp (default: !&lt;chars&gt;)set trigger_regexp {^\![a-z]+$}# 'database' fileset dbase "triggers.db"################################################################################################bind pubm - "*" catch_fctsetudef flag triggersif {[file exists $dbase] == 0} {set new_f [open $dbase w]close $new_f}proc readdb { } {global dbaseset get_data [open $dbase r]set entries [split [read $get_data] "\n"]close $get_datareturn $entries}proc check_if_exists { cmd } {set yeah_got_it 0foreach each_line [readdb] {if {$each_line != ""} {set the_cmd_name [lindex [split $each_line ":"] 0]if {$the_cmd_name == $cmd} {set yeah_got_it 1break}}}return $yeah_got_it}proc get_trigger_data { cmd } {set proc_output ""foreach db_line [readdb] {if {$db_line != ""} {set db_line_data [split $db_line ":"]set db_cmd [lindex $db_line_data 0]set db_data [join [lrange $db_line_data 1 end] ":"]if {$db_cmd == $cmd} {set proc_output $db_databreak}}}return $proc_output}proc catch_fct { nick uhost hand chan arg } {global dbase trigger_regexpif {![channel get $chan triggers]} {return                  }set input_data [split $arg]set cmd_name [string tolower [lindex $input_data 0]]set trigger_name [lindex $input_data 1]set trigger_data [join [lrange $input_data 2 end]]switch -- $cmd_name {"!add" {if {($trigger_name != "") &amp;&amp; ($trigger_data != "")} {if {[regexp $trigger_regexp $trigger_name]} {if {[check_if_exists $trigger_name] == 0} {set new_entry [open $dbase a]puts $new_entry "$trigger_name:$trigger_data"close $new_entry} {putquick "PRIVMSG $chan :trigger with this name already exists"}} {putquick "PRIVMSG $chan :wrong trigger name"}} {putquick "PRIVMSG $chan :use: !add &lt;trigger_name&gt; &lt;trigger_data&gt;"}}"!del" {if {$trigger_name != ""} {if {[regexp $trigger_regexp $trigger_name]} {if {[check_if_exists $trigger_name] == 1} {set old_db [readdb]set new_db [open $dbase w]foreach new_db_line $old_db {if {$new_db_line != ""} {set old_trigger_name [lindex [split $new_db_line ":"] 0]if {$old_trigger_name != $trigger_name} {puts $new_db $new_db_line}}}close $new_db} {putquick "PRIVMSG $chan :trigger doesn't exists"}} {putquick "PRIVMSG $chan :wrong trigger name"}} {putquick "PRIVMSG $chan :use: !del &lt;trigger_name&gt;"}}"!mod" { if {($trigger_name != "") &amp;&amp; ($trigger_data != "")} { if {[regexp $trigger_regexp $trigger_name]} { if {[check_if_exists $trigger_name] == 1} { set old_m_db [readdb]set new_m_db [open $dbase w]foreach new_m_db_line $old_m_db {if {$new_m_db_line != ""} {set old_m_trigger_name [lindex [split $new_m_db_line ":"] 0]if {$old_m_trigger_name == $trigger_name} {puts $new_m_db "$trigger_name:$trigger_data"} {puts $new_m_db $new_m_db_line}}}close $new_m_db } { putquick "PRIVMSG $chan :trigger doesn't exists" }} {putquick "PRIVMSG $chan :wrong trigger name"} } { putquick "PRIVMSG $chan :use: !mod &lt;trigger_name&gt; &lt;trigger_data&gt;" }}"!triggers" {set triggers_list [list]foreach trigger_cmd [readdb] {if {$trigger_cmd != ""} {set tr_name [lindex [split $trigger_cmd ":"] 0]lappend triggers_list $tr_name}}if {[llength $triggers_list] &gt; 0} {putquick "PRIVMSG $chan :the available triggers are: [join $triggers_list ", "]"} {putquick "PRIVMSG $chan :database is empty"}}default {if {[regexp $trigger_regexp $cmd_name]} {set trigger_db_data [get_trigger_data $cmd_name]if {$trigger_db_data != ""} {putquick "PRIVMSG $chan :$trigger_db_data"} {putquick "PRIVMSG $chan :trigger doesn't exists"}}}}}putlog "triggers.tcl ver 0.1 by tomekk loaded"</code></pre></div>try this one, <br>commands: !add, !del, !mod, !triggers are reserved<br><br>try it<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10332">tomekk</a> — Fri May 21, 2010 9:57 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SL0RD]]></name></author>
		<updated>2010-05-20T14:00:20-04:00</updated>

		<published>2010-05-20T14:00:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=93134#p93134</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=93134#p93134"/>
		<title type="html"><![CDATA[Info/command database]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=93134#p93134"><![CDATA[
ok well thats kinda like what i want but if possible i don't want a space between the command and the trigger.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10253">SL0RD</a> — Thu May 20, 2010 2:00 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[tomekk]]></name></author>
		<updated>2010-05-20T13:56:38-04:00</updated>

		<published>2010-05-20T13:56:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=93133#p93133</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=93133#p93133"/>
		<title type="html"><![CDATA[Info/command database]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=93133#p93133"><![CDATA[
check TCL archive, i've made something smiliar<br><a href="http://www.egghelp.org/cgi-bin/tcl_archive.tcl?mode=download&amp;id=1333" class="postlink">http://www.egghelp.org/cgi-bin/tcl_arch ... ad&amp;id=1333</a><br><br>if you want it for all users, change rights at 'bind',<br><br>try it<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10332">tomekk</a> — Thu May 20, 2010 1:56 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SL0RD]]></name></author>
		<updated>2010-05-18T21:40:51-04:00</updated>

		<published>2010-05-18T21:40:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=93125#p93125</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=93125#p93125"/>
		<title type="html"><![CDATA[Info/command database]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=93125#p93125"><![CDATA[
I have searched for hours to try and find a script to do what i want, but nothing works correctly or does the tings that i want. I also attempted to write a script myself but i became lost and couldn't figure things out very early on.<br><br>Basically what I want to do is have database that keeps a list of triggers and their responses that i can add to, delete from and modify. so it would need to have a command to add and delete triggers, as well as a command to list all the available triggers in the database. so something like,<br><div class="codebox"><p>Code: </p><pre><code>&lt;Admin&gt; !add !help Simply ask your question and someone will be with you as soon as possible.&lt;Bot&gt; Command created successfully</code></pre></div>Then any user can use that command, so..<div class="codebox"><p>Code: </p><pre><code>&lt;user&gt; !help&lt;bot&gt; Simply ask your question and someone will be with you as soon as possible.</code></pre></div>And for the list commands part <div class="codebox"><p>Code: </p><pre><code>&lt;Admin&gt; !triggers&lt;Bot&gt; the available commands are: !help, !site</code></pre></div>i think that covers everything, i have been trying for months to create/find something like this, any help will be muchly appreciated<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10253">SL0RD</a> — Tue May 18, 2010 9:40 pm</p><hr />
]]></content>
	</entry>
	</feed>
