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

	<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>2009-12-06T14:36:25-04:00</updated>

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

		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2009-12-06T14:36:25-04:00</updated>

		<published>2009-12-06T14:36:25-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=91220#p91220</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=91220#p91220"/>
		<title type="html"><![CDATA[Re: help greeter]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=91220#p91220"><![CDATA[
<blockquote class="uncited"><div>&lt;IceShadow&gt; [09:42] Tcl error [record:changenick]: list element in quotes followed by "(William" instead of space</div></blockquote>That would indicate a problem with a different script. One by a fellow who has no understanding of what strings and lists are. For example, see the procedure below from "blackseen"<br>A tcl seen script is a resource hog. Never do this. Instead use "gseen" module and do it right.. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"><br><div class="codebox"><p>Code: </p><pre><code>proc record:changenick {nick host hand chan newnick} {global dir botnickif {![channel get $chan seen]} {return 0}set lin 0set time [unixtime]set host "*!$host"if {[isbotnick $nick]} { return 0 }set who "NICKCHANGE $chan $nick $host $time $newnick"set file [open $dir "r"]set database [read -nonewline $file]close $fileset data [split $database "\n"]foreach line $data {set lin [expr $lin +1]set userentry [lindex $line 2]set chanentry [lindex $line 1]if {[string match -nocase $userentry $nick] &amp;&amp; [string match -nocase $chanentry $chan]} {if {$line != ""} {set num [expr $lin - 1]set delete [lreplace $data $num $num]set files [open $dir "w"]puts $files [join $delete "\n"]close $files}}}set file [open $dir "a"]puts $file "$who"close $file}</code></pre></div>First you notice its not indented properly at all and quite ugly. Then you notice this part:<div class="codebox"><p>Code: </p><pre><code>foreach line $data {set lin [expr $lin +1]set userentry [lindex $line 2]set chanentry [lindex $line 1]</code></pre></div>Wallah, we found the problem. $line is not a list. It needs to be split before applying that lindex.<div class="codebox"><p>Code: </p><pre><code>foreach line $data {set lin [expr $lin +1]set userentry [lindex [split $line] 2]set chanentry [lindex [split $line] 1]</code></pre></div>There are problems like this throughout all these "black" scripts. Use them at your own risk with special characters. It's made quite clear that the fellow has no idea what strings or lists truly are.. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Sun Dec 06, 2009 2:36 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[freebsd]]></name></author>
		<updated>2009-12-06T10:43:49-04:00</updated>

		<published>2009-12-06T10:43:49-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=91215#p91215</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=91215#p91215"/>
		<title type="html"><![CDATA[help greeter]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=91215#p91215"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>#         Script : Greeter v1.01 by David Proper (Dr. Nibble [DrN])#                  Copyright 2001 Radical Computer Systems#                             All Rights Reserved##       Testing#      Platforms : Linux 2.2.16   TCL v8.3#                  Eggdrop v1.6.2#            And : SunOS 5.8      TCL v8.3#                  Eggdrop v1.5.4##    Description : Greeter gives your bot an auto-greet with a twist.#                  Using probabilities for different things, it modifies#                  the way it greets, and if it greets at all.#                  Can also be set to only greet on certain channels.##        History : 08/08/2001 - First Release#                  12/28/2001 - v1.01#                              o Fixed missing $ on variable error.#                              o Was checking the existence of publics #                                wrong. Fixed.#                              o Method for sending greeting is now#                                definable.###   Future Plans : Fix Bugs. :)## Author Contact :     Email - DProper@stx.rr.com#                  Home Page - http://home.stx.rr.com/dproper#                        IRC - Nick: DrN  UnderNet/DALnet#          Support Channels  - #RCS @ UnderNet#                              #RCS @ DALnet## Chaotix.Net is currentlly offline. Should return no later then Jan 1st, 2002##   Radical Computer Systems - http://www.chaotix.net/rcs/# To subscribe to the RCS mailing list: mail majordomo@chaotix.net and in#  BODY of message, type  subscribe rcs-list##  Feel free to Email me any suggestions/bug reports/etc.# # You are free to use this TCL/script as long as:#  1) You don't remove or change author credit#  2) You don't release it in modified form. (Only the original)# # If you have a "too cool" modification, send it to me and it'll be# included in the official release. (With your credit)## Commands Added:#  Where     F CMD          F CMD            F CMD           F CMD#  -------   - ----------   - ------------   - -----------   - ----------#  Public:   N/A#     MSG:   N/A#     DCC:   N/A## Public Matching: N/A##\# |##### NOTE: Anything on the Chaotix.Net domain is currently offline#/# Publics is for another script of mine that allows you to turn off# channel stuff like this. It's also wired into my Channel Gaurdian script# so stuff like this are turned off during flood attacks.if {![info exists publics]} {set publics 1}# This is the percentage chance they will get greeted at all.set greet(greetprob) 80# This is the percentage chance to Strip non-alpha charsset greet(snaprob) 75# This is the percentage chance to change nick to lowercaseset greet(nlowprob) 40# This is the percentage chance to change greeting to lowercaseset greet(mlowprob) 35# This is the percentage chance to add an ending (if greeting don't end in a ?)set greet(end1prob) 60# This is the percentage chance to add ending 2 (smily faces by defualt)set greet(end2prob) 40#[1/2/3] How do you want the greetinging sent.# 1 : public   2 : msg  3 : notice# When using method 2 or 3, Ya might wanna always include the channel name.# If ya don't, you'll get even MORE people trying to chat with your bot. :)set greet(notification) 1# Define this as the channels you want to greet. * for allset greet(chans) "#love #isleofview #Spank&amp;Tickle #30+flirts #flirting_cafe"# This is the main greeting lines. Variables here are $nick for the nick# of the user being greeted and $chan for the current channel.set greet(lines) { {Hiya $nick} {Howdy $nick} {Hey $nick} {What's up $nick?} {'Ello $nick} {Hiyaz $nick} {Hi $nick} {HiHi $nick} {Hallo $nick} {Hello there $nick} {Greetings $nick} {G'day $nick} {$nick} {WuzUp $nick} {It's the $nickster} {Wow! It's $nick} {Look! $nick is here}}# This is the first set of random endings.set greet(endings1) {{!}  {.}  {!!}  {!!1} {!1!1!}}# This is the set of second random endings.set greet(endings2) {{ :)}  { :)}  { :o)} { :o)} { :-)} { :^)} { 8-)}}set greet(ver) "v1.01.01"bind join - ***** greet_joinproc greet_join {nick uhost hand chan} {global botnick publicsif {$publics == 0} {return 0}if {$botnick == $nick} {return 1}if {![greetchan $chan]} {return 1}utimer [expr [rand 15] + 5] "greet_do $nick $chan"return 1}proc greet_do {nick chan} { global greet set gnick $nick set anick "" set gloop 0; while {$gloop &lt; [string length $nick]} {  if {[string match "*[string index $nick $gloop]*" "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"]} {set anick "$anick[string index $nick $gloop]"}  incr gloop 1                                        } if {[string length $anick] &lt; 3} {set anick $nick}# putlog "greet_do $nick $chan anick:$anick gnick:$gnick" if {![onchan $nick $chan]} {return 1} if {![probability $greet(greetprob)]} {return 1} if {![probability $greet(snaprob)]} {set gnick $anick} if {![probability $greet(nlowprob)]} {set gnick [string tolower $gnick]} set outmsg [randomline $greet(lines)] if {[probability $greet(mlowprob)]} {set outmsg [string tolower $outmsg]} if {([probability $greet(end1prob)]) &amp;&amp; ([string index $outmsg [expr [string length $outmsg] - 1]] != "?")} {append outmsg [randomline $greet(endings1)]} if {[probability $greet(end2prob)]} {append outmsg [randomline $greet(endings2)]} regsub -all {\$nick} $outmsg $gnick outmsg regsub -all {\$chan} $outmsg $chan outmsg regsub -all {\\001} $outmsg \001 outmsg regsub -all {\\002} $outmsg \002 outmsg switch $greet(notification) {  1 {putserv "PRIVMSG $chan :$outmsg"}  2 {putserv "PRIVMSG $nick :$outmsg"}  3 {putserv "NOTICE $nick :$outmsg"}                             }}proc randomline {text} { return [lindex $text [rand [llength $text]]]}proc greetchan {chan} { global greet set chan [string tolower $chan] set chans [string tolower $greet(chans)] if {$chan == "*"} {set chans [string tolower [channels]]} set dothechan 0 foreach c $chans {  if {($chan == $c)} {set dothechan 1}                  } if {$dothechan == 0} {return 0} else {return 1}}proc probability {prob} { if {$prob == 100} {return 1} set r [rand 100] set rng [rand [expr 100 - $prob]] set rngu [expr $rng + $prob]# putlog "prob:$prob r:$r range: $rng - $rngu" if {($r &gt; $rng) &amp;&amp; ($r &lt; $rngu)} {return 1} return 0}putlog "Greeter $greet(ver) by David Proper (DrN) -: LoadeD :-"return "Greeter $greet(ver) by David Proper (DrN) -: LoadeD :-"[u]&lt;IceShadow&gt; [09:42] Tcl error [record:changenick]: list element in quotes followed by "(William" instead of space[/u]</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6821">freebsd</a> — Sun Dec 06, 2009 10:43 am</p><hr />
]]></content>
	</entry>
	</feed>
