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

	<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>2003-06-22T19:24:57-04:00</updated>

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

		<entry>
		<author><name><![CDATA[BiLL]]></name></author>
		<updated>2003-06-22T19:24:57-04:00</updated>

		<published>2003-06-22T19:24:57-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=22417#p22417</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=22417#p22417"/>
		<title type="html"><![CDATA[Enforcing Input]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=22417#p22417"><![CDATA[
Exactly what I needed, BIG THANKS. You really helped me alot!!!!!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=50">BiLL</a> — Sun Jun 22, 2003 7:24 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2003-06-22T19:20:07-04:00</updated>

		<published>2003-06-22T19:20:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=22416#p22416</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=22416#p22416"/>
		<title type="html"><![CDATA[Regular Expressions]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=22416#p22416"><![CDATA[
Hi,<br>You would enforce inputs using regular expressions. First, heres the simple tcl i used to test it, just so u know how to implement it.<br><br>bind pub - !input pubinput<br>proc pubinput {nick host hand chan arg} {<br>  if {&lt;&lt;&lt;INSERT REGEXP FUNCTION&gt;&gt;&gt;} {<br>    set var [lindex $arg 0]<br>    putserv "PRIVMSG $chan :true, $var"<br>  } else {<br>    putserv "PRIVMSG $chan :false"<br>  }<br>}<br><br>Ok, i wasnt quite sure if u wanted the 1.1x one to match a single digit, or to allow multiple, so i did both:<br>[regexp "^(\[0-9\])+.(\[0-9\])+x" [lindex $arg 0]]<br>This would match &lt;anynumber&gt;.&lt;anynumber&gt;x<br>e.g. 100.100x<br><br>[regexp "^\[0-9\].\[0-9\]x" [lindex $arg 0]]<br>This would match &lt;singlenumber&gt;.&lt;singlenumber&gt;x<br>e.g. 1.1x<br><br><br>And this is for your second example:<br>[regexp "^(\[0-9\])+DeCS" [lindex $arg 0]]<br>This would match &lt;anynumber&gt;DeCS<br>e.g. 100DeCS<br><br>For more information on regular expressions, check out:<br><a href="http://www.tcl.tk/man/tcl8.3/TclCmd/re_syntax.htm" class="postlink">http://www.tcl.tk/man/tcl8.3/TclCmd/re_syntax.htm</a><br>Remeber though, the slashes (\) arent part of the regular expression, they simply stop the tcl from trying to evaluate the stuff inside the square brackets ([ and ]).<br><br>Regards,<br>Paul<p>Statistics: Posted by Guest — Sun Jun 22, 2003 7:20 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[BiLL]]></name></author>
		<updated>2003-06-22T16:19:38-04:00</updated>

		<published>2003-06-22T16:19:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=22408#p22408</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=22408#p22408"/>
		<title type="html"><![CDATA[Enforcing Input]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=22408#p22408"><![CDATA[
Hi,<br><br>I am searching for a special code to enforce users to a determined input style. But I don't know how do it in a good way.<br>I will explain it in a short way + example:<br><br>I have a variable $var. And I have a !input bind which sets that $var.<br><br>Example: !input test1 (sets $var = test1)<br>Example: !input blabla (sets $var = blabla)<br><br>But now I want to enforce the user to input a var like:<br>0.0x<br>0.5x<br>1.0x<br>1.5x<br>etc.<br>-&gt; number.numberx &lt;- Main Code<br><br>How can I check that Input now in a good technical way?<br>Please help!<br><br>Another help needed:<br><br>I got Input and $var again.<br>But now I want to enforce the user to an input like:<br>10DeCS<br>15DeCS<br>20DeCS<br>100DeCS<br>1000DeCS<br>etc.<br>-&gt; numberDeCS &lt;- Main Code<br><br>can anyone help me please?<br><br>Big thanks.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=50">BiLL</a> — Sun Jun 22, 2003 4:19 pm</p><hr />
]]></content>
	</entry>
	</feed>
