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

	<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-07-03T08:29:12-04:00</updated>

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

		<entry>
		<author><name><![CDATA[ComputerTech]]></name></author>
		<updated>2020-07-03T08:29:12-04:00</updated>

		<published>2020-07-03T08:29:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=108666#p108666</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=108666#p108666"/>
		<title type="html"><![CDATA[Bar.tcl 1.0]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=108666#p108666"><![CDATA[
Absolute Perfection CrazyCat<br><br>Thank you so much  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=":wink:" title="Wink"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12849">ComputerTech</a> — Fri Jul 03, 2020 8:29 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ComputerTech]]></name></author>
		<updated>2020-07-03T07:59:26-04:00</updated>

		<published>2020-07-03T07:59:26-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=108665#p108665</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=108665#p108665"/>
		<title type="html"><![CDATA[Bar.tcl 1.0]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=108665#p108665"><![CDATA[
Coooool, That Look's WAY better  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_mrgreen.gif" width="15" height="15" alt=":mrgreen:" title="Mr. Green"> <br><br>Cheers CrazyCat <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>Will try it rignt away  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_cool.gif" width="15" height="15" alt="8)" title="Cool"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12849">ComputerTech</a> — Fri Jul 03, 2020 7:59 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2020-07-03T01:58:35-04:00</updated>

		<published>2020-07-03T01:58:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=108664#p108664</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=108664#p108664"/>
		<title type="html"><![CDATA[Bar.tcl 1.0]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=108664#p108664"><![CDATA[
Yes, it could be reduced to only one proc for all the drinks. I'll try to do something <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><div class="codebox"><p>Code: </p><pre><code>namespace eval ::beer {variable barcmd "!"    variable beerarray set bills {}array set drinks {beer5wine25water2coke3orange4}foreach dr [array names drinks] {bind pubm - "*$::beer::barcmd$dr*" ::beer::do_drink}bind pub - "${barcmd}pay" ::beer::do_the_pay    bind pub - "${barcmd}menu" ::beer::do_the_menu    proc do_drink {nick uhost handle chan text} {set args [split $text " "]set key [stripcodes abcgru [lindex $args 0]]set key [string range $key 1 end]if {[lsearch [array names ::beer::drinks] $key] == -1} {putserv "PRIVMSG $chan :Sorry $nick, I haven't $key in the fridge"return 0}set cost $::beer::drinks($key)if {[array names ::beer::bills -exact $nick] ne ""} {set bill $::beer::bills($nick)if {$bill &gt;= 50} {putserv "PRIVMSG $chan : $nick Your Tab is full With the amount of \$$bill Please pay before ordering more drink"    return  0           }} else {set ::beer::bills($nick) 0}incr ::beer::bills($nick) $cost        putserv "PRIVMSG $chan :\001ACTION Fills up the glass with $key\001"        putserv "PRIVMSG $chan :\001ACTION Gives the $key to $nick\001"        putserv "PRIVMSG $chan : Enjoy your $key $nick, Your Total Bill Amount Is \$$::beer::bills($nick)"    }    proc do_the_pay {nick uhost handle chan text} {       set loaded [array names ::beer::bills -exact $nick]       if {$loaded eq ""} {          putserv "PRIVMSG $chan :$nick Your Already Payed Your Bill"          return       }        putserv "PRIVMSG $chan :$nick Thank You For Paying Your Bill, Here's your receipt"        putserv "NOTICE $nick : -------------------  "        putserv "NOTICE $nick :|Bar receipt                    "           putserv "NOTICE $nick :| \$$::beer::bills($nick)  "        putserv "NOTICE $nick :| $nick       "        putserv "NOTICE $nick :| $chan"        putserv "NOTICE $nick : ------------------- "        unset ::beer::bills($nick)    }     proc do_the_menu {nick uhost handle chan text} {putserv "NOTICE $nick :Welcome $nick This is our Menu"foreach {drink cost} [array get ::beer::drinks] {putserv "NOTICE $nick :$::beer::barcmd$drink : \$$cost"}}putlog "Barman 1.0.1 loaded"}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Fri Jul 03, 2020 1:58 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ComputerTech]]></name></author>
		<updated>2020-07-02T18:21:18-04:00</updated>

		<published>2020-07-02T18:21:18-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=108663#p108663</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=108663#p108663"/>
		<title type="html"><![CDATA[Bar.tcl 1.0]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=108663#p108663"><![CDATA[
Hey all so i made a bar script and a friend helped me with some things.<br><br>Only thing i dont personally like about this script is the amount of procs.<br><br>I dont like every drink having a separate proc, any advise on making this script better or shorter is much appreciated  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"> <br><div class="codebox"><p>Code: </p><pre><code>    set barcmd "!"    namespace eval ::beer {     global barcmd     variable beer     set pt "0"    bind pub - "${barcmd}beer" ::beer::do_the_beer    bind pub - "${barcmd}pay" ::beer::do_the_pay    bind pub - "${barcmd}menu" ::beer::do_the_menu    bind pub - "${barcmd}wine" ::beer::do_the_wine    bind pub - "${barcmd}water" ::beer::do_the_water    bind pub - "${barcmd}coke" ::beer::do_the_coke    bind pub - "${barcmd}coke" ::beer::do_the_orange    proc do_the_beer {nick uhost handle chan text} {    variable beer         global pt    set guy [lindex [split $text] 0]    set loaded [array names beer -exact $nick]        if {$pt == 50} {        putserv "privmsg $chan : $nick Your Tab is full With the amount of $pt Please pay before ordering more drink"              return                     }       incr pt +5        putserv "PRIVMSG $chan :\001ACTION Fills up the glass with Beer\001"        putserv "PRIVMSG $chan :\001ACTION Gives the Beer to $nick\001"        putserv "privmsg $chan : Enjoy your Beer $nick, Your Total Bill Amount Is $pt"     array unset beer $nick    }     proc do_the_wine {nick uhost handle chan text} {    variable beer         global pt    set guy [lindex [split $text] 0]    set loaded [array names beer -exact $nick]        if {$pt == 50} {        putserv "privmsg $chan : $nick Your Tab is full With the amount of $pt Please pay before ordering more drink"              return                     }       incr pt +25        putserv "PRIVMSG $chan :\001ACTION Fills up the glass with Wine\001"        putserv "PRIVMSG $chan :\001ACTION Gives the Wine to $nick\001"        putserv "privmsg $chan : Enjoy your Wine $nick, Your Total Bill Amount Is $pt"     array unset beer $nick    }     proc do_the_water {nick uhost handle chan text} {    variable beer         global pt    set guy [lindex [split $text] 0]    set loaded [array names beer -exact $nick]        if {$pt == 50} {        putserv "privmsg $chan : $nick Your Tab is full With the amount of $pt Please pay before ordering more drink"              return                     }       incr pt +2        putserv "PRIVMSG $chan :\001ACTION Fills up the glass with Water\001"        putserv "PRIVMSG $chan :\001ACTION Gives the Water to $nick\001"        putserv "privmsg $chan : Enjoy your Water $nick, Your Total Bill Amount Is $pt"     array unset beer $nick    }     proc do_the_orange {nick uhost handle chan text} {    variable beer         global pt    set guy [lindex [split $text] 0]    set loaded [array names beer -exact $nick]        if {$pt == 50} {        putserv "privmsg $chan : $nick Your Tab is full With the amount of $pt Please pay before ordering more drink"              return                     }       incr pt +3        putserv "PRIVMSG $chan :\001ACTION Fills up the glass with Orange juice\001"        putserv "PRIVMSG $chan :\001ACTION Gives the Orange Juice to $nick\001"        putserv "privmsg $chan : Enjoy your Orange Juice $nick, Your Total Bill Amount Is $pt"     array unset beer $nick    }     proc do_the_coke {nick uhost handle chan text} {    variable beer         global pt    set guy [lindex [split $text] 0]    set loaded [array names beer -exact $nick]        if {$pt == 50} {        putserv "privmsg $chan : $nick Your Tab is full With the amount of $pt Please pay before ordering more drink"              return                     }       incr pt +4        putserv "PRIVMSG $chan :\001ACTION Fills up the glass with Coke\001"        putserv "PRIVMSG $chan :\001ACTION Gives the Coke to $nick\001"        putserv "privmsg $chan : Enjoy your Coke $nick, Your Total Bill Amount Is $pt"     array unset beer $nick    }    proc do_the_pay {nick uhost handle chan text} {    variable beer         global pt    set loaded [array names beer -exact $nick]    if {$loaded != ""} {    putserv "privmsg $chan :$nick Your Already Payed Your Bill"    return    }    array set beer "$nick 1"        putserv "privmsg $chan :$nick Thank You For Paying Your Bill, Here's your receipt"        putserv "notice $chan : -------------------  "        putserv "notice $chan :|Bar receipt                    "            putserv "notice $chan :| $ $pt  "        putserv "notice $chan :| $nick       "         putserv "notice $chan :| $chan"        putserv "notice $chan : ------------------- "        set pt "0"    }      proc do_the_menu {nick uhost handle chan text} { global barcmd putserv "notice $nick :Welcome $nick This is our Menu" putserv "notice $nick :${barcmd}beer $ 5 , ${barcmd}water  $ 2 , {barcmd}wine $ 25 , ${barcmd}coke $ 4 ${barcmd}orange $ 3"     }    } ;# end namespace</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12849">ComputerTech</a> — Thu Jul 02, 2020 6:21 pm</p><hr />
]]></content>
	</entry>
	</feed>
