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

	<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>2002-02-13T10:41:00-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Petersen]]></name></author>
		<updated>2002-02-13T10:41:00-04:00</updated>

		<published>2002-02-13T10:41:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=4534#p4534</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=4534#p4534"/>
		<title type="html"><![CDATA[How can I..............?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=4534#p4534"><![CDATA[
you're still using list functions on strings, and | should be ||<br><br>if { ([lindex [split $text] 0] == "slaps") || ([lindex [split $text] 0] == "punches") } { <br><br>would be technically correct. however, the more that line expands, the more inefficient the multiple lindex and splits become.<br>a much better way to do it would be<br><br>set word [lindex [split $text] 0]<br>if {($word == "slaps") || ($word == "punches")} {<br><br>also, you might want to use a string tolower too to make the match case insensitive.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=60">Petersen</a> — Wed Feb 13, 2002 10:41 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2002-02-13T09:48:00-04:00</updated>

		<published>2002-02-13T09:48:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=4531#p4531</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=4531#p4531"/>
		<title type="html"><![CDATA[How can I..............?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=4531#p4531"><![CDATA[
it's okay I managed to suss it out.<br>I did a little light reading and came up with this solution:<br><br>if { ([lindex $text 0] == "slaps") | ([lindex $text 0] == "punches") } {<br><br>I can now add as many ([lindex $text 0 == "whatevers") as I like and it works perfectly.<p>Statistics: Posted by Guest — Wed Feb 13, 2002 9:48 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Petersen]]></name></author>
		<updated>2002-02-12T18:35:00-04:00</updated>

		<published>2002-02-12T18:35:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=4512#p4512</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=4512#p4512"/>
		<title type="html"><![CDATA[How can I..............?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=4512#p4512"><![CDATA[
no, cos i read the manual and learned the difference between a list and a string. first thing you should ever do when learning a new programming language is learn the different data types/structures and how they relate to each other.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=60">Petersen</a> — Tue Feb 12, 2002 6:35 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Souperman]]></name></author>
		<updated>2002-02-12T17:40:00-04:00</updated>

		<published>2002-02-12T17:40:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=4509#p4509</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=4509#p4509"/>
		<title type="html"><![CDATA[How can I..............?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=4509#p4509"><![CDATA[
<blockquote class="uncited"><div>On 2002-02-12 08:19, Petersen wrote:<br>not using list functions on strings would be a good idea too</div></blockquote>Explaining what you mean would also not be such a bad idea. Remember what it's like to be a newbie... you were once one, I guarantee it.<br><br>Read <a href="http://www.soft.net.uk/staffs/eggdrop/characters.html" class="postlink">http://www.soft.net.uk/staffs/eggdrop/characters.html</a> for some useful tips.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=801">Souperman</a> — Tue Feb 12, 2002 5:40 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Petersen]]></name></author>
		<updated>2002-02-12T11:19:00-04:00</updated>

		<published>2002-02-12T11:19:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=4498#p4498</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=4498#p4498"/>
		<title type="html"><![CDATA[How can I..............?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=4498#p4498"><![CDATA[
not using list functions on strings would be a good idea too<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=60">Petersen</a> — Tue Feb 12, 2002 11:19 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2002-02-12T09:40:00-04:00</updated>

		<published>2002-02-12T09:40:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=4493#p4493</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=4493#p4493"/>
		<title type="html"><![CDATA[How can I..............?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=4493#p4493"><![CDATA[
the simplest way:<br><br>set act [lindex $text 0]<br>if {{$act == "slaps"}||{$act == "slurp}} {<br><br>this is ok if you have just 2 or 3 words...<br>else, you can set an array of words and search for matches:<br><br># word list <br>set $slap {"slaps" "slurps" "bla" "....}<br><br># procedure<br>set act [lindex $text 0]<br>foreach i [string $slap] {<br><br>if {[string match *$i* [string $act]]} {<br>set temp 1<br><br>}<br>}<br>if {$$temp == 1} {<br>your proc<br>}<br><br>this method works well when you have a lot of words, but it's slower<br><br>&lt;font size=-1&gt;[ This Message was edited by: CrazyCat on 2002-02-12 06:41 ]&lt;/font&gt;<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Tue Feb 12, 2002 9:40 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2002-02-12T09:31:00-04:00</updated>

		<published>2002-02-12T09:31:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=4492#p4492</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=4492#p4492"/>
		<title type="html"><![CDATA[How can I..............?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=4492#p4492"><![CDATA[
Add extra words where "slaps" is to make it act on more than just the word "slaps"?<br>Here's the script:<br><br>set aslapr {<br>  "who the f*ck are you slapping?!"<br>  "you slap me, I kick you!"<br>  "Rule #1. Don't slap the bots!"<br>  "you cheeky sod!"<br>  "How dare you?!"<br>}<br><br>proc pub_antislap { nick uhost hand dest keyword text } {<br>     global botnick<br>     global aslapr<br>     if {[string index $dest 0] != "#"} { return 0 }<br>     if {[lindex $text 0] == "slaps"} {<br>      if {[lindex $text 1] == $botnick} {<br>        putserv "kick $dest $nick :[lindex $aslapr [rand [llength $aslapr]]]"<br>#       putchan "#blahblah" "[lindex $ranantislap [rand [llength $ranantislap]]]";<br>      }<br>     }<br> }<br><br>Can I just add another line like:<br><br>if {[lindex $text 0] == "punches"} <br><br>under the slaps one and form a list with other similar words?<br><br>Thanks for any help or advice.<br><p>Statistics: Posted by Guest — Tue Feb 12, 2002 9:31 am</p><hr />
]]></content>
	</entry>
	</feed>
