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

	<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>2001-11-14T13:17:00-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2001-11-14T13:17:00-04:00</updated>

		<published>2001-11-14T13:17:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=1676#p1676</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=1676#p1676"/>
		<title type="html"><![CDATA[need help with a script i made]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=1676#p1676"><![CDATA[
thanks i'll start with that and see were i can take that now 1 question thought how could i get it to display the line(s) that it found in the file and maybe make it only display a certain amout of lines it found like i can set it to 5? <br><br>thanks stdragon this will get me started i appreciate the help : )<br><br>SnOoP<p>Statistics: Posted by Guest — Wed Nov 14, 2001 1:17 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2001-11-14T09:09:00-04:00</updated>

		<published>2001-11-14T09:09:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=1664#p1664</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=1664#p1664"/>
		<title type="html"><![CDATA[need help with a script i made]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=1664#p1664"><![CDATA[
I'm feeling verbose right now so I'll really lay out some stuff here.<br><br>For your search thing, here's some sample code. It opens up pubs.dat, reads all the lines, and searches for a line with the word "sheep" on it:<br><div class="codebox"><p>Code: </p><pre><code>set fp [open pubs.dat r]set lines [split [read $fp] n]close $fpset idx [lsearch -glob "*sheep*" $lines]if {$idx != -1} {  ... found at index $idx ...} else {  ... not found ....}</code></pre></div>For your flooding problem, try keeping a global array of times when people have spoken. That way you can choose to ignore people who have called your command in the last XX seconds. The code I put here is just the beginning.. you also need to monitor nick changes, parts, quits, kicks, etc, and adjust the array. To make the amount of time adjustable, use a variable instead of a fixed number.<br><div class="codebox"><p>Code: </p><pre><code>proc yourproc {nick uhost hand chan text} {  global spoken  set now [clock seconds]  if {[info exists spoken($nick)]} {    set time [expr $now - $spoken($nick)]    if {$time &lt; 43200} {return 0}    # Returns if less than 12 hours (43200 seconds)  }  set spoken($nick) $now  # Hasn't used us in last 12 hours, continue  ...}</code></pre></div>Are you sure you want to make your script adjustale during runtime? For some stuff, it's easy: the user can use .set variable newvalue, and that should be fine. For binds, you'll have to unbind() and then bind() the stuff all over again, so it's more work, and the user can't use .set. Also, if you want to make the changes permanent, you'll have to start storing config data in an external file, which makes it even more complicated, because then you have to have built-in default values for when the file doesn't exist.<br><br>Btw, you might find it helpful to check out tcl.activestate.com and look at the docs for all the tcl commands. They also have tutorials and howto's and stuff.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Wed Nov 14, 2001 9:09 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2001-11-14T03:35:00-04:00</updated>

		<published>2001-11-14T03:35:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=1658#p1658</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=1658#p1658"/>
		<title type="html"><![CDATA[need help with a script i made]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=1658#p1658"><![CDATA[
i'm making a script called pub releaser that will display pubs to anyone that types a trigger.. now i have some of it done and was wondering if it'd be possible to make it so people can search the list for a specific release ect now it holds all the releases in a file which i called pubs.dat so it would have to search that file but i don't know how to make it do it.. and also i'd like to make it so someone can't keep typing the triggers so it floods the room or lags the bot down.. and maybe make it is so that the person can only type it one time ever so often like once a day but needs to be made so i can adjust it if i need to and one more thing these triggers and flags can only be changed through editing the script i'd like to make it so i can change all of them in dcc chat with th e bot on the partyline.. can anyone help me with these?? thanks alot i'd appreciate it<br><br>SnOoP<br><br>&lt;font size=-1&gt;[ This Message was edited by: SnOoPDoGg187 on 2001-11-14 00:41 ]&lt;/font&gt;<p>Statistics: Posted by Guest — Wed Nov 14, 2001 3:35 am</p><hr />
]]></content>
	</entry>
	</feed>
