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

	<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>2023-06-07T00:33:02-04:00</updated>

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

		<entry>
		<author><name><![CDATA[parakeet]]></name></author>
		<updated>2023-06-07T00:33:02-04:00</updated>

		<published>2023-06-07T00:33:02-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111989#p111989</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111989#p111989"/>
		<title type="html"><![CDATA[negative number not allowed in script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111989#p111989"><![CDATA[
Thank you caesar, I will test this tomorrow.  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=13006">parakeet</a> — Wed Jun 07, 2023 12:33 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2023-06-05T03:12:04-04:00</updated>

		<published>2023-06-05T03:12:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111987#p111987</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111987#p111987"/>
		<title type="html"><![CDATA[negative number not allowed in script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111987#p111987"><![CDATA[
Fixed typos above as I did a copy/paste and forgot to replace some variables.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Mon Jun 05, 2023 3:12 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[parakeet]]></name></author>
		<updated>2023-06-04T16:03:18-04:00</updated>

		<published>2023-06-04T16:03:18-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111986#p111986</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111986#p111986"/>
		<title type="html"><![CDATA[negative number not allowed in script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111986#p111986"><![CDATA[
Thank you caesar and CrazyCat.  So far caesar's code don't seem to work very well.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=13006">parakeet</a> — Sun Jun 04, 2023 4:03 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2023-06-04T16:00:42-04:00</updated>

		<published>2023-06-04T16:00:42-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111985#p111985</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111985#p111985"/>
		<title type="html"><![CDATA[negative number not allowed in script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111985#p111985"><![CDATA[
Small ad : you can try <a href="https://gitlab.com/tcl-scripts/tcl-utilities/-/blob/master/conversion.tcl" class="postlink">https://gitlab.com/tcl-scripts/tcl-util ... ersion.tcl</a> (need to get <a href="https://gitlab.com/tcl-scripts/tcl-utilities/-/blob/master/units.json" class="postlink">https://gitlab.com/tcl-scripts/tcl-util ... units.json</a>) which is a try to do an expansible conversion tool<br><br>(Official download: <a href="https://scripts.eggdrop.fr/details-Conversion-s258.html" class="postlink">https://scripts.eggdrop.fr/details-Conversion-s258.html</a>)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Sun Jun 04, 2023 4:00 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2023-06-05T03:14:04-04:00</updated>

		<published>2023-06-04T11:19:45-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111984#p111984</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111984#p111984"/>
		<title type="html"><![CDATA[negative number not allowed in script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111984#p111984"><![CDATA[
Here's two options: <em class="text-italics">scan</em> and <em class="text-italics">string is integer</em>.<div class="codebox"><p>Code: </p><pre><code>bind pub - [cmdchar]c2f pub_c2fproc pub_c2f {nick uhost hand chan rest} {set data [lindex $rest 0]if {![isnum $data]} {putserv "PRIVMSG $nick :Calling syntax is ${cmdchar_}c2f &lt;tempeture in celsius&gt;"                    return 1}set cdata [expr $data * 1.8 + 32]putserv "PRIVMSG $chan :$data degrees celsius is $cdata degrees farenheit."}</code></pre></div>becomes:<div class="codebox"><p>Code: </p><pre><code>bind pub - [cmdchar]c2f pub_c2fproc pub_c2f {nick uhost hand chan text} {if {[scan $text {%d} no] != 1} {puthelp "PRIVMSG $nick :Calling syntax is ${cmdchar_}c2f &lt;temperature in celsius&gt;"return}set temp [expr $no * 1.8 + 32]puthelp "PRIVMSG $chan :$no degrees Celsius is $temp degrees Farenheit."}</code></pre></div>or:<div class="codebox"><p>Code: </p><pre><code>bind pub - [cmdchar]c2f pub_c2fproc pub_c2f {nick uhost hand chan text} {set no [lindex [split $text] 0]if {![string is integer $no]} {puthelp "PRIVMSG $nick :Calling syntax is [cmdchar]c2f &lt;tempeture in celsius&gt;"return}set temp [expr $no * 1.8 + 32]puthelp "PRIVMSG $chan :$no degrees Celsius is $temp degrees Farenheit."}</code></pre></div>Adapt the rest of the code in a similar manner.<br><br>Edit: typo fix.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Sun Jun 04, 2023 11:19 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[parakeet]]></name></author>
		<updated>2023-06-04T06:27:23-04:00</updated>

		<published>2023-06-04T06:27:23-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111983#p111983</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111983#p111983"/>
		<title type="html"><![CDATA[negative number not allowed in script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111983#p111983"><![CDATA[
The script:  Conversion v1.00, date 20-05-2001 by DrN<br>Filename:  tempc100.tcl<br>Download URL: <a href="https://tclarchive.org/search.php?str=conversion" class="postlink">https://tclarchive.org/search.php?str=conversion</a><br><br>There are 3 binds:<br>!c2f<br>!f2c<br>!convert<br><br>It's a pretty nice script and I like it a lot but I had to fix all the formulas for the conversions as they gave incorrect results.<br><br>For conversions between Celsius and Fahrenheit with !c2f or !f2c, if I enter a negative number the script tells me that my input is incorrect. I know that the procedure 'isnum' checks for a number but it doesn't seem to account for negative numbers.  This is not a big deal since I can use: !convert -20 celsius * farenheit instead which does work because it doesn't use the proc isnum, but it's a bit annoying nonetheless.<br><br>Is there a way to modify the isnum procedure to allow for negative numbers without adding or modifying too much code?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=13006">parakeet</a> — Sun Jun 04, 2023 6:27 am</p><hr />
]]></content>
	</entry>
	</feed>
