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

	<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>2023-01-07T08:10:40-04:00</updated>

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

		<entry>
		<author><name><![CDATA[flink]]></name></author>
		<updated>2023-01-07T08:10:40-04:00</updated>

		<published>2023-01-07T08:10:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111597#p111597</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111597#p111597"/>
		<title type="html"><![CDATA[Re: Limit requests to 2 per nick per 15 minutes]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111597#p111597"><![CDATA[
I need help with this part of the script:<br> putserv "warning $nick: No more than 2 requests in 15 minutes!" You could add how much time is left before you can reapply, example:<br>putserv "notice $nick: No more than 2 requests in 15 minutes! you have to wait 6 minutes to be able to requesting again"<br><blockquote class="uncited"><div>This code should limit script requests to 2 per nick for any 15 minute period<br><br>First add all of this code to the bottom of your script...<div class="codebox"><p>Code: </p><pre><code>proc too_many {nick uhost hand arg} {  global toomany  set nk [string tolower $nick]  set ut [unixtime]  set nowls [list]  if {[info exists toomany($nk)]} {    foreach expire $toomany($nk) {      if {$ut &lt; $expire} {  lappend nowls $expire  }    }  }  set toomany($nk) $nowls  if {[llength $nowls] &gt;= 2} {    putserv "notice $nick :No more than 2 requests in 15 minutes!"    return 1  }  lappend toomany($nk) [expr {$ut + (60 * 15)}]  return 0}bind cron - {*/10 * * * *} expire_too_manyproc expire_too_many {mn hr da mo wd} {  global toomany  set ut [unixtime]  foreach {aname avalue} [array get toomany] {    set nowls [list]    foreach expire $avalue {      if {$ut &lt; $expire} {  lappend nowls $expire  }    }    if {![llength $nowls]} {  unset toomany($aname)    } else {  set toomany($aname) $nowls  }  }}</code></pre></div>Then add this line to the top of each request process you would like to limit...<div class="codebox"><p>Code: </p><pre><code>  if {[too_many $nick $uhost $hand $arg]} {  return 0  }</code></pre></div>In "Tido's Modified Icecast2 Script", you have 2 request procs you will want to modify:<br>proc request (for public requests)<br>and:<br>proc request_pm (for private message requests)<br><br>That would make the beginning of your 2 request procs look something like this...<div class="codebox"><p>Code: </p><pre><code>proc request {nick uhost hand chan arg} {  if {[too_many $nick $uhost $hand $arg]} {  return 0  }  global dj  if {$dj != ""} {</code></pre></div><br>This all untested, please let me know how it all works out.</div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12899">flink</a> — Sat Jan 07, 2023 8:10 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[mabrook]]></name></author>
		<updated>2022-09-22T11:56:49-04:00</updated>

		<published>2022-09-22T11:56:49-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111416#p111416</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111416#p111416"/>
		<title type="html"><![CDATA[Request songs limit to 2 songs per person]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111416#p111416"><![CDATA[
script in first post updated...<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12921">mabrook</a> — Thu Sep 22, 2022 11:56 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[]x[]]></name></author>
		<updated>2022-09-17T10:47:49-04:00</updated>

		<published>2022-09-17T10:47:49-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111404#p111404</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111404#p111404"/>
		<title type="html"><![CDATA[Request songs limit to 2 songs per person]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111404#p111404"><![CDATA[
Mate can you upload this working modded version to the tcl archive. More people would love to use it if possible hehe<br><blockquote class="uncited"><div>thank you SpiKe^^ , this works for me. this is what i need.   <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy">  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy">  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"> <br><br><br><br>Now, this is an updated script now (to sum it up)<br><br><br>1. added <span style="color:orange">2 songs request per user / every 15minutes or the specific time you set</span><br>2. added bind for <span style="color:orange">bind pub o|- !advertise toggle_advertise</span>  which proc is already in the script<br>3. added <span style="color:orange">!radio on/off </span> <br><br><br><br><br>Thank you Egghelp Community for helping out.    <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_lol.gif" width="15" height="15" alt=":lol:" title="Laughing">  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_lol.gif" width="15" height="15" alt=":lol:" title="Laughing">  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_lol.gif" width="15" height="15" alt=":lol:" title="Laughing"></div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7216">]x[</a> — Sat Sep 17, 2022 10:47 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[mabrook]]></name></author>
		<updated>2021-09-21T01:53:03-04:00</updated>

		<published>2021-09-21T01:53:03-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=110342#p110342</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=110342#p110342"/>
		<title type="html"><![CDATA[Request songs limit to 2 songs per person]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=110342#p110342"><![CDATA[
thank you SpiKe^^ , this works for me. this is what i need.   <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy">  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy">  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"> <br><br><br><br>Now, this is an updated script now (to sum it up)<br><br><br>1. added <span style="color:orange">2 songs request per user / every 15minutes or the specific time you set</span><br>2. added bind for <span style="color:orange">bind pub o|- !advertise toggle_advertise</span>  which proc is already in the script<br>3. added <span style="color:orange">!radio on/off </span> <br><br><br><br><br>Thank you Egghelp Community for helping out.    <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_lol.gif" width="15" height="15" alt=":lol:" title="Laughing">  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_lol.gif" width="15" height="15" alt=":lol:" title="Laughing">  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_lol.gif" width="15" height="15" alt=":lol:" title="Laughing"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12921">mabrook</a> — Tue Sep 21, 2021 1:53 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2021-09-20T17:14:46-04:00</updated>

		<published>2021-09-20T17:14:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=110341#p110341</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=110341#p110341"/>
		<title type="html"><![CDATA[Request songs limit to 2 songs per person]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=110341#p110341"><![CDATA[
mabrook:<br><br>This code is untested and could surely use some more work.<br><br>First, add this code somewhere in the script...<div class="codebox"><p>Code: </p><pre><code># script on/off bind and procbind pub n| !radio radio_offproc radio_off {nick uhost hand chan arg} {  set opt [string tolower [lindex [split $arg] 0]]  if {$opt eq "off"} {    if {[info exists ::radio_off]} {      putserv "PRIVMSG $chan :Icecast2 script is already Off."    } else {      set ::radio_off 1      putserv "PRIVMSG $chan :Icecast2 script is now Off."    }  } elseif {$opt eq "on"} {    if {![info exists ::radio_off]} {      putserv "PRIVMSG $chan :Icecast2 script is already On."    } else {      unset ::radio_off      putserv "PRIVMSG $chan :Icecast2 script is now On."    }  } else {    if {[info exists ::radio_off]} {      putserv "PRIVMSG $chan :Icecast2 script is Off. To enable, use: !radio on"    } else {      putserv "PRIVMSG $chan :Icecast2 script is On. To disable, use: !radio off"    }  }  return 0}</code></pre></div><br>Then find this existing code in the proc statuscheck<div class="codebox"><p>Code: </p><pre><code>  if {$newstatus == "1" &amp;&amp; $oldstatus == "1"} {      utimer $onlinetimer [list statuscheck]      if {$newsong != $oldsong &amp;&amp; $newsong != "&gt;inbetween" &amp;&amp; $newsong != "&gt;inbetween1" &amp;&amp; $newsong != "&gt;inbetween2" &amp;&amp; $newsong != "&gt;whatutalkinbout" &amp;&amp; $newsong != "&gt;tmsradio80sintro"} {        putserv "PRIVMSG $radiochan :Now playing on $streamname: $newsong @ $streamurl"        set oldsong "$newsong"      }    } </code></pre></div>and make it look more like this...<div class="codebox"><p>Code: </p><pre><code>  if {$newstatus == "1" &amp;&amp; $oldstatus == "1"} {      utimer $onlinetimer [list statuscheck]      if {$newsong != $oldsong &amp;&amp; $newsong != "&gt;inbetween" &amp;&amp; $newsong != "&gt;inbetween1" &amp;&amp; $newsong != "&gt;inbetween2" &amp;&amp; $newsong != "&gt;whatutalkinbout" &amp;&amp; $newsong != "&gt;tmsradio80sintro"} {        if {![info exists ::radio_off]} {         putserv "PRIVMSG $radiochan :Now playing on $streamname: $newsong @ $streamurl"        }       set oldsong "$newsong"      }    }</code></pre></div>This should allow the script to continue to run as it always has, just keeping the now playing line from being sent to the channel.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Mon Sep 20, 2021 5:14 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[mabrook]]></name></author>
		<updated>2021-09-19T11:29:40-04:00</updated>

		<published>2021-09-19T11:29:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=110340#p110340</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=110340#p110340"/>
		<title type="html"><![CDATA[Request songs limit to 2 songs per person]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=110340#p110340"><![CDATA[
thank you for the response CrazyCat,<br><br><br>but i think the command;<div class="codebox"><p>Code: </p><pre><code>bind pub o|- !advertise toggle_advertise</code></pre></div><br>is for this;<div class="codebox"><p>Code: </p><pre><code>#How often the bot checks the stream when it knows it is online in seconds. Recommend 15 seconds.set onlinetimer "15"</code></pre></div>and the proc is this;<br><div class="codebox"><p>Code: </p><pre><code># Turns on and off Advertising. Also lets you set the interval: !advertise Xproc toggle_advertise {nick uhost hand chan arg} {  global radiochan enableadvertise adtimer  if {$enableadvertise == "1"} {    set enableadvertise "0"    set timerinfo [gettimerid]    killtimer $timerinfo    putserv "PRIVMSG $chan :Advertising OFF"  } else {    set enableadvertise "1"    if {$arg == ""} {      putserv "PRIVMSG $chan :Advertising ON. Frequency set to $adtimer minutes."    } else {      set adtimer $arg      putserv "privmsg $chan :Advertising ON. Frequency changed to $adtimer minutes."      timer $adtimer [list advertise]    }  }}</code></pre></div><br><br>am i right? just want to make a clarification.   <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz">  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz">  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz">  this is to advertise<br><div class="codebox"><p>Code: </p><pre><code># Messages that are displayed when Advertising is enabled.proc advertise {} {  global radiochan streamstatus otherchan enableadvertise adtimer forceadsent streamurl streamname  if {$streamstatus != "0" &amp;&amp; $enableadvertise == "1"} {    putserv "PRIVMSG $radiochan :$streamname is currently broadcasting live! Listen in @ $streamurl"    putserv "PRIVMSG $otherchan :$streamname is currently broadcasting live! Listen in @ $streamurl"    if {$forceadsent == "0"} {timer $adtimer [list advertise]} else {set forceadsent "0"}    return 1  }  return 0}</code></pre></div><br> I tried your suggestion but still the auto-show of the song still showing in the channel.<br><br><div class="codebox"><p>Code: </p><pre><code>&lt;@BOT&gt; [ Auto Dj  ] - Justin Bieber,Kehlani - Get Me&lt;@BOT&gt; [ Auto Dj  ] - Andy Williams - The First Time Ever (I Saw Your Face)&lt;@BOT&gt; [ Auto Dj  ] - Billie Eilish - Come Out And Play</code></pre></div><br>what i need is, when you type !radio off in the channel, it will completely turn-off the radio station and  not showing the song/s in the channel ( from the bot).<br>and when you type !radio on , it will completely show the playing song/s based in the radio station (from the bot).<br><div class="codebox"><p>Code: </p><pre><code>&lt;USER&gt; !radio off&lt;BOT&gt; Radio is turned-off. Nothing to show.&lt;USER&gt; !radio on&lt;BOT&gt; Radio is turned-on. please wait..&lt;@BOT&gt; [ Auto Dj  ] - Billie Eilish - Come Out And Play</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12921">mabrook</a> — Sun Sep 19, 2021 11:29 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2021-09-19T09:33:45-04:00</updated>

		<published>2021-09-19T09:33:45-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=110339#p110339</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=110339#p110339"/>
		<title type="html"><![CDATA[Request songs limit to 2 songs per person]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=110339#p110339"><![CDATA[
Well, the function (or near) exists but without bind:<div class="codebox"><p>Code: </p><pre><code># Turns on and off Advertising. Also lets you set the interval: !advertise Xproc toggle_advertise {nick uhost hand chan arg}</code></pre></div>So, just add the following to enable it:<div class="codebox"><p>Code: </p><pre><code>bind pub o|- !advertise toggle_advertise</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Sun Sep 19, 2021 9:33 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[mabrook]]></name></author>
		<updated>2021-09-18T10:00:50-04:00</updated>

		<published>2021-09-18T10:00:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=110338#p110338</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=110338#p110338"/>
		<title type="html"><![CDATA[Request songs limit to 2 songs per person]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=110338#p110338"><![CDATA[
i just want to continue this post in connection with the script above.<br><br><br><br>anyone can help out please, <br><br><br>- need to add this feature turn off and turn on command from the script.<br><br><br><div class="codebox"><p>Code: </p><pre><code>&lt;user&gt; !radio off&lt;BOT&gt; Radio turned off ----------------&lt;user&gt; !radio on&lt;BOT&gt; Radio turned on </code></pre></div><br><br><br>once the radio is off, it will not display the auto-show in the channel.<br>once the radio is on, it will display the auto-show in the channel.<br><br><br><br>hope anyone can help.. thanks<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12921">mabrook</a> — Sat Sep 18, 2021 10:00 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[flink]]></name></author>
		<updated>2021-09-09T12:12:55-04:00</updated>

		<published>2021-09-09T12:12:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=110314#p110314</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=110314#p110314"/>
		<title type="html"><![CDATA[Request songs limit to 2 songs per person]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=110314#p110314"><![CDATA[
well I'll keep that I sent a notice to the nick, I would have liked a message per room but ... less is nothing and I have to be grateful for the help once again thanks SpiKe ^^<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12899">flink</a> — Thu Sep 09, 2021 12:12 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[flink]]></name></author>
		<updated>2021-08-22T10:15:47-04:00</updated>

		<published>2021-08-22T10:15:47-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=110237#p110237</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=110237#p110237"/>
		<title type="html"><![CDATA[Re: Limit requests to 2 per nick per 15 minutes]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=110237#p110237"><![CDATA[
SpiKe ^^ I haven't tried it yet, but it could be instead of <div class="codebox"><p>Code: </p><pre><code>putserv "notice $aname :You may make another request."</code></pre></div>that advertises like this<div class="codebox"><p>Code: </p><pre><code>putserv "privmsg $chan :$aname :You may make another request."</code></pre></div>thank you very much again for your time<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12899">flink</a> — Sun Aug 22, 2021 10:15 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2021-08-21T23:26:24-04:00</updated>

		<published>2021-08-21T23:26:24-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=110235#p110235</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=110235#p110235"/>
		<title type="html"><![CDATA[Re: Limit requests to 2 per nick per 15 minutes]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=110235#p110235"><![CDATA[
<blockquote class="uncited"><div>I was wondering if you can put a message so that when the time is up the nickname will be notified that he can requests again, thank you.</div></blockquote>Try replace this bind and proc...<div class="codebox"><p>Code: </p><pre><code>bind cron - {*/10 * * * *} expire_too_manyproc expire_too_many {mn hr da mo wd} {  global toomany  set ut [unixtime]  foreach {aname avalue} [array get toomany] {    set nowls [list]    foreach expire $avalue {      if {$ut &lt; $expire} {  lappend nowls $expire  }    }    if {![llength $nowls]} {  unset toomany($aname)    } else {  set toomany($aname) $nowls  }  }}</code></pre></div>with this new bind and proc...<div class="codebox"><p>Code: </p><pre><code>bind cron - {*} expire_too_manyproc expire_too_many {mn hr da mo wd} {  global toomany  set ut [unixtime]  foreach {aname avalue} [array get toomany] {    set nowls [list]    foreach expire $avalue {      if {$ut &lt; $expire} {  lappend nowls $expire  }    }    if {[llength $avalue] &gt;= 2 &amp;&amp; [llength $nowls] &lt; 2 &amp;&amp; [onchan $aname]} {      putserv "notice $aname :You may make another request."    }    if {![llength $nowls]} {  unset toomany($aname)    } else {  set toomany($aname) $nowls  }  }}</code></pre></div>.restart the bot to load the new code and see what ya got.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Sat Aug 21, 2021 11:26 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[flink]]></name></author>
		<updated>2021-08-19T09:51:52-04:00</updated>

		<published>2021-08-19T09:51:52-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=110214#p110214</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=110214#p110214"/>
		<title type="html"><![CDATA[Re: Limit requests to 2 per nick per 15 minutes]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=110214#p110214"><![CDATA[
Hi SpiKe, I tried it and it works perfectly, I was wondering if you can put a message so that when the time is up the nickname will be notified that he can requests again, thank you. sorry if my English is not good but I use translator<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12899">flink</a> — Thu Aug 19, 2021 9:51 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[mabrook]]></name></author>
		<updated>2021-06-24T15:26:36-04:00</updated>

		<published>2021-06-24T15:26:36-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=110019#p110019</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=110019#p110019"/>
		<title type="html"><![CDATA[Request songs limit to 2 songs per person]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=110019#p110019"><![CDATA[
thank you SpiKe^^ for helping it out.<br><br><br>Now it is working great.   <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=12921">mabrook</a> — Thu Jun 24, 2021 3:26 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[mabrook]]></name></author>
		<updated>2021-06-24T05:04:13-04:00</updated>

		<published>2021-06-24T05:04:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=110018#p110018</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=110018#p110018"/>
		<title type="html"><![CDATA[Request songs limit to 2 songs per person]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=110018#p110018"><![CDATA[
i tried it and it works.. but<br><br><br>after 2 songs request per user is ok..<br><div class="codebox"><p>Code: </p><pre><code>-BotName- No more than 2 requests, you can make request again after 15 minutes!</code></pre></div>then after 15 minutes, user make a request again..<br><br>the script disconnects the dj , it will show<br><div class="codebox"><p>Code: </p><pre><code>-Botname- There isn't a DJ logged in at the moment to take requests.</code></pre></div>and the bot  itself restart<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12921">mabrook</a> — Thu Jun 24, 2021 5:04 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[mabrook]]></name></author>
		<updated>2021-06-24T01:08:21-04:00</updated>

		<published>2021-06-24T01:08:21-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=110017#p110017</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=110017#p110017"/>
		<title type="html"><![CDATA[Request songs limit to 2 songs per person]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=110017#p110017"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>#Tido's Modified Icecast2 Script#Heavily Modified by Sircrazy#Version 1.01#July 12, 2010#######################################################################This program is free software; you can redistribute it and/or modify#it under the terms of the GNU General Public License as published by#the Free Software Foundation; version 2 of the License.##This program is distributed in the hope that it will be useful,#but WITHOUT ANY WARRANTY; without even the implied warranty of#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the#GNU General Public License for more details.#######################################################################Credits:#Influenced by Domsen's shoutcast1.03.tcl#Special thanks to the TCL MAN files :D#Special Release updated by Sircrazy#######################################################################Change these varibles to the one for your stream/bot/channel#Name of Radio Stationset streamname "EDIT THIS"#IP of the Icecast server.set streamip "MAKE SURE IT IS THE IP"#Port that Icecast is using, default is 8000.set streamport "EDIT THIS"#Main channel for the radio bot.set radiochan "#EDIT THIS"#Other channel that the bot can advertise to. Bot must be in this channel for this to work. Ice2.tcl only# sends stream advertisements to this channel and does not send song info.set otherchan "EDIT THIS OR REMOVE THIS TEXT"#URL/Link to the stream for listening. This is what listeners need to click to tune in.set streamurl "http://ssh.shellium.org/~sircrazy/sircrazy.m3u"#How often the bot checks the stream when it knows it is down in minutes. Recommend 1 minute.set offlinetimer "1"#How often the bot checks the stream when it knows it is online in seconds. Recommend 15 seconds.set onlinetimer "15"#Default interval for how often the bot advertises (in minutes). You want to set it to something that isn't# pure spammage.set adtimer "30"#Enables advertising set to the above frequency. 1 for ON and 0 for OFF. This reminds people that the stream# is online.set enableadvertise "1"#Enables Special Announcement, 1 for ON and 0 for OFF. Special announcements are displayed every 720 minutes.# This feature of the script is very undeveloped and I don't recommend using it.set specialannounce "0"#Special Announcement Messageset announcemsg "SPECIAL ANNOUNCEMENT! On Novemeber 26th @ Midnight GMT, JA Radio will be ON-AIR with a show featuring some exclusive live tracks from some of our favorite bands! Click here for more info: http://www.thejediacademy.net/forums_detail_page.php?f_id=13532"############################################################################  Don't edit past this stuff unless you're Tido, Henkes, or Sircrazy :P  ##       Except Line 387 where you need to add DJs and Line 281 where      ##                    you need to put your mount point.                    ############################################################################# Bindsbind pub - "%commands" showcommands#Shows a list of all commandsbind pub - "%help" showcommands#same as %commandsbind pub - "%status" status#Displays the status of the streambind pub - "%listeners" listenercheck#Reports how many listeners there arebind pub - "%request" request#Allows users to request songsbind msg - "request" request_pm#Allows users to make requests via pmbind msg - "djon" dj_on#turns on dj statusbind pub - "%djoff" dj_off#turns off dj statusbind msg - "djoff" dj_off_pm#turns off dj statusbind pub - "%fadvert" forceadvertise#Forces an advertising message to be sentbind pub - "%version" iceversion#Displays the Ice2.tcl version# Varible Resetsset ice2version "1.01 - 07.12.10"set streamstatus "0"set djnickname ""set dj ""set oldsong ""set newsong ""set newlistener ""set oldlistener "0"set forceadsent "0"set sessionpeak "0"# Check to make sure StatusCheck timer isn't running when bot rehashes.if {![info exists statuscheck_running]} {  timer $offlinetimer [list statuscheck]  set statuscheck_running 1}# Check to make sure Special Announce timer isn't running when bot rehashes.if {![info exists specialannounce_running]} {  if {$specialannounce == "1"} {    timer 720 [list specialmessage]    set specialannounce_running 1  }}# Check to make sure Advertise timer isn't running when bot rehashes.if {![info exists adtimer_running]} {  if {$enableadvertise == "1"} {    timer $adtimer [list advertise]    set adtimer_running 1  }}# Output for %help or %commandsproc showcommands {nick uhost hand chan arg} {  global ice2version streamname botnick dj  if {$dj == "$nick" &amp;&amp; $arg != ""} {    putserv "notice $arg :&gt;&gt;&gt; $botnick Commands - $ice2version&lt;&lt;&lt;"    putserv "notice $arg :%status &gt;&gt;&gt; Displays the stream's status. If online it shows the song."    putserv "notice $arg :%request (artist+track) &gt;&gt;&gt; Sends a Request for a future song."    putserv "notice $arg :/msg $botnick request (artist+track) &gt;&gt;&gt; Sends a Request for a future song by PM."  }  if {$dj != "$nick"} {    set arg ""    putserv "notice $nick :&gt;&gt;&gt; $botnick Commands - $ice2version&lt;&lt;&lt;"    putserv "notice $nick :%status &gt;&gt;&gt; Displays the stream's status. If online it shows the song."    putserv "notice $nick :%request (artist+track) &gt;&gt;&gt; Sends a Request for a future song."    putserv "notice $nick :/msg $botnick request (artist+track) &gt;&gt;&gt; Sends a Request for a future song by PM."  }}# Turns on and off Advertising. Also lets you set the interval: !advertise Xproc toggle_advertise {nick uhost hand chan arg} {  global radiochan enableadvertise adtimer  if {$enableadvertise == "1"} {    set enableadvertise "0"    set timerinfo [gettimerid]    killtimer $timerinfo    putserv "PRIVMSG $chan :Advertising OFF"  } else {    set enableadvertise "1"    if {$arg == ""} {      putserv "PRIVMSG $chan :Advertising ON. Frequency set to $adtimer minutes."    } else {      set adtimer $arg      putserv "privmsg $chan :Advertising ON. Frequency changed to $adtimer minutes."      timer $adtimer [list advertise]    }  }}# Function that finds out the ID of the advertising timer.proc gettimerid {} {    set adtimerinfo [timers]    set loc1 [string first "advertise" $adtimerinfo]    set loc1 [expr $loc1 + 10]    set str1 [string range $adtimerinfo $loc1 999]    set endloc [string first "\}" $str1]    set endloc [expr $endloc -1]    set timerinfo [string range $str1 0 $endloc]    return $timerinfo}# Messages that are displayed when Advertising is enabled.proc advertise {} {  global radiochan streamstatus otherchan enableadvertise adtimer forceadsent streamurl streamname  if {$streamstatus != "0" &amp;&amp; $enableadvertise == "1"} {    putserv "PRIVMSG $radiochan :$streamname is currently broadcasting live! Listen in @ $streamurl"    putserv "PRIVMSG $otherchan :$streamname is currently broadcasting live! Listen in @ $streamurl"    if {$forceadsent == "0"} {timer $adtimer [list advertise]} else {set forceadsent "0"}    return 1  }  return 0}# Forces the advertising messages to appearproc forceadvertise {nick uhost hand chan arg} {  global streamstatus enableadvertise forceadsent  if {$streamstatus == "0"} {    putserv "notice $nick :The stream isn't on-air. Unable to advertise."    return 0  } else {    if {$enableadvertise == "0"} {      putserv "notice $nick :Advertising isn't enabled."      return 0    } else {      set forceadsent "1"      set forceadvertised [advertise]      if {$forceadvertised == "1"} {        putserv "notice $nick :Done!"      } else {        putserv "notice $nick :Advertising message was not sent!"      }    }  }}# Special Announcement Message.proc specialmessage {} {  global radiochan specialannounce announcemsg  putserv "PRIVMSG $radiochan : $announcemsg"  timer 720 [list specialmessage]  return 0}# StatusCheck# Function that takes the information from Icecast_Online and creates the proper responses.proc statuscheck {} {  global radiochan streamstatus newsong oldsong newlistener oldlistener sessionpeak dj enableadvertise otherchan onlinetimer offlinetimer streamurl streamname  if {$streamstatus == "0"} {    set oldstatus "0"  } else {    set oldstatus "1"  }  set newstatus "[icecast_online]"  if {$newstatus =="0" &amp;&amp; $oldstatus == "0"} {    timer $offlinetimer [list statuscheck]  }  if {$newstatus == "1" &amp;&amp; $oldstatus == "0"} {    putserv "PRIVMSG $radiochan :$streamname is now ON-AIR!! Click to listen: $streamurl"    putlog "(RADIO) On-Air detected."    utimer $onlinetimer [list statuscheck]    if {$enableadvertise == "1"} {      putserv "PRIVMSG $otherchan :$streamname is now ON-AIR!! Click to listen: $streamurl"    }  }  if {$newstatus == "0" &amp;&amp; $oldstatus == "1"} {    putserv "PRIVMSG $radiochan :$streamname is now off-air."    set oldlistener "0"    set sessionpeak "0"    if {$enableadvertise == "1"} {      putserv "PRIVMSG $otherchan :$streamname is now off-air."    }    putlog "(RADIO) Off-Air detected."    timer $offlinetimer [list statuscheck]  }  if {$newstatus == "1" &amp;&amp; $oldstatus == "1"} {    utimer $onlinetimer [list statuscheck]    if {$newsong != $oldsong &amp;&amp; $newsong != "&gt;inbetween" &amp;&amp; $newsong != "&gt;inbetween1" &amp;&amp; $newsong != "&gt;inbetween2" &amp;&amp; $newsong != "&gt;whatutalkinbout" &amp;&amp; $newsong != "&gt;tmsradio80sintro"} {      putserv "PRIVMSG $radiochan :Now playing on $streamname: $newsong @ $streamurl"      set oldsong "$newsong"    }  }} # Icecast_Online# This is the HTTP Parser that gathers the various data from the status.xsl file.proc icecast_online { } {  global streamip streamport streamstatus newsong newlistener  set pagedata ""  if {[catch {set sock [socket $streamip $streamport] } sockerror]} {    putlog "error: $sockerror"    return 0  } else {    puts $sock "GET /status.xsl?mount=/sircrazy HTTP/1.1"    puts $sock "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9)"    puts $sock "Host: $streamip"    puts $sock "Connection: close"    puts $sock ""    flush $sock    while {![eof $sock]} { append pagedata "[read $sock]" }  }  if {[string match *streamdata* $pagedata] == 1} {    set streamstatus "1"    set songlocation [string first "Current Song:" $pagedata]    set songdata1 [string range $pagedata $songlocation 99999]    set location2 [string first "&lt;/tr&gt;" $songdata1]    set songdata2 [string range $songdata1 0 $location2]    set songdata3 [string range $songdata2 42 9999]    set location3 [string first "&lt;/td&gt;" $songdata3]    set location3 [expr $location3 - 1]    set newsong [string range $songdata3 0 $location3]    set llocation [string first "Listeners:" $pagedata]    set countdata1 [string range $pagedata $llocation 99999]    set llocation2 [string first "&lt;/tr&gt;" $countdata1]    set countdata2 [string range $countdata1 0 $llocation2]    set countdata3 [string range $countdata2 39 9999]    set llocation3 [string first "&lt;/td&gt;" $countdata3]    set llocation3 [expr $llocation3 - 1]    set newlistener [string range $countdata3 0 $llocation3]    close $sock    return 1     } else {    set streamstatus "0"    close $sock    return 0  }}# %status function. Diplays the current status of the stream.proc status {nick uhost hand chan arg} {  global dj radiochan newsong newlistener streamstatus streamurl streamname  if {$streamstatus == 1} {    if {$newsong != "" &amp;&amp;  $dj == "$nick" &amp;&amp; $arg != ""} {putserv "notice $arg :The current song is |$newsong| @ $streamurl"}    if {$newsong != "" &amp;&amp;  $dj != "$nick"} {      putserv "notice $nick :The current song is |$newsong| @ $streamurl"    }  } else {putserv "notice $nick :$streamname is currently offline."    }}# /msg %botnick listeners: displays how many current listeners there are.proc listenercheck {nick uhost hand arg} {  global newlistener radiochan streamstatus streamname  if {$streamstatus == "1"} {    if {$newlistener == "0"} {      putserv "notice $nick :There aren't any listeners tuned into $streamname :(."    } elseif {$newlistener =="1"} {      putserv "notice $nick :There is 1 listener tuned into $streamname."    } else {      putserv "notice $nick :There are $newlistener listeners tuned into $streamname."    }  } else {    putserv "notice $nick :$streamname isn't on-air."  }}# %request: sends a message to dj about the request that was made.proc request {nick uhost hand chan arg} {if {[too_many $nick $uhost $hand $arg]} {  return 0  }  global dj  if {$dj != ""} {    if {$arg == ""} {putserv "notice $nick :You didn't request anything!"    return 0    } else {      putserv "privmsg $dj :REQUEST($nick) =&gt; $arg"      putserv "notice $nick :Your request was sent to $dj. Thank you!"      return 0      }  } else {    putserv "notice $nick :There is no DJ online taking requests."    return 0  }}# /msg $botnick request X: sends a message to dj about the request that was made.proc request_pm {nick uhost hand arg} {if {[too_many $nick $uhost $hand $arg]} {  return 0  }  global dj  if {$dj != ""} {    if {$arg == ""} {putserv "notice $nick :You didn't request anything!"    return 0    } else {      putserv "privmsg $dj :REQUEST($nick) =&gt; $arg"      putserv "notice $nick :Your request was sent to $dj. Thank you!"      return 0      }  } else {    putserv "notice $nick :There is no DJ online taking requests."    return 0  }}# /msg $botnick djon [password]: Turns DJ on for userproc dj_on {nick uhost hand arg} {  global dj radiochan  if {$dj == ""} {    if {$arg == ""} {putserv "privmsg $nick :You must enter your password"      return 0    } else {# This is a Test DJ Entry. the $arg here is the password.# You can have as many of these as you want, just paste# them directly under one another, within the else { }.   #      if {$arg == "Test"} {#        set dj "$nick"#        putserv "PRIVMSG $nick :You are logged in as $dj."#        putserv "PRIVMSG $radiochan :$dj is now rocking the turntables and accepting requests via %request, enjoy."#        return 0#      }    }  }  if {$dj != ""} {    putsrv "notice $nick :$dj is already active. &amp;dj needs to sign off before you can log in."    return 0  }}# %djoff: Turns DJ off for userproc dj_off {nick uhost hand chan arg} {  global dj radiochan  if {$dj != $nick} {    putserv "notice $nick :You are not the current DJ or you changed your nickname since becoming one."  } else {    putserv "PRIVMSG $radiochan :$dj is signing off and no longer accepting requests."    set dj ""    putserv "notice $nick :Your DJ'ness has been deactivated"  }}# /msg $botnick djoff: Turns DJ off for userproc dj_off_pm {nick uhost hand arg} {  global dj radiochan  if {$dj != $nick} {    putserv "notice $nick :You are not the current DJ or you changed your nickname since becoming one."  } else {    putserv "PRIVMSG $radiochan :$dj is signing off and no longer accepting requests."    set dj ""    putserv "notice $nick :Your DJ'ness has been deactivated"  }}# !version: displays the current version of the Ice2.tcl script.proc iceversion {nick host hand chan arg} {   global ice2version radiochan botnick   if {$chan == $radiochan} {     putserv "notice $nick :I am $botnick running Ice2.tcl Version $ice2version by Tido, Henkes, and Sircrazy."   }}proc too_many {nick uhost hand arg} {  global toomany  set nk [string tolower $nick]  set ut [unixtime]  set nowls [list]  if {[info exists toomany($nk)]} {    foreach expire $toomany($nk) {      if {$ut &lt; $expire} {  lappend nowls $expire  }    }  }  set toomany($nk) $nowls  if {[llength $nowls] &gt;= 2} {    putserv "notice $nick :No more than 2 requests in 15 minutes!"    return 1  }  lappend toomany($nk) [expr {$ut + (60 * 15)}]  return 0}bind cron - {*/10 * * * *} expire_too_manyproc expire_too_many {mn hr da mo wd} {  global toomany  set ut [unixtime]  foreach {aname avalue} [array get toomany] {    set nowls [list]    foreach expire $avalue {      if {$ut &lt; $expire} {  lappend nowls $expire  }    }    if {![llength $nowls]} {  unset toomany($aname)    } else {  set toomany($aname) $nowls  }  }}putlog "Ice2 Version $ice2version by Tido, Henkes, and Sircrazy is loaded! :)"</code></pre></div><br><br>can you please check if i am doing it right..<br><br><br><br>I put it here..<br><div class="codebox"><p>Code: </p><pre><code># %request: sends a message to dj about the request that was made.proc request {nick uhost hand chan arg} {if {[too_many $nick $uhost $hand $arg]} {  return 0  }  global dj  if {$dj != ""} {    if {$arg == ""} {putserv "notice $nick :You didn't request anything!"    return 0    } else {      putserv "privmsg $dj :REQUEST($nick) =&gt; $arg"      putserv "notice $nick :Your request was sent to $dj. Thank you!"      return 0      }  } else {    putserv "notice $nick :There is no DJ online taking requests."    return 0  }}# /msg $botnick request X: sends a message to dj about the request that was made.proc request_pm {nick uhost hand arg} {if {[too_many $nick $uhost $hand $arg]} {  return 0  }  global dj  if {$dj != ""} {    if {$arg == ""} {putserv "notice $nick :You didn't request anything!"    return 0    } else {      putserv "privmsg $dj :REQUEST($nick) =&gt; $arg"      putserv "notice $nick :Your request was sent to $dj. Thank you!"      return 0      }  } else {    putserv "notice $nick :There is no DJ online taking requests."    return 0  }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12921">mabrook</a> — Thu Jun 24, 2021 1:08 am</p><hr />
]]></content>
	</entry>
	</feed>
