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

	<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>2013-06-08T07:27:52-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Madalin]]></name></author>
		<updated>2013-06-08T07:27:52-04:00</updated>

		<published>2013-06-08T07:27:52-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101640#p101640</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101640#p101640"/>
		<title type="html"><![CDATA[Channel cycle with delay (.cycle #channel 5)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101640#p101640"><![CDATA[
I modifyed caesar version to what you wanted as his version had what mine didnt so now it will work with minute/hours/days and if you add only lets say '5' it will be considered minutes.<br><div class="codebox"><p>Code: </p><pre><code>bind pub n|n .cycle pub:cycleproc pub:cycle {nick uhost hand chan text} {if {[scan $text {%s%s} channel duration] != 2} {puthelp "NOTICE $nick :Usage: \002.cycle #channel duration\002."return}if {![regexp {^[0-9]+[mhd]$} $duration]} {puthelp "NOTICE $nick :The duration must be expressed in minutes, hours or days. For example: .cycle #channel 5m, .cycle #channel 1h or .cycle #channel 2d"return}if {![validchan $channel]} {puthelp "NOTICE $nick :The channel $channel is not a valid."return}if {[channel get $chan inactive]} {puthelp "NOTICE $nick :The channel $channel is already set to inactive."return}channel set $channel +inactive# minutesif {[regexp {^[0-9]+[m]$} $duration]} {timer [string index $duration 0] [list channel set $channel -inactive]putserv "PRIVMSG $chan :\002$nick\002 - I will comeback on \00304$channel\003 in $duration"# hours} elseif {[regexp {^[0-9]+[h]$} $duration]} {timer [expr [string index $duration 0] * 60] [list channel set $channel -inactive]putserv "PRIVMSG $chan :\002$nick\002 - I will comeback on \00304$channel\003 in $duration"# days} elseif {[regexp {^[0-9]+[d]$} $duration]} {timer [expr [string index 0 $duration] * 24 * 60] [list channel set $channel -inactive]putserv "PRIVMSG $chan :\002$nick\002 - I will comeback on \00304$channel\003 in $duration"} else {timer [string index $duration 0] [list channel set $channel -inactive]putserv "PRIVMSG $chan :\002$nick\002 - I will comeback on \00304$channel\003 in $duration"}}</code></pre></div>Just test it and see if it works like you wanted.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6396">Madalin</a> — Sat Jun 08, 2013 7:27 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ndrp]]></name></author>
		<updated>2013-06-07T18:03:05-04:00</updated>

		<published>2013-06-07T18:03:05-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101639#p101639</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101639#p101639"/>
		<title type="html"><![CDATA[Channel cycle with delay (.cycle #channel 5)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101639#p101639"><![CDATA[
Thanks! I already tested Madalins code. It worked.<br><br>Time format like 5m, 2h, 3d sounds good. I think the default should be minutes so !cycle #channel 5 is interpreted as minutes.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12241">ndrp</a> — Fri Jun 07, 2013 6:03 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2013-06-07T11:10:14-04:00</updated>

		<published>2013-06-07T11:10:14-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101638#p101638</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101638#p101638"/>
		<title type="html"><![CDATA[Channel cycle with delay (.cycle #channel 5)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101638#p101638"><![CDATA[
In order to get a time format in minutes, hours or days the user would need to add some kind of separator in order to figure out the format is used. The easiest way would be by formatting the duration like 5m for 5 minutes, 2h for two hours and 3d for 3 days for instance.<br><br>Just right off the bat I would set a user defined integer flag where would store the time the +inactive would expire (for instance when the command was issued in unix time to that would add the actual duration) combined with either a cron/time bind triggered every 1 second and check for this user defined flag and remove it where is due, or make a cron/time bind exactly on that time and then after it was triggered remove it.<br><br>Here's a start that needs just the last part. I'm a bit busy with work and can't test or do continue right now.<div class="codebox"><p>Code: </p><pre><code>bind pub n|n .cycle pub:cycleproc pub:cycle {nick uhost hand chan text} {if {[scan $text {%s%s} channel duration] != 2} {puthelp "NOTICE $nick :Usage: \002.cycle #channel duration\002."return}if {![regexp {^[0-9]+[mhd]$} $duration]} {puthelp "NOTICE $nick :The duration must be expressed in minutes, hours or days. For example: .cycle #channel 5m, .cycle #channel 1h or .cycle #channel 2d"return}if {![validchan $channel]} {puthelp "NOTICE $nick :The channel $channel is not a valid."return}if {[channel get $chan inactive]} {puthelp "NOTICE $nick :The channel $channel is already set to inactive."return}channel set $channel +inactive# minutesif {[regexp {^[0-9]+[m]$} $duration]} {# hours} elseif {[regexp {^[0-9]+[h]$} $duration]} {# days} elseif {[regexp {^[0-9]+[d]$} $duration]} {}}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Fri Jun 07, 2013 11:10 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Madalin]]></name></author>
		<updated>2013-06-07T07:55:44-04:00</updated>

		<published>2013-06-07T07:55:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101636#p101636</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101636#p101636"/>
		<title type="html"><![CDATA[Channel cycle with delay (.cycle #channel 5)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101636#p101636"><![CDATA[
Hope this will help you for now. It only works as you want but in minutes. I dont have time to make the hour/day for now because i dont have time. But i will be back and make it if noone else will make this script.<br><div class="codebox"><p>Code: </p><pre><code>bind PUB n|n !cycle cycle:pubproc cycle:pub {nick uhost hand chan arg} {        set target [lindex [split $arg] 0]        set duration [lindex [split $arg] 1]        if {$target == ""} { putserv "PRIVMSG $chan :\002$nick\002 - You didnt set the channel name"; return }        if {[validchan $target]} {                if {$duration != ""} {                        putserv "PART $target :i will be back in $duration minutes ;"                        channel set $target +inactive                        timer $duration [list channel set $target -inactive]                        putserv "PRIVMSG $chan :\002$nick\002 - CYCLE for $target complete (ill be back in $duration min)"                } else {                        putserv "PRIVMSG $chan :\002$nick\002 - You didnt set the duration (EX: !cycle #channel 5)"                }        } else {                putserv "PRIVMSG $chan :\002$nick\002 - '$target' is not a valid channel"        }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6396">Madalin</a> — Fri Jun 07, 2013 7:55 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ndrp]]></name></author>
		<updated>2013-06-06T05:58:19-04:00</updated>

		<published>2013-06-06T05:58:19-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101632#p101632</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101632#p101632"/>
		<title type="html"><![CDATA[Channel cycle with delay (.cycle #channel 5)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101632#p101632"><![CDATA[
Hi<br><br>I would like to request a new script. Script would make eggdop cycle given channel with time delay.<br><br>For example command "<strong class="text-strong">.cycle #channel 5</strong>" would work like this:<br><br>1) bot leaves #channel (.chanset #channel +inactive)<br>2) bot waits 5 minutus<br>3) bot joins #channel (.chanset #channel -inactive)<br><br>Time format could be minutes, hours or days. For me minutes is enough but some other eggdeop users need longer delays.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12241">ndrp</a> — Thu Jun 06, 2013 5:58 am</p><hr />
]]></content>
	</entry>
	</feed>
