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

	<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>2012-06-14T16:49:42-04:00</updated>

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

		<entry>
		<author><name><![CDATA[alxd]]></name></author>
		<updated>2012-06-14T14:44:34-04:00</updated>

		<published>2012-06-14T14:44:34-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=99603#p99603</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=99603#p99603"/>
		<title type="html"><![CDATA[Certain text message on certain timer]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=99603#p99603"><![CDATA[
<blockquote class="uncited"><div>Try this :<br><br>Should work:<br><div class="codebox"><p>Code: </p><pre><code>proc putnoobuser { chan nick } {putserv "NOTICE $nick : $nick You dont have the needed access!"}bind pub -|- !addnews pub_doadvertismentbind pub -|- !deletenews pub_killadvertisment ######################### Make Advertisment #########################proc pub_doadvertisment {nick uhost hand chan arg} {global advertismentid advertismenttimeif {![isop $nick $chan]} {putnoobuser $chan $nick ; return 0}set advertisment [join [lrange [split $arg] 1 end]]set advertismenttime [join [lrange [split $arg] 0 0]]set advertismentid($advertisment) [timer $advertismenttime "showadvertisment $chan "$advertisment" "$advertisment""]putserv "NOTICE $nick :Advertisment "$advertisment" is now createt with interval $advertismenttime min(s)"}###################     End     ############################################ Show Advertisment #########################proc showadvertisment {chan id advertisment} {global advertismentid advertismenttime set advertisment [join [lrange [split $advertisment] 0 end]]putserv "PRIVMSG $chan :Advertisment: $advertisment"set advertismentid($advertisment) [timer $advertismenttime "showadvertisment $chan "$advertisment" "$advertisment""]}###################     End     ############################################ Kill Advertisment #########################proc pub_killadvertisment {nick uhost hand chan arg} {global advertismentid advertismenttimeif {![isop $nick $chan]} {putnoobuser $chan $nick ; return 0}set arg [join [lrange [split $arg] 0 end]] killtimer $advertismentid($arg)putserv "NOTICE $nick :Advertisment "$arg" is now deletet"}###################     End     ###################putlog "Advertisment Loaded"</code></pre></div></div></blockquote>22:36:46 me: advadd 1 test001   <br>22:36:54 bot: Advertisment "test001" activated with interval 1 min(s)<br><strong class="text-strong">22:37:01</strong> bot: test001     <br><br>I added 1 minute, but it works much earlier.. + if I add second advertisment, it performs with more delay but only one time<br><br>Also, there's lack of advertisments list command and there can be added empty message to timer.<br><br>bot: Advertisment "" activated with interval test min(s)<br><br>Thanks in advance!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12013">alxd</a> — Thu Jun 14, 2012 2:44 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2012-06-14T14:41:11-04:00</updated>

		<published>2012-06-14T14:41:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=99602#p99602</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=99602#p99602"/>
		<title type="html"><![CDATA[Certain text message on certain timer]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=99602#p99602"><![CDATA[
A few remarks...<div class="codebox"><p>Code: </p><pre><code>set advertismentid($advertisment) [timer $advertismenttime "showadvertisment $chan \"$advertisment\" \"$advertisment\""]</code></pre></div>This is a very bad way of starting timers.. Since the contents of <em class="text-italics">advertisment</em> originates from a possibly untrusted user, it could contain malicious things such as [adduser badboy *!*@*] and [chattr badboy +n].<br>As the timer expires, that would be executed, adding a new user to the bot with owner privileges...<br><br>The proper way is to use <strong class="text-strong">list</strong><div class="codebox"><p>Code: </p><pre><code>set advertismentid($advertisment) [timer $advertismenttime [list showadvertisment $chan $advertisment $advertisment]]</code></pre></div><div class="codebox"><p>Code: </p><pre><code>set advertismenttime [join [lrange [split $arg] 0 0]]</code></pre></div>This could be simplified:<div class="codebox"><p>Code: </p><pre><code>set advertismenttime [lindex [split $arg] 0]</code></pre></div><div class="codebox"><p>Code: </p><pre><code>set arg [join [lrange [split $arg] 0 end]]</code></pre></div>This is pretty much a no-op... you split the string to a list, select a subset from the first to the last element (inclusive, being the whole list), and then convert it back into a string (should be the very same string you started with).<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Thu Jun 14, 2012 2:41 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Fire-Fox]]></name></author>
		<updated>2012-06-14T16:49:42-04:00</updated>

		<published>2012-06-14T14:29:27-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=99601#p99601</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=99601#p99601"/>
		<title type="html"><![CDATA[Certain text message on certain timer]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=99601#p99601"><![CDATA[
Try this :<br><br>Should work:<br><div class="codebox"><p>Code: </p><pre><code>proc putnoobuser { chan nick } {putserv "NOTICE $nick : $nick You dont have the needed access!"}bind pub -|- !addnews pub_doadvertismentbind pub -|- !deletenews pub_killadvertisment ######################### Make Advertisment #########################proc pub_doadvertisment {nick uhost hand chan arg} {global advertismentid advertismenttimeif {![isop $nick $chan]} {putnoobuser $chan $nick ; return 0}set advertisment [join [lrange [split $arg] 1 end]]set advertismenttime [lindex [split $arg] 0]set advertismentid($advertisment) [timer $advertismenttime [list showadvertisment $chan $advertisment $advertisment]]putserv "NOTICE $nick :Advertisment \"$advertisment\" is now createt with interval $advertismenttime min(s)"}###################     End     ############################################ Show Advertisment #########################proc showadvertisment {chan id advertisment} {global advertismentid advertismenttime set advertisment [join [lrange [split $advertisment] 0 end]]putserv "PRIVMSG $chan :Advertisment: $advertisment"set advertismentid($advertisment) [timer $advertismenttime [list showadvertisment $chan $advertisment $advertisment]]}###################     End     ############################################ Kill Advertisment #########################proc pub_killadvertisment {nick uhost hand chan arg} {global advertismentid advertismenttimeif {![isop $nick $chan]} {putnoobuser $chan $nick ; return 0}set arg [join [lrange [split $arg] 0 end]] killtimer $advertismentid($arg)putserv "NOTICE $nick :Advertisment \"$arg\" is now deletet"}###################     End     ###################putlog "Advertisment Loaded"</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8230">Fire-Fox</a> — Thu Jun 14, 2012 2:29 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[alxd]]></name></author>
		<updated>2012-06-14T04:43:27-04:00</updated>

		<published>2012-06-14T04:43:27-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=99600#p99600</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=99600#p99600"/>
		<title type="html"><![CDATA[Certain text message on certain timer]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=99600#p99600"><![CDATA[
Hello,<br><br>I need an advertisment script that will let to add multiple text messages (supporting color codes/bold/underline) and set it to repeat each on certain timers (one message - 20 minutes, another - 40, for example). Would be good if they could be added via public commands. Searched public tcl archive for something like that - the only similar is <a href="http://forum.egghelp.org/viewtopic.php?t=18928" class="postlink">http://forum.egghelp.org/viewtopic.php?t=18928</a><br><br>Something like mIRC /timer:<br><br>/timer 0 20 /msg #chan text<br>/timer 0 40 /msg #chan text2<br>...<br><br>Thanks in advance!<br><br>P.S. Can reward via Paypal <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12013">alxd</a> — Thu Jun 14, 2012 4:43 am</p><hr />
]]></content>
	</entry>
	</feed>
