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

	<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>2018-04-09T01:55:55-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Draknon]]></name></author>
		<updated>2018-04-09T01:55:55-04:00</updated>

		<published>2018-04-09T01:55:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106790#p106790</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106790#p106790"/>
		<title type="html"><![CDATA[voice for nick with non Cap 1st letter]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106790#p106790"><![CDATA[
got this all set and working .. thanks for all the help<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12740">Draknon</a> — Mon Apr 09, 2018 1:55 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Draknon]]></name></author>
		<updated>2018-04-08T03:41:44-04:00</updated>

		<published>2018-04-08T03:41:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106784#p106784</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106784#p106784"/>
		<title type="html"><![CDATA[voice for nick with non Cap 1st letter]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106784#p106784"><![CDATA[
ok, new information ... <br><div class="codebox"><p>Code: </p><pre><code>##  Script: sub voice#namespace eval NickCase {      set channel "#The-Dungeon"   bind join - * [namespace current]::joined   bind nick - * [namespace current]::nick_chk   proc joined {nick uhost hand chan} {      variable channel      if {![string match -nocase $chan $channel]} return      if {![string equal $nick [string totitle $nick]]} {         pushmode $chan +v $nick      }   }      proc nick_chk {nick uhost hand chan newnick} {      variable channel      if {![string match -nocase $chan $channel]} return       set match {expr [regexp -all {[A-Z]} $newnick]}      if {[isvoice $nick $chan]} {         if {$match} {            pushmode $chan -v $newnick         }      } else {         if {!$match} {            pushmode $chan +v $newnick         }      }   }} putlog "sub voice loaded"</code></pre></div>Error msg is ..  <blockquote class="uncited"><div>Tcl error [::NickCase::nick_chk]: expected boolean value but got "expr [regexp -all {[A-Z]} $newnick]"</div></blockquote>on top of fixing this can someone please explain to me what the error means??<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12740">Draknon</a> — Sun Apr 08, 2018 3:41 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Draknon]]></name></author>
		<updated>2018-04-04T21:56:52-04:00</updated>

		<published>2018-04-04T21:56:52-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106747#p106747</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106747#p106747"/>
		<title type="html"><![CDATA[voice for nick with non Cap 1st letter]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106747#p106747"><![CDATA[
ok, I copy and pasted the new and it is still not working.. <br><br>I think I kinda understand what some things are supposed to do..<br><br>can we just get rid of the ... <div class="codebox"><p>Code: </p><pre><code>if {[isbotnick $nick] || ![botisop $chan]} return</code></pre></div>and just expect that the bot is an op, because it is.<br><br>and sorry, I didn't explain what the original actually does...<br><br>if someone comes into channel and the nick first letter is lowercase then that person gets the +v and if they have a Capped nick then nothing and if a nick changes the upper/lower case of the first letter than either +v or -v depending on which they do.. and if nick starts with a non alpha like { or [ or some such then it looks for the first actual alpha character and works from that.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12740">Draknon</a> — Wed Apr 04, 2018 9:56 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2018-04-04T01:42:42-04:00</updated>

		<published>2018-04-04T01:42:42-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106746#p106746</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106746#p106746"/>
		<title type="html"><![CDATA[voice for nick with non Cap 1st letter]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106746#p106746"><![CDATA[
Here's the updated and tested code.<div class="codebox"><p>Code: </p><pre><code>namespace eval NickCase {set channel "#The-Dungeon"bind join - * [namespace current]::joinedbind nick - * [namespace current]::nickproc joined {nick uhost hand chan} {if {[isbotnick $nick] || ![botisop $chan]} returnvariable channelif {![string match -nocase $chan $channel]} returnif {![string equal $nick [string totitle $nick]]} {pushmode $chan +v $nick}}   proc nick {nick uhost hand chan newnick} {if {[isbotnick $nick] || ![botisop $chan]} returnvariable channelif {![string match -nocase $chan $channel]} returnset match [string equal [string index $newnick 0] [string index [string totitle $newnick] 0]]if {[isvoice $nick $chan]} {if {$match} {pushmode $chan -v $newnick}} else {if {!$match} {pushmode $chan +v $newnick}}}}</code></pre></div>The main issue was because of <em class="text-italics">botisop</em> part in:<div class="codebox"><p>Code: </p><pre><code>if {[isbotnick $nick] || [botisop $chan]} return</code></pre></div>that basically means if the bot is channel operator then it would stop executing anything past this line, when in fact wanted to stop the execution only if the bot wasn't channel operator, hence the ! in front of the <em class="text-italics">[botisop $chan]</em> in above "updated" code.<br><br>The second issue I've discovered is that <em class="text-italics">string totitle</em> on it's own wasn't enough because it turns SomeNick into Somenick and the previous test:<div class="codebox"><p>Code: </p><pre><code>if {[string equal $newnick [string totitle $newnick]]} { </code></pre></div>basically will test if SomeNick is now equal with Somenick and will fail. So, instead I now take the first letter of the new nick and compare it with the first letter from <em class="text-italics">string totitle</em> result.<br><br>An alternative to:<div class="codebox"><p>Code: </p><pre><code>set match [string equal [string index $newnick 0] [string index [string totitle $newnick] 0]] </code></pre></div>could be:<div class="codebox"><p>Code: </p><pre><code>set match [expr [regexp -all {[A-Z]} $newnick]]</code></pre></div>but in a 1000 iterations test the <em class="text-italics">string equal</em> one seems slightly faster, even if it's ugly.<div class="codebox"><p>Code: </p><pre><code>% time {for {set i 0} {$i &lt; 1000} {incr i} { append mylist [regexp -all {[A-Z]} $newnick] }}1731 microseconds per iteration% time {for {set i 0} {$i &lt; 1000} {incr i} { append mylist [string equal [string index $newnick 0] [string index [string totitle $newnick] 0]] }}1425 microseconds per iteration</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Wed Apr 04, 2018 1:42 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Draknon]]></name></author>
		<updated>2018-04-03T06:26:17-04:00</updated>

		<published>2018-04-03T06:26:17-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106745#p106745</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106745#p106745"/>
		<title type="html"><![CDATA[you are awesome]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106745#p106745"><![CDATA[
but, unfortunately it doesn't work at all <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":(" title="Sad"><br><br>I am trying to learn, but it isn't easy for me so I'm not sure where the issue is.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12740">Draknon</a> — Tue Apr 03, 2018 6:26 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2018-04-02T00:54:26-04:00</updated>

		<published>2018-04-02T00:54:26-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106743#p106743</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106743#p106743"/>
		<title type="html"><![CDATA[voice for nick with non Cap 1st letter]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106743#p106743"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>namespace eval NickCase {set channel "#The-Dungeon"bind join - * [namespace current]::joinedbind nick - * [namespace current]::nickproc joined {nick uhost hand chan} {if {[isbotnick $nick] || [botisop $chan]} returnvariable channelif {![string match -nocase $chan $channel]} returnif {![string equal $nick [string totitle $nick]]} {pushmode $chan +v $nick}}proc nick {nick uhost hand chan newnick} {if {[isbotnick $nick] || [botisop $chan]} returnvariable channelif {![string match -nocase $chan $channel]} returnif {[isvoice $newnick $chan]} {if {[string equal $newnick [string totitle $newnick]]} {pushmode $chan -v $newnick}} else {if {![string equal $newnick [string totitle $newnick]]} {pushmode $chan +v $newnick}}}}</code></pre></div>Haven't tested anything so let me know if doesn't work.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Mon Apr 02, 2018 12:54 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Draknon]]></name></author>
		<updated>2018-04-01T08:29:07-04:00</updated>

		<published>2018-04-01T08:29:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106741#p106741</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106741#p106741"/>
		<title type="html"><![CDATA[voice for nick with non Cap 1st letter]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106741#p106741"><![CDATA[
I currently have this for an mIRC bot.. would like to have it for eggdrop bot so need it in tlc. any help would be appreciated.. <div class="codebox"><p>Code: </p><pre><code>alias -l _c return #The-Dungeonalias startwithupper {  if ( $1 ) {    return $isupper($left($regsubex($$1,/\W+/g,$null),1))  }  else return $false}on @*:JOIN:#The-Dungeon:{  if ( $startwithupper($nick) == $false ) {    mode $_c +v $nick  }}on @*:NICK:{  if ( ( $startwithupper($newnick) == $false ) &amp;&amp; ( $newnick !isvoice $_c ) ) {    ; New nick is with upper case and previous is unvoiced    mode $_c +v $newnick  }  if ( ( $startwithupper($newnick) == $true ) &amp;&amp; ( $newnick isvoice $_c ) ) {    ; New nick is with lower case and previous is voiced    mode $_c -v $newnick  }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12740">Draknon</a> — Sun Apr 01, 2018 8:29 am</p><hr />
]]></content>
	</entry>
	</feed>
