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

	<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>2020-04-17T21:24:29-04:00</updated>

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

		<entry>
		<author><name><![CDATA[ComputerTech]]></name></author>
		<updated>2020-04-17T21:24:29-04:00</updated>

		<published>2020-04-17T21:24:29-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=108231#p108231</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=108231#p108231"/>
		<title type="html"><![CDATA[Need help with ad script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=108231#p108231"><![CDATA[
or usd ADV on Timer made by Jingyou on the tcl archive you can chooses which channels and picks random set advertisement lines from a txt file sounds perfect for your request <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12849">ComputerTech</a> — Fri Apr 17, 2020 9:24 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2019-01-07T02:45:03-04:00</updated>

		<published>2019-01-07T02:45:03-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=107322#p107322</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=107322#p107322"/>
		<title type="html"><![CDATA[Need help with ad script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=107322#p107322"><![CDATA[
The command isn't working because this line:<div class="codebox"><p>Code: </p><pre><code>bind pub $trigger send:adv </code></pre></div>is missing it's <em class="text-italics">flags</em> since the syntax is: <em class="text-italics">bind pub &lt;flags&gt; &lt;command&gt; &lt;proc&gt;</em>, so it should be:<div class="codebox"><p>Code: </p><pre><code>bind pub * $trigger send:adv</code></pre></div>since you want to be triggered by everyone, meaning even people that don't have access to the bot.<br><br>I don't understand what's this line:<div class="codebox"><p>Code: </p><pre><code>if {![string match *[lindex $channel 0]* $no_adv]} { </code></pre></div>supposed to do since there's no <em class="text-italics">no_adv</em> variable.<br><br>I don't get it why loop over the <em class="text-italics">adv_chans</em> in:<div class="codebox"><p>Code: </p><pre><code>foreach channel $adv_chans {      if {![string match *[lindex $channel 0]* $no_adv]} {        if {$header == ""} {          putserv "PRIVMSG $channel :$msg"        } else { putserv "PRIVMSG $channel :$header $msg" }      }    }</code></pre></div>when can use <em class="text-italics">lsearch -nocase</em> like:<div class="codebox"><p>Code: </p><pre><code>if {[lsearch -nocase $adv_chans $chan] &gt; -1} {... and the other stuff</code></pre></div>I would honestly consider doing this from scratch to match your needs and make use of crontab (<em class="text-italics">cron</em> bind in eggdrop) instead of timers and whatever the author wanted to achieve in <em class="text-italics">advmsg</em> proc.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Mon Jan 07, 2019 2:45 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[crymsun]]></name></author>
		<updated>2019-01-06T17:41:42-04:00</updated>

		<published>2019-01-06T17:41:42-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=107319#p107319</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=107319#p107319"/>
		<title type="html"><![CDATA[Need help with ad script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=107319#p107319"><![CDATA[
Below is the script I got from the tcl archive... and made adjustments for my channel. But for some reason, it loads fine but doesn't work. <br><br>What I would like it to do is:<br>- upon the !topic command, bot should randomly select a line from the topic.txt file<br>- the line should be posted to the channel for all to see<br>- anyone should be able to use the trigger<br><br>This is the script I was working with, with my edits:<br><div class="codebox"><p>Code: </p><pre><code>### Simple Advertise 1.2. by DeeJay###### Thanks to #TCL @ Quakenet for all the help### and NO^DICKHILL for putting his eggdrops### thru what my script did to them.###### Usage: !advertise will advertise a random### advertise to all channels from the specified### file (Bellow here) - The script will automaticly### attempt to take a random line from the### advertise database and send it to the channels.###### This script may be edited as much you want### Aslong as these lines remains.###### Contact### irc: #nequam @ quakenet### msn: djs@deejay-spunk.dk### mail: djs@deejay-spunk.dk###### Changelog:### 1.2) Completly rewrite of the whole script, added alot of new stuff (Still SIMPLE)### 1.1) Fixed some bugs with the timing stuff### 1.0) First release### Advertisement trigger, to trigger a advertising outside the timer.set trigger "!topic"### "Header" - This will show when your bot advertises like 'Header advertise-message'### Example: [Advertise] bla bla bla bla bla### Leave empty if you dont want to use this.set header "Y/your topic, as requested..."### If you want the messages only to be shown in a specific timesquare, then put in the times here### (20:00 to 21:00 etc, seperate with spaces, for no timer you can write like: 00:00 23:59)set adv_time "00:00 23:59"### The file where the advertise messages is stored in. (FILE MUST EXISTS IN THAT FOLDER!### Remember to give read access to the file, chmod 644 or something)###### Linux: touch /path/to/my/file &amp;&amp; chmod 644 /path/to/my/file### Then edit the file with your favourite editor like 'nano' or 'vi' and wrote your### advertisements there.set adv_file "/home/paradisum/eggdrop1.8/scripts/data/topic.txt"### Channels the advertise message should go to. For all channels, write ALL only.### e.g: #chan1 #chan2 #chan3set adv_chans "#DsParadisum"### How long time between the messages (In minutes)set adv_timer "300"################################################################ Code bellow, Only edit if you know what you are doing ################################################################bind pub $trigger send:advproc adv:timer {} {  global adv_timer  if {[timerexists adv:do] == ""} { timer $adv_timer adv:do }}adv:timerproc send:adv {nick chan host handle text} {  global adv_chans header  set schan [string trim $chan "#+&amp;!"]  set msg "[advmsg]"  if {[string tolower $adv_chans] == "all"} {    foreach channel [channels] {      if {![string match *[lindex $channel 0]* $no_adv]} {        if {$header == ""} {          putserv "PRIVMSG $channel :$msg"        } else { putserv "PRIVMSG $channel :$header $msg" }      }    }  } else {    foreach channel $adv_chans {      if {![string match *[lindex $channel 0]* $no_adv]} {        if {$header == ""} {          putserv "PRIVMSG $channel :$msg"        } else { putserv "PRIVMSG $channel :$header $msg" }      }    }  }}proc adv:do {} {  global adv_chans adv_timer adv_time no_adv header  set msg "[advmsg]"  if {[string tolower $adv_chans] == "all"} {    foreach channel [channels] {      if {![string match *[lindex $channel 0]* $no_adv]} { putserv "PRIVMSG $channel :$header $msg" }    }  } else {    foreach channel $adv_chans {      if {![string match *[lindex $channel 0]* $no_adv]} { putserv "PRIVMSG $channel :$header $msg" }    }  }  adv:timer}proc advmsg {} {  global adv_file adv_from adv_to adv_time  set first "[lindex [split "$adv_time"] 0]"  set second "[lindex [split "$adv_time"] 1]"  set time [strftime %H%M]  if {$time &lt;= "[string map {{:} {}} $second]" || $time &gt;= "[string map {{:} {}} $first]"} {    set x ""    while {$x == ""} {      set f [open $adv_file]      set l [split [read $f] \n]      close $f      set n [rand [llength $l]]      if {[set x [lindex $l $n]]!=""} {return "$x"}    }  }}putlog "\002//-- Advertise script by DeeJay loaded successfully --//\002</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12774">crymsun</a> — Sun Jan 06, 2019 5:41 pm</p><hr />
]]></content>
	</entry>
	</feed>
