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

	<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>2004-07-29T11:56:06-04:00</updated>

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

		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2004-07-29T11:56:06-04:00</updated>

		<published>2004-07-29T11:56:06-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=39215#p39215</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=39215#p39215"/>
		<title type="html"><![CDATA[Variable issue]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=39215#p39215"><![CDATA[
Here's a little greet thing i made a while back...it has individual messages for each channel and is fairly compact.<br>Most of the code deals with preparing the array names/messages to allow people who don't know tcl to change the settings without screwing things up <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> If you want to be able to remove channels without having to restart, add 'array unset greetem' to the top of the script (before the first 'set')<br><div class="codebox"><p>Code: </p><pre><code># some examples - simple one line messageset greetem(#Chan1) {You just joined $chan...duh :P}# multiline message with formatting (whitespace is trimmed off by init)set greetem(#cHaN2) {Welcome to $chan, $nick!Enjoy your stayoh...and please behave.}# global message used for channels that don't have their own message# (comment out or leave blank to disable)set greetem(*) {Hi $nick, my admin is lazy or stupid :/}bind join - * greetem:joinproc greetem:join {nick uhost hand chan} {global greetemset c [string tolower $chan]if {[info exists greetem($c)]||([info exists greetem(*)]&amp;&amp;[set c *]!={})} {foreach line $greetem($c) {putserv "NOTICE $nick :[subst -nob -noc $line]"}}}proc greetem:init {} {variable greetemset names {}foreach {key val} [array get greetem] {unset greetem($key)foreach line [split $val[set val {}] \n] {if {[string len [set line [string trim $line]]]} {lappend val $line}}if {[llength $val]} {set greetem([string tolower $key]) $vallappend names $key}}if {[array size greetem]} {putlog "greetem loaded - I'll greet people in [join $names {, }]."} {putlog "greetem loaded - wtf? no messages?"}}greetem:init;# clean up array and display "loaded"-message</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Thu Jul 29, 2004 11:56 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[]Kami[]]></name></author>
		<updated>2004-07-29T10:03:53-04:00</updated>

		<published>2004-07-29T10:03:53-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=39214#p39214</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=39214#p39214"/>
		<title type="html"><![CDATA[Variable issue]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=39214#p39214"><![CDATA[
<blockquote class="uncited"><div>Here you go. <br>Use this:<br><div class="codebox"><p>Code: </p><pre><code>#If you want greeting to read from greeting.txt set this to 0 #If you want it to read from the variable, set this to 1 set greetvar "1"#Set this to your channel greetingset greeting "Welcome to the channel.  If you can see this message you are in the channel!"#Set this to your greeting channelsset greetchans "#funchat #cyberparty #chatterz #beginner #allnitecafe"bind join - * proc:greet proc:greet {nick uhost hand chan} {  global greetvar greetchans  if {([lsearch -exact [split [string tolower $greetchans]] [string tolower $chan]] == -1)} {  if {([string equal $greetvar "0"])} {  regsub -all "\t" [split [exec [lindex "cat greeting.txt" 0] [join [lrange "cat greeting.txt" 1 end]]] \n] " " results   foreach line $results {   puthelp "Notice $nick :$line"   }   }   if {([string equal $greetvar "1"])} {    putquick "NOTICE $nick :$greeting"   }  } }</code></pre></div></div></blockquote>Whats was wrong with my code? It was the simple way to make it and he only would need to edit greet message in tcl, he could enable it in partyline...And also you forgot to make variable greeting global  <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=3559">]Kami[</a> — Thu Jul 29, 2004 10:03 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2004-07-28T21:54:00-04:00</updated>

		<published>2004-07-28T21:54:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=39194#p39194</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=39194#p39194"/>
		<title type="html"><![CDATA[Variable issue]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=39194#p39194"><![CDATA[
If you want every greeting different for every channel. Then you will need to increase the code. Set new greeting variables, which contain different greeting messages for every different channel, which would require them to work on their respective channels.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Wed Jul 28, 2004 9:54 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2004-07-28T21:49:40-04:00</updated>

		<published>2004-07-28T21:49:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=39193#p39193</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=39193#p39193"/>
		<title type="html"><![CDATA[Variable issue]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=39193#p39193"><![CDATA[
Here you go. <br>Use this:<br><div class="codebox"><p>Code: </p><pre><code>#If you want greeting to read from greeting.txt set this to 0 #If you want it to read from the variable, set this to 1 set greetvar "1"#Set this to your channel greetingset greeting "Welcome to the channel.  If you can see this message you are in the channel!"#Set this to your greeting channelsset greetchans "#funchat #cyberparty #chatterz #beginner #allnitecafe"bind join - * proc:greet proc:greet {nick uhost hand chan} {  global greetvar greetchans  if {([lsearch -exact [split [string tolower $greetchans]] [string tolower $chan]] == -1)} {  if {([string equal $greetvar "0"])} {  regsub -all "\t" [split [exec [lindex "cat greeting.txt" 0] [join [lrange "cat greeting.txt" 1 end]]] \n] " " results   foreach line $results {   puthelp "Notice $nick :$line"   }   }   if {([string equal $greetvar "1"])} {    putquick "NOTICE $nick :$greeting"   }  } }</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Wed Jul 28, 2004 9:49 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[]Kami[]]></name></author>
		<updated>2004-07-28T17:24:36-04:00</updated>

		<published>2004-07-28T17:24:36-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=39184#p39184</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=39184#p39184"/>
		<title type="html"><![CDATA[Variable issue]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=39184#p39184"><![CDATA[
This simple script should work without problems:<br><div class="codebox"><p>Code: </p><pre><code>bind join - * greet_joinset greet_message "Your message here"setudef flag greetmsgproc greet_join {nick uhost hand channel} {global greet_message  if {[isbotnick $nick] || ![channel get $channel greetmsg]} {    return 0  }putquick "PRIVMSG $nick :$greet_message"} </code></pre></div>You can enable it with typing .chanset #yourchannel +greetmsg in partyline or disable it with .chanset #yourchannel -greetmsg ...It also supports unlimited number of channels...<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3559">]Kami[</a> — Wed Jul 28, 2004 5:24 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ratman]]></name></author>
		<updated>2004-07-28T13:23:06-04:00</updated>

		<published>2004-07-28T13:23:06-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=39178#p39178</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=39178#p39178"/>
		<title type="html"><![CDATA[Variable issue]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=39178#p39178"><![CDATA[
Ok guys, back to my new script.  Here is the code I have so far:<br><div class="codebox"><p>Code: </p><pre><code>################################### greeting.tcl by kazoo   ######## www.conflabit.net       ######## david@conflabit.net     ######################################## For the channel greeting..# You will need to set greeting.txt# To your greeting in your eggdrop directory# Only if your greetvar is set to 0######################################## Variables ######################################## Once these are set and have loaded once, You will have to# Comment all of these out to make the set command work### If you want greeting to read from greeting.txt set this to 0# If you want it to read from the variable, set this to 1set greetvar 1# Set this to your Channel Greetingset greeting "Welcome to #lobby.  If you can see the message you are in the channel"# Set this to your greeting channel# * for allset greetchan "#lobby"# Repeat for the following 9.# Leave blank if you don't need themset greeting2 "Welcome to #teamchevelle.  If you can see the message you are in the channel"set greetchan2 "#teamchevelle"set greeting3 "Welcome to #teamcamaro.  If you can see the message you are in the channel"set greetchan3 "#teamcamaro"set greeting4 "Welcome to #apparition.  If you can see the message you are in the channel"set greetchan4 "#apparition"set greeting5 "Welcome to #angellesavoie.  If you can see the message you are in the channel"set greetchan5 "#angellesavoie"set greeting6 "Welcome to our channel!"set greetchan6 "#yourchannel"set greeting7 "Welcome to our channel!"set greetchan7 "#yourchannel"set greeting8 "Welcome to our channel!"set greetchan8 "#yourchannel"set greeting9 "Welcome to our channel!"set greetchan9 "#yourchannel"set greeting10 "Welcome to our channel!"set greetchan10 "#yourchannel"# Have fun!############## SCRIPT ##############bind join - * proc:greet#Declare the global variable in the procedure proc:greet {nick mask hand chan} {  global greetchans(0) greetvar greeting(0) if {([lsearch -exact [split [string tolower $greetchans]] [string tolower $chan]] == -1)} {  if {[string match -nocase "0" $greetvar]} { </code></pre></div>Now. I know I have to change all the set lines to reflect the new variable arrays. but when I declare the global variables in the procedure do I have to delclare each array like:<div class="codebox"><p>Code: </p><pre><code>global greetchans(0) greetchans(1) greetvar greeting(0) greeting(1)</code></pre></div>Or can I set up all the variable arrays in one statement like:<div class="codebox"><p>Code: </p><pre><code>global greetchans(0-100) or global greetchans(0 to 100)</code></pre></div>also, do I have to repeat this:<div class="codebox"><p>Code: </p><pre><code>if {([lsearch -exact [split [string tolower $greetchans]] [string tolower $chan]] == -1)} {  if {[string match -nocase "0" $greetvar]} { }}</code></pre></div>For each array set or is there some better way?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3402">ratman</a> — Wed Jul 28, 2004 1:23 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2004-07-26T07:47:13-04:00</updated>

		<published>2004-07-26T07:47:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=39094#p39094</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=39094#p39094"/>
		<title type="html"><![CDATA[Variable issue]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=39094#p39094"><![CDATA[
True indeed... Papillon, but I think he got how to do it, from here onwards!  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_mrgreen.gif" width="15" height="15" alt=":mrgreen:" title="Mr. Green"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Mon Jul 26, 2004 7:47 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Papillon]]></name></author>
		<updated>2004-07-26T08:05:48-04:00</updated>

		<published>2004-07-26T06:52:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=39092#p39092</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=39092#p39092"/>
		<title type="html"><![CDATA[Variable issue]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=39092#p39092"><![CDATA[
that will only work if he has the same greeting for all the channels, if he has different greeting it will be better using arrays <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=852">Papillon</a> — Mon Jul 26, 2004 6:52 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2004-07-26T00:58:30-04:00</updated>

		<published>2004-07-26T00:58:30-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=39086#p39086</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=39086#p39086"/>
		<title type="html"><![CDATA[Variable issue]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=39086#p39086"><![CDATA[
You can support 1000 channels! (As many as you like!)<br>You would need one line only.<br><br>You can do this in *3 steps* and you will need to edit your previous code, and remove most of the conditions and etc.<br><div class="codebox"><p>Code: </p><pre><code>#Define the channels for this script to work onset greetchans "#chan1 #chan2 #chan3 #mychan #yourchan" #Declare the global variable in the procedureproc:greet {nick mask hand chan} { global greetchans greetvar greeting ..................... .....................}#This line will be used in your procedure after declaring the variables. if {([lsearch -exact [split [string tolower $greetchans]] [string tolower $chan]] == -1)} { if {[string match -nocase "0" $greetvar]} {  ................... ...................}</code></pre></div>Good luck, and try to implement this!  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_mrgreen.gif" width="15" height="15" alt=":mrgreen:" title="Mr. Green"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Mon Jul 26, 2004 12:58 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ratman]]></name></author>
		<updated>2004-07-26T00:49:48-04:00</updated>

		<published>2004-07-26T00:49:48-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=39085#p39085</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=39085#p39085"/>
		<title type="html"><![CDATA[Variable issue]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=39085#p39085"><![CDATA[
<blockquote class="uncited"><div>Seriously... if I have time, I can rewrite this whole script  in less than 10-15 lines, out of the total 200+ lines.  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=":wink:" title="Wink"> <br><br>And still it will prove to be the same efficient, as it currently is! <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_mrgreen.gif" width="15" height="15" alt=":mrgreen:" title="Mr. Green"><br>There are very good, customizable greet scripts out there! Why did you specifically choose this one?  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_rolleyes.gif" width="15" height="15" alt=":roll:" title="Rolling Eyes"></div></blockquote>I could not find any other script that would handle MULTIPLE channels and worked.  Would there be an eaier way to get this script to support mutiple chans BTW/  I'd like it to maybe supprt 100 eventually (nice round number) <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=3402">ratman</a> — Mon Jul 26, 2004 12:49 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2004-07-26T00:31:53-04:00</updated>

		<published>2004-07-26T00:31:53-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=39081#p39081</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=39081#p39081"/>
		<title type="html"><![CDATA[Variable issue]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=39081#p39081"><![CDATA[
Seriously... if I have time, I can rewrite this whole script  in less than 10-15 lines, out of the total 200+ lines.  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=":wink:" title="Wink"> <br><br>And still it will prove to be the same efficient, as it currently is! <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_mrgreen.gif" width="15" height="15" alt=":mrgreen:" title="Mr. Green"><br>There are very good, customizable greet scripts out there! Why did you specifically choose this one?  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_rolleyes.gif" width="15" height="15" alt=":roll:" title="Rolling Eyes"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Mon Jul 26, 2004 12:31 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ratman]]></name></author>
		<updated>2004-07-26T00:26:21-04:00</updated>

		<published>2004-07-26T00:26:21-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=39080#p39080</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=39080#p39080"/>
		<title type="html"><![CDATA[Variable issue]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=39080#p39080"><![CDATA[
Here is the whole big mess:<br><div class="codebox"><p>Code: </p><pre><code>################################################### greeting.tcl by kazoo                       ##  ## www.conflabit.net                           ## ## david@conflabit.net                         ####                                             #### Modifications by Ratman                     ##               ## http://www.homecomputersecurity.net:81      #### ratman6@charter.net                         ## ################################################## For the channel greeting..# You will need to set greeting.txt# To your greeting in your eggdrop directory# Only if your greetvar is set to 0######################################## Variables ######################################## Once these are set and have loaded once, You will have to# Comment all of these out to make the set command work### If you want greeting to read from greeting.txt set this to 0# If you want it to read from the variable, set this to 1set greetvar 1# Set this to your Channel Greetingset greeting "Welcome to #lobby.  If you can see the message you are in the channel"# Set this to your greeting channel# * for allset greetchan "#lobby"# Repeat for the following 19.# Leave blank if you don't need themset greeting2 "Welcome to #teamchevelle.  If you can see the message you are in the channel"set greetchan2 "#teamchevelle"set greeting3 "Welcome to #teamcamaro.  If you can see the message you are in the channel"set greetchan3 "#teamcamaro"set greeting4 "Welcome to #apparition.  If you can see the message you are in the channel"set greetchan4 "#apparition"set greeting5 "Welcome to #angellesavoie.  If you can see the message you are in the channel"set greetchan5 "#angellesavoie"set greeting6 "Welcome to our channel!"set greetchan6 "#yourchannel"set greeting7 "Welcome to our channel!"set greetchan7 "#yourchannel"set greeting8 "Welcome to our channel!"set greetchan8 "#yourchannel"set greeting9 "Welcome to our channel!"set greetchan9 "#yourchannel"set greeting10 "Welcome to our channel!"set greetchan10 "#yourchannel"# Have fun!############## SCRIPT ##############bind join - * proc:greetproc proc:greet {nick mask hand chan} { global greetchan greetvar greeting greetchan2 greeting2 greetchan3 global greeting3 greetchan4 greeting4 greetchan5 greeting5 greetchan6 global greeting6 greetchan7 greeting7 greetchan8 greeting8 greetchan9 global greeting9 greetchan10 greeting10 greetchan11 greeting11 greetchan12 global greeting12 greetchan13 greeting13 greetchan14 greeting14 greetchan15 global greeting15 greetchan16 greeting16 greetchan17 greeting17 greetchan18 global greeting18 greetchan19 greeting19 greetchan20 greeting20   if {[string match -nocase "$greetchan" $chan]} {     if {[string match -nocase "0" $greetvar]} {regsub -all "\t" [split [exec [lindex "cat greeting.txt" 0] [join [lrange "cat greeting.txt" 1 end]]] \n] " " resultsforeach line $results { puthelp "Notice $nick :$line" }}     if {[string match -nocase "1" $greetvar]} {        putquick "Notice $nick :$greeting"}}   if {[string match -nocase "$greetchan2" $chan]} {     if {[string match -nocase "0" $greetvar]} {          regsub -all "\t" [split [exec [lindex "cat greeting2.txt" 0] [join [lrange "cat greeting2.txt" 1 end]]] \n] " " results        foreach line $results { puthelp "Notice $nick :$line" }}     if {[string match -nocase "1" $greetvar]} {        putquick "Notice $nick :$greeting2"}}   if {[string match -nocase "$greetchan3" $chan]} {      if {[string match -nocase "0" $greetvar]} {        regsub -all "\t" [split [exec [lindex "cat greeting3.txt" 0] [join [lrange "cat greeting3.txt" 1 end]]] \n] " " results        foreach line $results { puthelp "Notice $nick :$line" }}     if {[string match -nocase "1" $greetvar]} {        putquick "Notice $nick :$greeting3"}}   if {[string match -nocase "$greetchan4" $chan]} {      if {[string match -nocase "0" $greetvar]} {        regsub -all "\t" [split [exec [lindex "cat greeting4.txt" 0] [join [lrange "cat greeting4.txt" 1 end]]] \n] " " results        foreach line $results { puthelp "Notice $nick :$line" }}     if {[string match -nocase "1" $greetvar]} {        putquick "Notice $nick :$greeting4"}}   if {[string match -nocase "$greetchan5" $chan]} {      if {[string match -nocase "0" $greetvar]} {        regsub -all "\t" [split [exec [lindex "cat greeting5.txt" 0] [join [lrange "cat greeting5.txt" 1 end]]] \n] " " results        foreach line $results { puthelp "Notice $nick :$line" }}     if {[string match -nocase "1" $greetvar]} {        putquick "Notice $nick :$greeting5"}}   if {[string match -nocase "$greetchan6" $chan]} {      if {[string match -nocase "0" $greetvar]} {        regsub -all "\t" [split [exec [lindex "cat greeting6.txt" 0] [join [lrange "cat greeting6.txt" 1 end]]] \n] " " results        foreach line $results { puthelp "Notice $nick :$line" }}     if {[string match -nocase "1" $greetvar]} {        putquick "Notice $nick :$greeting6"}}   if {[string match -nocase "$greetchan7" $chan]} {      if {[string match -nocase "0" $greetvar]} {        regsub -all "\t" [split [exec [lindex "cat greeting7.txt" 0] [join [lrange "cat greeting7.txt" 1 end]]] \n] " " results        foreach line $results { puthelp "Notice $nick :$line" }}     if {[string match -nocase "1" $greetvar]} {        putquick "Notice $nick :$greeting7"}}   if {[string match -nocase "$greetchan8" $chan]} {      if {[string match -nocase "0" $greetvar]} {        regsub -all "\t" [split [exec [lindex "cat greeting8.txt" 0] [join [lrange "cat greeting8.txt" 1 end]]] \n] " " results        foreach line $results { puthelp "Notice $nick :$line" }}     if {[string match -nocase "1" $greetvar]} {        putquick "Notice $nick :$greeting8"}}   if {[string match -nocase "$greetchan9" $chan]} {      if {[string match -nocase "0" $greetvar]} {        regsub -all "\t" [split [exec [lindex "cat greeting9.txt" 0] [join [lrange "cat greeting9.txt" 1 end]]] \n] " " results        foreach line $results { puthelp "Notice $nick :$line" }}     if {[string match -nocase "1" $greetvar]} {        putquick "Notice $nick :$greeting9"}}   if {[string match -nocase "$greetchan10" $chan]} {      if {[string match -nocase "0" $greetvar]} {        regsub -all "\t" [split [exec [lindex "cat greeting10.txt" 0] [join [lrange "cat greeting10.txt" 1 end]]] \n] " " results        foreach line $results { puthelp "Notice $nick :$line" }}     if {[string match -nocase "1" $greetvar]} {        putquick "Notice $nick :$greeting10"     if {[string match -nocase "$greetchan11" $chan]} {     if {[string match -nocase "0" $greetvar]} {          regsub -all "\t" [split [exec [lindex "cat greeting11.txt" 0] [join [lrange "cat greeting2.txt" 1 end]]] \n] " " results        foreach line $results { puthelp "Notice $nick :$line" }}     if {[string match -nocase "1" $greetvar]} {        putquick "Notice $nick :$greeting11"}}   if {[string match -nocase "$greetchan12" $chan]} {      if {[string match -nocase "0" $greetvar]} {        regsub -all "\t" [split [exec [lindex "cat greeting12.txt" 0] [join [lrange "cat greeting3.txt" 1 end]]] \n] " " results        foreach line $results { puthelp "Notice $nick :$line" }}     if {[string match -nocase "1" $greetvar]} {        putquick "Notice $nick :$greeting12"}}   if {[string match -nocase "$greetchan13" $chan]} {      if {[string match -nocase "0" $greetvar]} {        regsub -all "\t" [split [exec [lindex "cat greeting13.txt" 0] [join [lrange "cat greeting4.txt" 1 end]]] \n] " " results        foreach line $results { puthelp "Notice $nick :$line" }}     if {[string match -nocase "1" $greetvar]} {        putquick "Notice $nick :$greeting13"}}   if {[string match -nocase "$greetchan14" $chan]} {      if {[string match -nocase "0" $greetvar]} {        regsub -all "\t" [split [exec [lindex "cat greeting14.txt" 0] [join [lrange "cat greeting5.txt" 1 end]]] \n] " " results        foreach line $results { puthelp "Notice $nick :$line" }}     if {[string match -nocase "1" $greetvar]} {        putquick "Notice $nick :$greeting14"}}   if {[string match -nocase "$greetchan15" $chan]} {      if {[string match -nocase "0" $greetvar]} {        regsub -all "\t" [split [exec [lindex "cat greeting15.txt" 0] [join [lrange "cat greeting6.txt" 1 end]]] \n] " " results        foreach line $results { puthelp "Notice $nick :$line" }}     if {[string match -nocase "1" $greetvar]} {        putquick "Notice $nick :$greeting15"}}   if {[string match -nocase "$greetchan16" $chan]} {      if {[string match -nocase "0" $greetvar]} {        regsub -all "\t" [split [exec [lindex "cat greeting16.txt" 0] [join [lrange "cat greeting7.txt" 1 end]]] \n] " " results        foreach line $results { puthelp "Notice $nick :$line" }}     if {[string match -nocase "1" $greetvar]} {        putquick "Notice $nick :$greeting16"}}   if {[string match -nocase "$greetchan17" $chan]} {      if {[string match -nocase "0" $greetvar]} {        regsub -all "\t" [split [exec [lindex "cat greeting17.txt" 0] [join [lrange "cat greeting8.txt" 1 end]]] \n] " " results        foreach line $results { puthelp "Notice $nick :$line" }}     if {[string match -nocase "1" $greetvar]} {        putquick "Notice $nick :$greeting17"}}   if {[string match -nocase "$greetchan18" $chan]} {      if {[string match -nocase "0" $greetvar]} {        regsub -all "\t" [split [exec [lindex "cat greeting18.txt" 0] [join [lrange "cat greeting9.txt" 1 end]]] \n] " " results        foreach line $results { puthelp "Notice $nick :$line" }}     if {[string match -nocase "1" $greetvar]} {        putquick "Notice $nick :$greeting18"}}   if {[string match -nocase "$greetchan19" $chan]} {      if {[string match -nocase "0" $greetvar]} {        regsub -all "\t" [split [exec [lindex "cat greeting19.txt" 0] [join [lrange "cat greeting10.txt" 1 end]]] \n] " " results        foreach line $results { puthelp "Notice $nick :$line" }}     if {[string match -nocase "1" $greetvar]} {        putquick "Notice $nick :$greeting19"}    if {[string match -nocase "$greetchan20" $chan]} {      if {[string match -nocase "0" $greetvar]} {        regsub -all "\t" [split [exec [lindex "cat greeting20.txt" 0] [join [lrange "cat greeting10.txt" 1 end]]] \n] " " results        foreach line $results { puthelp "Notice $nick :$line" }}     if {[string match -nocase "1" $greetvar]} {        putquick "Notice $nick :$greeting20"}}}bind pub n|f set cmd:setgreetproc cmd:setgreet {nick host hand chan text} { global greetchan greetvar greeting greetchan2 greeting2 greetchan3 global greeting3 greetchan4 greeting4 greetchan5 greeting5 greetchan6 global greeting6 greetchan7 greeting7 greetchan8 greeting8 greetchan9 global greeting9 greetchan10 greeting10 greetchan11 greeting11 greetchan12 global greeting12 greetchan13 greeting13 greetchan14 greeting14 greetchan15 global greeting15 greetchan16 greeting16 greetchan17 greeting17 greetchan18 global greeting18 greetchan19 greeting19 greetchan20 greeting20  if {[string match -nocase "greeting" $text"]} {    if {[string match -nocase "$greetchan" $chan]} { set $greeting "$text"putserv "Notice $nick :Greeting for $chan set to $text"}   if {[string match -nocase "$greetchan2" $chan]} {        set $greeting2 "$text"        putserv "Notice $nick :Greeting for $chan set to $text"}   if {[string match -nocase "$greetchan3" $chan]} {        set $greeting3 "$text"        putserv "Notice $nick :Greeting for $chan set to $text"}   if {[string match -nocase "$greetchan4" $chan]} {        set $greeting4 "$text"        putserv "Notice $nick :Greeting for $chan set to $text"}   if {[string match -nocase "$greetchan5" $chan]} {        set $greeting5 "$text"        putserv "Notice $nick :Greeting for $chan set to $text"}   if {[string match -nocase "$greetchan6" $chan]} {        set $greeting6 "$text"        putserv "Notice $nick :Greeting for $chan set to $text"}   if {[string match -nocase "$greetchan7" $chan]} {        set $greeting7 "$text"        putserv "Notice $nick :Greeting for $chan set to $text"}   if {[string match -nocase "$greetchan8" $chan]} {        set $greeting8 "$text"        putserv "Notice $nick :Greeting for $chan set to $text"}   if {[string match -nocase "$greetchan9" $chan]} {        set $greeting9 "$text"        putserv "Notice $nick :Greeting for $chan set to $text"}   if {[string match -nocase "$greetchan10" $chan]} {        set $greeting10 "$text"        putserv "Notice $nick :Greeting for $chan set to $text" if {[string match -nocase "$greetchan11" $chan]} { set $greeting11 "$text"putserv "Notice $nick :Greeting for $chan set to $text"}   if {[string match -nocase "$greetchan12" $chan]} {        set $greeting12 "$text"        putserv "Notice $nick :Greeting for $chan set to $text"}   if {[string match -nocase "$greetchan13" $chan]} {        set $greeting13 "$text"        putserv "Notice $nick :Greeting for $chan set to $text"}   if {[string match -nocase "$greetchan14" $chan]} {        set $greeting14 "$text"        putserv "Notice $nick :Greeting for $chan set to $text"}   if {[string match -nocase "$greetchan15" $chan]} {        set $greeting15 "$text"        putserv "Notice $nick :Greeting for $chan set to $text"}   if {[string match -nocase "$greetchan16" $chan]} {        set $greeting16 "$text"        putserv "Notice $nick :Greeting for $chan set to $text"}   if {[string match -nocase "$greetchan17" $chan]} {        set $greeting17 "$text"        putserv "Notice $nick :Greeting for $chan set to $text"}   if {[string match -nocase "$greetchan18" $chan]} {        set $greeting18 "$text"        putserv "Notice $nick :Greeting for $chan set to $text"}   if {[string match -nocase "$greetchan19" $chan]} {        set $greeting19 "$text"        putserv "Notice $nick :Greeting for $chan set to $text"}   if {[string match -nocase "$greetchan20" $chan]} {        set $greeting20 "$text"        putserv "Notice $nick :Greeting for $chan set to $text"}}}putlog "greeting.tcl by kazoo (david@conflabit.net)With Mods by Ratman - LOADED!!"# kazoo (david@conflabit.net)</code></pre></div>This script needs alot more help than a TCL Newbie can give....wanna help me out? <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=3402">ratman</a> — Mon Jul 26, 2004 12:26 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2004-07-25T23:53:38-04:00</updated>

		<published>2004-07-25T23:53:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=39079#p39079</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=39079#p39079"/>
		<title type="html"><![CDATA[Variable issue]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=39079#p39079"><![CDATA[
Ow, my gawd.<br>You have closed the procedure, just by declaring variables.<br>So the rest code after it, will bind on rehash, restart etc.<br>Plus try to declare all of them in 1 line. Makes it easier to read as well.<br><br>First leme re-arrange it and put it in a readable manner.<br>By the way alot of logic in your script is wrong.<br><br>[1] Use lists for matching the channel (with lsearch -exact)<br>[2] Don't use string match for matching channel variables.<br>[3] Declaring alot of global variables make it messey, you can use arrays... I mean variables with ( and ).<br><div class="codebox"><p>Code: </p><pre><code>There we go: proc proc:greet {nick mask hand chan} {  global greetchan greetvar greeting greetchan2 greeting2 greetchan3 global greeting3 greetchan4 greeting4 greetchan5 greeting5 greetchan6 global greeting6 greetchan7 greeting7 greetchan8 greeting8 greetchan9 global greeting9 greetchan10 greeting10 greetchan11 greeting11 greetchan12 global greeting12 greetchan13 greeting13 greetchan14 greeting14 greetchan15  global greeting15 greetchan16 greeting16 greetchan17 greeting17 greetchan18 global greeting18 greetchan19 greeting19 greetchan20 greeting20  if {[string match -nocase *$greetchan* $chan]} {  if {[string match -nocase "0" $greetvar]} {  regsub -all "\t" [split [exec [lindex "cat greeting.txt" 0] [join [lrange "cat greeting.txt" 1 end]]] \n] " " results    foreach line $results {    puthelp "Notice $nick :$line"    }  }  if {[string match -nocase "1" $greetvar]} {  putquick "Notice $nick :$greeting"   } }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Sun Jul 25, 2004 11:53 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ratman]]></name></author>
		<updated>2004-07-25T23:25:13-04:00</updated>

		<published>2004-07-25T23:25:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=39077#p39077</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=39077#p39077"/>
		<title type="html"><![CDATA[Variable issue]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=39077#p39077"><![CDATA[
<blockquote class="uncited"><div>Paste the script (procedure) here, so we can take a closer look.  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_mrgreen.gif" width="15" height="15" alt=":mrgreen:" title="Mr. Green"></div></blockquote>Here we go:<br><br>proc proc:greet {nick mask hand chan} {<br>  global greetchan<br>  global greetvar<br>  global greeting<br>  global greetchan2<br>  global greeting2<br>  global greetchan3<br>  global greeting3<br>  global greetchan4<br>  global greeting4<br>  global greetchan5<br>  global greeting5<br>  global greetchan6<br>  global greeting6<br>  global greetchan7<br>  global greeting7<br>  global greetchan8<br>  global greeting8<br>  global greetchan9<br>  global greeting9<br>  global greetchan10<br>  global greeting10<br>  global greetchan11<br>  global greeting11<br>  global greetchan12<br>  global greeting12<br>  global greetchan13<br>  global greeting13<br>  global greetchan14<br>  global greeting14<br>  global greetchan15<br>  global greeting15<br>  global greetchan16<br>  global greeting16<br>  global greetchan17<br>  global greeting17<br>  global greetchan18<br>  global greeting18<br>  global greetchan19<br>  global greeting19<br>  global greetchan20<br>  global greeting20<br>  global chan<br>}<br><br>  if {[string match -nocase "$greetchan" $chan]} {<br><br>     if {[string match -nocase "0" $greetvar]} {<br>regsub -all "\t" [split [exec [lindex "cat greeting.txt" 0] [join [lrange "cat greeting.txt" 1 end]]] \n] " " results<br>foreach line $results { puthelp "Notice $nick :$line" }<br>}<br>     if {[string match -nocase "1" $greetvar]} {<br>        putquick "Notice $nick :$greeting"<br>}<br>}<br><br>rest of script similar<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3402">ratman</a> — Sun Jul 25, 2004 11:25 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2004-07-25T23:17:20-04:00</updated>

		<published>2004-07-25T23:17:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=39074#p39074</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=39074#p39074"/>
		<title type="html"><![CDATA[Variable issue]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=39074#p39074"><![CDATA[
Paste the script (procedure) here, so we can take a closer look.  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_mrgreen.gif" width="15" height="15" alt=":mrgreen:" title="Mr. Green"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Sun Jul 25, 2004 11:17 pm</p><hr />
]]></content>
	</entry>
	</feed>
