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

	<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-02-01T19:54:27-04:00</updated>

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

		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2013-02-01T15:24:30-04:00</updated>

		<published>2013-02-01T15:24:30-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=100888#p100888</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=100888#p100888"/>
		<title type="html"><![CDATA[REQ: Small Modification of Bartender Script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=100888#p100888"><![CDATA[
meh.. was working with string map on another script and accidentally slipped it in instead of a simple join. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_rolleyes.gif" width="15" height="15" alt=":roll:" title="Rolling Eyes"> <br><br>no, according to dict manual example I don't need to add <ul><li>. and no. i intended to make serving an <em class="text-italics">int</em> as 0 means everyone and 1 only currently oped or voiced, and somehow after some tests ended with <em class="text-italics">str</em>.</li></ul><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Fri Feb 01, 2013 3:24 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2013-02-01T19:54:27-04:00</updated>

		<published>2013-02-01T15:02:53-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=100887#p100887</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=100887#p100887"/>
		<title type="html"><![CDATA[REQ: Small Modification of Bartender Script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=100887#p100887"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code># Tcl 8.4 friendly version .. 8)# credit: caesar# enable: .chanset #chan +serving# Amount of drinks each person may# request in a certain amount of time# 3:30 means 3 drinks in 30 seconds# the 4th is throttled until 30 seconds has# elapsed from their first drink.#set drinkThrottle 3:30# about the array:# %nick will become $nick (the nickname)# %chan will become $chan (the channel)# \n will make the output span onto a new line.#array set drinks { corona "\001ACTION snaps off the top of a long-necked, ice cold Corona, slips in a slice of lime and hands it to %nick\001\nEnjoy mate." coors "\001ACTION pisses in a mug then slides it down the bar to %nick.\001\nDrink up %nick!" bud "Um...%nick, we don't serve that in %chan...\nTry a gay bar.. haw!" vodka "here you go %nick, knock yourself out!\n\001ACTION slides a shot down the bar to %nick.\001" tea "I'm out of tea, sorry %nick..\nOh wait, I do have tea.\nWait, no I don't.. :P" tip "%nick better follow the rules in %chan.\nOr does %nick want a nice kickban instead?"}setudef flag servingbind pubm - "% !*" drink:orderbind pub - !drinks drink:menuproc drink:order {nick uhost hand chan text} {   if {[channel get $chan serving]} {  foreach {drink type} [split $text] { break }      if {[isop $nick $chan] || [isvoice $nick $chan]} {         drink:serve $nick $uhost $chan [string range $drink 1 end] $type      }   }}proc drink:serve {nick uhost chan drink type} {   global drinks   if {[string length $drink]} {      foreach name [array names drinks] { lappend lowerDrinks [string tolower $name] }      if {[lsearch -exact $lowerDrinks $drink] != -1} {         if {[set wait [throttle_ $uhost,$chan,drink [lindex $::drinkThrottle 1] [lindex $::drinkThrottle 0)]]] != 0} {            putserv "privmsg $chan :$nick, please wait [lindex $wait 0] seconds for your next drink. You are above the drink request limit by [expr {[lindex $wait 1] - $::drinkAmount}] at the moment. Slow down..."         } else {            if {[string length $type] &amp;&amp; [onchan $type $chan]} { set nick $type }            foreach line [split $drinks($drink) \n] {               puthelp "PRIVMSG $chan :[string map [list %chan $chan %nick $nick] $line]"             }         }      }   }}proc drink:menu {nick uhost hand chan text} {   if {[channel get $chan serving]} {      if {[isop $nick $chan] || [isvoice $nick $chan]} {         drink:fetch $nick $chan      }   } else {      drink:fetch $nick $chan   }}proc drink:fetch {nick chan} {   global drinks   puthelp "PRIVMSG $chan :Drinks currently available: ![join [array names drinks] ", !"]"} # Throttle Proc (slightly altered, super action missles) - Thanks to user# see this post: http://forum.egghelp.org/viewtopic.php?t=9009&amp;start=3proc throttle_ {id seconds amount} {   if {[info exists ::throttled_($id)]&amp;&amp;[lindex $::throttled_($id) 0]&gt;[clock seconds]} {      set ::throttled_($id) [list [lindex $::throttled_($id) 0] [set value [expr {[lindex $::throttled_($id) 1] +1}]]]      if {$value &gt; $amount} { set id ::throttled_($id) } { set id 0 }   } {      set ::throttled_($id) [list [expr {[clock seconds]+$seconds}] 1]      set id 0   }}# delete expired entries every 10 minutesbind time - ?0* throttleclean_ # sub - clean throttled usersproc throttleclean_ {args} {   set now [clock seconds]   foreach {id time} [array get ::throttled_] {      if {[lindex $time 0]&lt;=$now} {unset ::throttled_($id)}   }} #eof</code></pre></div>Edit1:<br>Modified post above from original. Since the script was corrected, here is a tcl8.4 friendly version of the same script. Also added a throttle system that will keep users from abusing and at the same time amusing.<br><br>Edit2:<br>Improved and added proactive throttle control.<br><br>Edit3:<br>Added ability to match intent of OP's original script:<br>!corona - the nick issuing !corona gets one.. yay<br>!corona &lt;nick&gt; - the nickname typed gets a corona if they are in channel otherwise the person typing it will.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Fri Feb 01, 2013 3:02 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Madalin]]></name></author>
		<updated>2013-02-01T06:10:10-04:00</updated>

		<published>2013-02-01T06:10:10-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=100883#p100883</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=100883#p100883"/>
		<title type="html"><![CDATA[REQ: Small Modification of Bartender Script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=100883#p100883"><![CDATA[
Heh <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> ive modifyed its code if i was to create another one it was smaller of course <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6396">Madalin</a> — Fri Feb 01, 2013 6:10 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2013-02-01T15:29:43-04:00</updated>

		<published>2013-02-01T06:07:39-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=100882#p100882</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=100882#p100882"/>
		<title type="html"><![CDATA[REQ: Small Modification of Bartender Script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=100882#p100882"><![CDATA[
Here's my attempt to do this:<div class="codebox"><p>Code: </p><pre><code>dict set drinks "beer" "snaps off the top of a long-necked, ice cold Corona, slips in a slice of lime and hands it to you....enjoy mate"dict set drinks "vodka" "here you go, knock yourself out!"dict set drinks "tea" "I'm out  of tea, sorry.."# 0 - everyone, 1 - currently opped or voicedsetudef int servingbind pubm * "% !*" drink:orderbind pub * !drinks drink:menuproc drink:order {nick uhost hand chan text} {set drink [lindex [split $text !] 1]if {[channel get $chan serving]} {if {[isop $nick $chan] || [isvoice $nick $chan]} {drink:serve $nick $chan $drink}} else {drink:serve $nick $chan $drink}}proc drink:serve {nick chan drink} {global drinksif {[string length $drink]} {if {[lsearch -nocase [dict keys $drinks] $drink] != -1} {puthelp "PRIVMSG $chan :[dict get $drinks $drink]"}}}proc drink:menu {nick uhost hand chan text} {if {[channel get $chan serving]} {if {[isop $nick $chan] || [isvoice $nick $chan]} {drink:fetch $nick $chan}} else {drink:fetch $nick $chan}}proc drink:fetch {nick chan} {puthelp "PRIVMSG $chan :Drinks currently available: [join [dict keys $::drinks] ", "]"}</code></pre></div>Feel free to add \001ACTION or whatever you wish.<br><br>Edit: Fixed. Damn typo.. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Fri Feb 01, 2013 6:07 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Madalin]]></name></author>
		<updated>2013-01-31T17:09:27-04:00</updated>

		<published>2013-01-31T17:09:27-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=100873#p100873</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=100873#p100873"/>
		<title type="html"><![CDATA[REQ: Small Modification of Bartender Script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=100873#p100873"><![CDATA[
You only have to change<br><blockquote class="uncited"><div>set temp(type) "1"</div></blockquote>1 = only voices<br>2 = only ops<br>3 = everyone<br><div class="codebox"><p>Code: </p><pre><code>### temp(type) "1" (only voice users can use the command)### temp(type) "2" (only op users can use the command)### temp(type) "3" (everyone can use the command)# Trigger#############################################################################set cmdz "!"#############################################################################bind pub - ${cmdz}booze pub_boozeset temp(type) "1"proc pub_booze {nick uhost hand channel arg} {global botnick cmdz tempif {$temp(type) == "1"} {if {[isvoice $nick $channel]} {putquick "PRIVMSG $nick :1,13Bars Open! Heres what we got for ya:"putquick "PRIVMSG $nick :------------------------------------------------------------------------------------------------"putquick "PRIVMSG $nick :13,1${cmdz}Corona, ${cmdz}vodka"putquick "PRIVMSG $nick :------------------------------------------------------------------------------------------------"return 0}} elseif {$temp(type) == "2"} {if {[isop $nick $channel]} {putquick "PRIVMSG $nick :1,13Bars Open! Heres what we got for ya:"putquick "PRIVMSG $nick :------------------------------------------------------------------------------------------------"putquick "PRIVMSG $nick :13,1${cmdz}Corona, ${cmdz}vodka"putquick "PRIVMSG $nick :------------------------------------------------------------------------------------------------"return 0}} elseif {$temp(type) == "2"} {putquick "PRIVMSG $nick :1,13Bars Open! Heres what we got for ya:"putquick "PRIVMSG $nick :------------------------------------------------------------------------------------------------"putquick "PRIVMSG $nick :13,1${cmdz}Corona, ${cmdz}vodka"putquick "PRIVMSG $nick :------------------------------------------------------------------------------------------------"return 0}}##############Start of the drinks#################proc pub_corona {nick uhost hand channel arg} {global botnick tempif {$temp(type) == "1"} {if {[isvoice $nick $channel]} {set theNick $nickif { [llength $arg] == 1 } {set theNick [lindex [split $arg] 0]}putserv "PRIVMSG $channel :\001ACTION snaps off the top of a long-necked, ice cold Corona, slips in a slice of lime and hands it to you....enjoy mate"return 0}} elseif {$temp(type) == "2"} {if {[isop $nick $channel]} {set theNick $nickif { [llength $arg] == 1 } {set theNick [lindex [split $arg] 0]}putserv "PRIVMSG $channel :\001ACTION snaps off the top of a long-necked, ice cold Corona, slips in a slice of lime and hands it to you....enjoy mate"return 0}} elseif {$temp(type) == "3"} {set theNick $nickif { [llength $arg] == 1 } {set theNick [lindex [split $arg] 0]}putserv "PRIVMSG $channel :\001ACTION snaps off the top of a long-necked, ice cold Corona, slips in a slice of lime and hands it to you....enjoy mate"return 0}}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6396">Madalin</a> — Thu Jan 31, 2013 5:09 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[achilles1900]]></name></author>
		<updated>2010-06-13T13:25:54-04:00</updated>

		<published>2010-06-13T13:25:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=93312#p93312</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=93312#p93312"/>
		<title type="html"><![CDATA[REQ: Small Modification of Bartender Script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=93312#p93312"><![CDATA[
Hello Egghelp Community,<br><br>I have a bartender script that i would like to be slightly modified.<br><br>Basically, i would like only people who are c<strong class="text-strong">urrently opped</strong> or <strong class="text-strong">voiced</strong> to be able to use the trigger.<br><br>It would be fantastic if you could add some scripting where i can select either channels ops or channel voiced or everybody who can use the trigger<br>e.g.  'users able to access trigger 1. only ops<br>                                                 2. ops &amp; voices<br>                                                 3. Everyone<br><br>Currently the script allows anyone to use it and people have been abusing it, spamming and such. Would be a great help to us if you TCL Gurus can come to our aid. Also any modifications you see fit would be welcome too.<br><br>I thank you all in advance and please find the script below (i included only the first part and a drink)<br>best regards,<br>Achilles<br><div class="codebox"><p>Code: </p><pre><code># Trigger#############################################################################set cmdz "!"#############################################################################bind pub - ${cmdz}booze pub_boozeproc pub_booze {nick uhost hand channel arg} {  global botnick cmdz    putquick "PRIVMSG $nick :1,13Bars Open! Heres what we got for ya:"    putquick "PRIVMSG $nick :------------------------------------------------------------------------------------------------"    putquick "PRIVMSG $nick :13,1${cmdz}Corona, ${cmdz}vodka"    putquick "PRIVMSG $nick :------------------------------------------------------------------------------------------------"    return 0}##############Start of the drinks#################proc pub_corona {nick uhost hand channel arg} {   global botnick   set theNick $nick  if { [llength $arg] == 1 } {    set theNick [lindex [split $arg] 0]  }    putserv "PRIVMSG $channel :\001ACTION snaps off the top of a long-necked, ice cold Corona, slips in a slice of lime and hands it to you....enjoy mate"    return 0        }</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9882">achilles1900</a> — Sun Jun 13, 2010 1:25 pm</p><hr />
]]></content>
	</entry>
	</feed>
