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

	<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>2001-10-11T20:26:00-04:00</updated>

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

		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2001-10-11T20:26:00-04:00</updated>

		<published>2001-10-11T20:26:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=485#p485</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=485#p485"/>
		<title type="html"><![CDATA[What's wrong?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=485#p485"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>############### Bad words ################# Do not punish this channels - keep them lowercaseset not_punish {  #channel1  #channel2  #channelx  #mychan}# Punishable wordsset punish_words {[censored]****word"multiword format""what a looser"}## THE DREADED DO NOT TOUCH BITset punish_nicksproc punish:1 {nick uh hand chan arg} {  global punish_nicks not_punish  if {[lsearch -exact $not_punish [string tolower $chan]] &gt;= 0} { return }  if {[set idx [lsearch -exact $punish_nicks [string tolower $nick]]] &gt;= 0} {    set punish_nicks [lreplace $punish_nicks $idx $idx]    putkick $chan $nick "You are suposed to say sorry, not swear again"    return  }  lappend punish_nicks [string tolower $nick]  puthelp "PRIVMSG $chan :${nick}! Say sorry for swearing (warning one)!!"  utimer 30 [list punish:2 $nick $chan]}proc punish:2 {nick chan} {  global punish_nicks  if {[set idx [lsearch -exact $punish_nicks [string tolower $nick]]] &gt;= 0} {    if {![onchan $nick $chan]} {      set punish_nicks [lreplace $punish_nicks $idx $idx]      return    }    puthelp "PRIVMSG $chan :${nick}! You have allready been warned, all you have to say is sorry!"    utimer 10 [list punish:3 $nick $chan]  }}proc punish:3 {nick chan} {  global punish_nicks  if {[set idx [lsearch -exact $punish_nicks [string tolower $nick]]] &gt;= 0} {    set punish_nicks [lreplace $punish_nicks $idx $idx]    if {![onchan $nick $chan]} { return }    putkick $chan $nick "You only had to say sorry"  }}proc punish:sorry {nick uh hand chan arg} {  global punish_nicks not_punish  if {[lsearch -exact $not_punish [string tolower $chan]] &gt;= 0} { return }  if {[set idx [lsearch -exact $punish_nicks [string tolower $nick]]] &gt;= 0} {    set punish_nicks [lreplace $punish_nicks $idx $idx]    puthelp "PRIVMSG $chan :${nick}! See, that wasn't too hard"  }}bind pub - "sorry" punish:sorryforeach a $punish_words {  bind pubm - "*${a}*" punish:1}unset aputlog "BYE BYE BADWORDS - ppslim"</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Thu Oct 11, 2001 8:26 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Petersen]]></name></author>
		<updated>2001-10-11T19:25:00-04:00</updated>

		<published>2001-10-11T19:25:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=478#p478</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=478#p478"/>
		<title type="html"><![CDATA[What's wrong?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=478#p478"><![CDATA[
I see a hell of a lot of errors in that. Firstly the binds are wrong for wildcarded matches (should be pubm). Procs are declared with incorrect number of args. Foreach loop in proc punish declaired with no body. unpunished chans section in same script needs competly redesigning. asked_sorry not declared as global variable in any proc. timers can't use fractional numbers (use utimer for seconds). warning's 2 and 3 should be called from timer with the nick and chan as arguments, and appropriatly declared in the proc. if { [asked_sorry == "yes"] } would return an error, as it would try and execute either 1 or 0 as a command due to square brackets. $asked_sorry and $anteeksiannettu should be same thing. also they really should be declared as arrays, with $nick as the array index. i might write this all for you properly tomorrow if i have the time<br><br>&lt;font size=-1&gt;[ This Message was edited by: Petersen on 2001-10-11 17:32 ]&lt;/font&gt;<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=60">Petersen</a> — Thu Oct 11, 2001 7:25 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2001-10-11T16:43:00-04:00</updated>

		<published>2001-10-11T16:43:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=474#p474</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=474#p474"/>
		<title type="html"><![CDATA[What's wrong?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=474#p474"><![CDATA[
Why this script won't do anything, even say error message:<br><div class="codebox"><p>Code: </p><pre><code>############### Bad words ################# Do not punish these channels:set do_not_punish_these_chans {  }#######################################bind pub - "*[censored]*" punishbind pub - "*[censored]*" punishbind pub - "sorry*" apologize########################################proc punish {nick host hand chan} {global do_not_punish_these_chansforeach badchan $do_not_punish_these_chansif { [onchan $nick "#$badchan"] } { return 0 }puthelp "PRIVMSG $chan :$nick! Say sorry!!"set criminal { $nick }set crimechan { $chan }timer 0.5 warning2set asked_sorry { "ei" }}proc warning2 {} {global criminal crimechanif { [asked_sorry == "yes"] } { return 0 }puthelp "PRIVMSG $crimechan :It would be nice to say sorry!"timer 0.2 warning3}proc warning3 {} {global criminal crimechanif { [asked_sorry == "yes"] } { return 0 }puthelp "PRIVMSG $crimechan :Damn you $criminal."putserv "KICK $crimechan $criminal Shame!"set anteeksiannettu { "yes" }}proc apologize {nick host hand chan} {puthelp "PRIVMSG $chan: That's ok!"set anteeksiannettu { "yes" }}########################################putlog "Do not use bad words!!!"########################################</code></pre></div>Thanks<br><br>&lt;font size=-1&gt;[ This Message was edited by: jpheur on 2001-10-11 14:46 ]&lt;/font&gt;<p>Statistics: Posted by Guest — Thu Oct 11, 2001 4:43 pm</p><hr />
]]></content>
	</entry>
	</feed>
