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

	<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>2018-12-04T20:54:33-04:00</updated>

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

		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2018-12-04T20:54:33-04:00</updated>

		<published>2018-12-04T20:54:33-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=107265#p107265</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=107265#p107265"/>
		<title type="html"><![CDATA[Say !know]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=107265#p107265"><![CDATA[
Try adding this to your script somewhere.<div class="codebox"><p>Code: </p><pre><code>bind pub - !know adv:knowproc adv:know {nk uh hn ch tx} {global adv  if {[lsearch -nocase $adv(chans) $ch] &lt; 0} { return 0 }  putserv "PRIVMSG $ch :[lindex $adv(text) [rand [llength $adv(text)]]]"}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Tue Dec 04, 2018 8:54 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[crymsun]]></name></author>
		<updated>2018-12-02T12:12:21-04:00</updated>

		<published>2018-12-02T12:12:21-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=107254#p107254</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=107254#p107254"/>
		<title type="html"><![CDATA[Timed Messages - adding trigger]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=107254#p107254"><![CDATA[
I had wanted timed "Did you know?" messages to display on the channel every 30 min (or whatever interval), and also upon the !know trigger.<br><br>I am asking for help with:<br><br> - how can I add the !know trigger so that a line from the text file is posted every 30 min, and in addition when a user types !know, the bot randomly selects a line and posts it to the channel (without interrupting the 30 min intervals)?<br><br>I had originally tried a script from the archive that had the trigger, but it completely crashed my bot, so I searched for another.<br><br>Here is the code:<div class="codebox"><p>Code: </p><pre><code>## adv.tcl -- 1.5 *BETA*##   Allows you to advertise across many channels, usually used in #     large channels or shell channels.## Copyright (c) 2010 HM2K## Name: Channel Advertisement# Author: HM2K &lt;irc@hm2k.org&gt;# License: http://www.opensource.org/licenses/bsd-license.php BSD License# Link: http://# Labels: advertise, channel# Updated: 29-Dec-2010####Revisions# 1.5   - improved header, added binds, fixed write bug, improved syntax# 1.4   - fixed a few syntax bugs# 1.3   - load/edit/add/delete ads from a text file now# 1.2   - minor changes# 1.1   - minor changes# 1.0   - innitial release###ToDo# 2.0   - ...### Usage#.+adv - \002Your Advert Here!\002 - An advert can be a great way for you to get people interested in your company/channel/website, we accept all types, if you would like to advertise please \002/MSG $owner for details\002#.+adv \002My Company\002: Details about your company here!#.-adv 1#.advlist### Settingsset adv(time) 30; # Time delay between advert messages. (in minutes)set adv(chans) "#DsParadisum"; #Channels to advertise inset adv(file) "/home/paradisum/eggdrop1.8/scripts/didyouknow.txt"; # Text file with lines of advert text### Bindsbind dcc m +adv adv:dccadd;bind dcc m -adv adv:dccdel;bind dcc m advlist adv:dcclist;### Variablesset adv(timer) 0;set adv(text) "";set adv(ver) "1.5";### Proceduresproc adv:dccadd {ha idx arg} {  global adv;if {[llength $arg]==0} { putidx $idx "Usage: .+adv &lt;advert text&gt;"; return; }set r [adv:add $arg];  if {$r == 0} {    putidx $idx "Advert add failed.";  } else {    putidx $idx "Advert added successfully.";  }}proc adv:add {info} {  global adv;  lappend adv(text) $info;  if {[catch {open $adv(file) a} advfile]} {    putlog "Unable to open file '$adv(file)' for writing.";    return 0;  }  puts $advfile $info;close $advfile;return 1;}proc adv:dccdel {ha idx arg} {  global adv;if {[llength $arg]==0} { putidx $idx "Usage: .-adv &lt;advert id&gt;"; return; }set r [adv:del $arg];  if {$r == 0} {    putidx $idx "Advert delete failed.";  } else {    putidx $idx "Advert deleted successfully.";  }}proc adv:del {id} {  global adv;    set adv(text) [lreplace $adv(text) $id $id];  return [adv:save];}proc adv:save {} {  global adv;  if {[catch {open $adv(file) w} advfile]} {    putlog "Unable to open file '$adv(file)' for writing.";    return 0;  }  foreach line $adv(text) {    puts $advfile $line;  }close $advfile;return 1;}proc adv:dcclist {ha idx arg} {  global adv;  set n 0;  foreach line $adv(text) {    putidx $idx "$n: $line";    incr n;  }}proc adv:print {} {global adv;  set advmsg [lindex $adv(text) [rand [llength $adv(text)]]];  foreach advchan $adv(chans) {  if {[info exists {advchan}] &amp;&amp; [info exists {advmsg}]} {      putserv "PRIVMSG $advchan :$advmsg";    }  }  timer ${adv(time)} adv:print;}proc adv:init {} {  global adv;  if {$adv(timer) != 1} {    set adv(timer) 1;    timer ${adv(time)} adv:print;  }  if {[catch {set advfile [open $adv(file) r]} advfile]} {    putlog "Unable to open file '$adv(file)' for reading.";    return 0;  }  while {![eof $advfile]} {    gets $advfile line;    lappend adv(text) "$line";  }}### Initialiseadv:init;### Loadedputlog "adv.tcl $adv(ver) loaded";</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12774">crymsun</a> — Sun Dec 02, 2018 12:12 pm</p><hr />
]]></content>
	</entry>
	</feed>
