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

	<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-02-23T15:51:23-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Arnold_X-P]]></name></author>
		<updated>2018-02-23T15:51:23-04:00</updated>

		<published>2018-02-23T15:51:23-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106703#p106703</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106703#p106703"/>
		<title type="html"><![CDATA[recognize special characters in nicknames]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106703#p106703"><![CDATA[
it works but not very well...<br>recognizes normal nicknames<br>but nicknames with special characters do not recognize them example : <strong class="text-strong">{N}ick</strong><br><div class="codebox"><p>Code: </p><pre><code>bind PUB o !topme opproc op {nick host hand chan text} {global flagaccess  foreach user [split $text] {if {![botisop $chan]} {puthelp "NOTICE $nick :I'm down I do not have @ in $chan"}if {$user == ""} { puthelp "MODE $chan +o $user"  } puthelp "MODE $chan +ooooo $user $user $user $user $user" return 0 } </code></pre></div>and error in partyline:<br><div class="codebox"><p>Code: </p><pre><code>[15:47:40] Tcl error [op]: list element in braces followed by "ick" instead of space </code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8327">Arnold_X-P</a> — Fri Feb 23, 2018 3:51 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2018-02-16T03:23:27-04:00</updated>

		<published>2018-02-16T03:23:27-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106690#p106690</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106690#p106690"/>
		<title type="html"><![CDATA[recognize special characters in nicknames]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106690#p106690"><![CDATA[
What if the "text" contains only one name (or better said element)? What would you say it happens?<br><br>Don't know what that regexp is supposed to do but if $text has just one element (is a list of unknown number of elements at this time) then it will fail to grab index number 1, 2, 3 and obviously 4 thus failing with an error. My guess is that you didn't see it because of that regexp doing something and execution is halted there.<br><br>Safest option in my opinion would be a <em class="text-italics">foreach</em> loop over splitting that $text list cos it's not safe to trust your users input and based on how many of the "elements" need op, are on the channel and whatever other checks you want to add and then add them into another list that you just create then loop over it outside the first one to do the actual +o on each element you found in the first.<br><br>This has been discussed many times in the past so will let you figure out what code you actually need. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"><br><br>If you try something and get stuck then I will help you out.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Fri Feb 16, 2018 3:23 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Arnold_X-P]]></name></author>
		<updated>2018-02-10T21:12:32-04:00</updated>

		<published>2018-02-10T21:12:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106676#p106676</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106676#p106676"/>
		<title type="html"><![CDATA[Re: recognize special characters in nicknames]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106676#p106676"><![CDATA[
Try to use the same resource but in the second example it did not work for me:<div class="codebox"><p>Code: </p><pre><code>bind PUB o !op opproc op {nick host hand chan text} {global flagaccess if {![matchattr $hand $flagaccess $chan]} { if {[regexp -- {^[\x41-\x7D][-\d\x41-\x7D]*$} $target]} {  if {$target == ""} { set target [lindex $text 0]set target1 [lindex $text 1]set target2 [lindex $text 2]set target3 [lindex $text 3]set target4 [lindex $text 4]if {![botisop $chan]} {puthelp "NOTICE $nick :I'm down I do not have @ in $chan"}if {$target == ""} { puthelp "MODE $chan +o $nick"  } puthelp "MODE $chan +ooooo $target $target1 $target2 $target3 $target4" return 0 }</code></pre></div>error in partyline<br>  [20:24:46] Tcl error [op]: list element in braces followed by "ick" instead of space<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8327">Arnold_X-P</a> — Sat Feb 10, 2018 9:12 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Arnold_X-P]]></name></author>
		<updated>2018-02-10T21:06:37-04:00</updated>

		<published>2018-02-10T21:06:37-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106675#p106675</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106675#p106675"/>
		<title type="html"><![CDATA[recognize special characters in nicknames]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106675#p106675"><![CDATA[
I was trying out this little tcl<br>to recognize special characters in nicknames works but does not recognize all the special variants in nicknames<br>example :  [L|I|T|0]   [-Nick-]   {N}ick  [-Nick-] <br><div class="codebox"><p>Code: </p><pre><code>bind PUB o !op procnameproc procname {nick uhost hand chan text} {  set target [string trim $text]  if {[regexp -- {^[\x41-\x7D][-\d\x41-\x7D]*$} $target]} {  if {$target == ""} {  putserv "mode $chan +o $target"  } else {  putserv "PRIVMSG $chan :$nick It's not in $chan"  }} }</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8327">Arnold_X-P</a> — Sat Feb 10, 2018 9:06 pm</p><hr />
]]></content>
	</entry>
	</feed>
