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

	<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>2015-04-16T22:31:05-04:00</updated>

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

		<entry>
		<author><name><![CDATA[juanamores]]></name></author>
		<updated>2015-04-16T22:31:05-04:00</updated>

		<published>2015-04-16T22:31:05-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103845#p103845</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103845#p103845"/>
		<title type="html"><![CDATA[one problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103845#p103845"><![CDATA[
I found a line of code that does not return the expected value.<br>The line that measures the 'uptime' is wrong, because it measures the BoT 'uptime', not nick.<br> That line was added by me, thinking that measured the 'uptime' of nick, but I was wrong and measures the 'uptime' of Bot. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_confused.gif" width="15" height="15" alt=":?" title="Confused"> <br>Do not know how to fix it so that it measures the 'uptime' of nick. <br>In this process, line 3 is wrong <span style="color:red">[duration [expr [unixtime] - $ :: uptime]]</span><div class="codebox"><p>Code: </p><pre><code>proc whois::317 {from key text} {  if {[regexp -- {.*\s(\d+)\s(\d+)\s\:} $text wholematch idle signon]} {  set signonsp [duration [expr [unixtime] - $::uptime]]   set signonsp [string map [list "year" "años" "years" "años" "month" "mes" "months" "meses" "week" "semana" "weeks" "semanas" "day" "día" "days" "días" "hour" "hora" "hours" "horas" "minute" "minuto" "minutes" "minutos" "second" "segundo" "seconds" "segundos"] $signonsp]   set idlesp [duration $idle]  set idlesp [string map [list "year" "años" "years" "años" "month" "mes" "months" "meses" "week" "semana" "weeks" "semanas" "day" "día" "days" "días" "hour" "hora" "hours" "horas" "minute" "minuto" "minutes" "minutos" "second" "segundo" "seconds" "segundos"] $idlesp]  putserv "PRIVMSG $whois::channel :${whois::logo} ${whois::tagf}Conectado :${whois::textf} \        $signonsp ${whois::tagf}Inactivo:${whois::textf} $idlesp"  }}</code></pre></div>How could fix that line to measure the uptime of nick and not the uptime of BoT?<br><br> Full code adapted to my network and translated into Spanish:<div class="codebox"><p>Code: </p><pre><code>################################################################################################  ##     whois.tcl for eggdrop by Ford_Lawnmower irc.geekshed.net #Script-Help        ##  ################################################################################################## To use this script you must set channel flag +whois (ie .chanset #chan +whois)           ##################################################################################################      ____                __                 ###########################################  ####     / __/___ _ ___ _ ___/ /____ ___   ___   ###########################################  ####    / _/ / _ `// _ `// _  // __// _ \ / _ \  ###########################################  ####   /___/ \_, / \_, / \_,_//_/   \___// .__/  ###########################################  ####        /___/ /___/                 /_/      ###########################################  ####                                             ###########################################  ##################################################################################################  ##                             Start Setup.                                         ##  ################################################################################################namespace eval whois {## change cmdchar to the trigger you want to use                                        ##  ##  variable cmdchar "!"## change command to the word trigger you would like to use.                            ##  #### Keep in mind, This will also change the .chanset +/-command                          ##  ##  variable command "whois"## change textf to the colors you want for the text.                                    ##  ##  variable textf "\017\00302"## change tagf to the colors you want for tags:                                         ##  ##  variable tagf "\017\002"## Change logo to the logo you want at the start of the line.                           ##  ##  variable logo "\017\00304\002\[\00306W\003hois\00304\]\017"## Change lineout to the results you want. Valid results are channel users modes topic  ##  ##  variable lineout "channel users modes topic"################################################################################################  ##                           End Setup.                                              ## ################################################################################################  variable channel ""  setudef flag $whois::command  bind pub -|- [string trimleft $whois::cmdchar]${whois::command} whois::lst  bind raw -|- "311" whois::311  bind raw -|- "312" whois::312  bind raw -|- "319" whois::319  bind raw -|- "317" whois::317  bind raw -|- "313" whois::multi  bind raw -|- "310" whois::multi  bind raw -|- "335" whois::multi  bind raw -|- "301" whois::301  bind raw -|- "671" whois::multi  bind raw -|- "320" whois::multi  bind raw -|- "401" whois::multi  bind raw -|- "318" whois::318  bind raw -|- "307" whois::307}proc whois::311 {from key text} {  if {[regexp -- {^[^\s]+\s(.+?)\s(.+?)\s(.+?)\s\*\s\:(.+)$} $text wholematch nick ident host realname]} {    putserv "PRIVMSG $whois::channel :${whois::logo} ${whois::tagf}Nick e IP virtual:${whois::textf} \        $nick \(${ident}@${host}\)"putserv "PRIVMSG $whois::channel :${whois::logo} ${whois::tagf}Nombre:${whois::textf} $realname"  }}proc whois::multi {from key text} {  if {[regexp {\:(.*)$} $text match $key]} {  set keys [subst $$key]  set keys [lrange $keys 4 8]  if {"$keys" == "Nick no presente en IRC"} { set keys [encoding convertfrom utf-8 "El nick que buscas, no está conectado al IRC."];       putserv "PRIVMSG $whois::channel :${whois::logo} ${whois::tagf}Info:${whois::textf} $keys";         return 1  }   }}proc whois::312 {from key text} {  regexp {([^\s]+)\s\:} $text match server  putserv "PRIVMSG $whois::channel :${whois::logo} ${whois::tagf}Servidor:${whois::textf} $server"}proc whois::319 {from key text} {  if {[regexp {.+\:(.+)$} $text match channels]} {    putserv "PRIVMSG $whois::channel :${whois::logo} ${whois::tagf}Canales:${whois::textf} $channels"  }}proc whois::317 {from key text} {  if {[regexp -- {.*\s(\d+)\s(\d+)\s\:} $text wholematch idle signon]} {  set signonsp [duration [expr [unixtime] - $::uptime]]   set signonsp [string map [list "year" "años" "years" "años" "month" "mes" "months" "meses" "week" "semana" "weeks" "semanas" "day" "día" "days" "días" "hour" "hora" "hours" "horas" "minute" "minuto" "minutes" "minutos" "second" "segundo" "seconds" "segundos"] $signonsp]   set idlesp [duration $idle]  set idlesp [string map [list "year" "años" "years" "años" "month" "mes" "months" "meses" "week" "semana" "weeks" "semanas" "day" "día" "days" "días" "hour" "hora" "hours" "horas" "minute" "minuto" "minutes" "minutos" "second" "segundo" "seconds" "segundos"] $idlesp]  putserv "PRIVMSG $whois::channel :${whois::logo} ${whois::tagf}Conectado :${whois::textf} \        $signonsp ${whois::tagf}Inactivo:${whois::textf} $idlesp"  }}proc whois::301 {from key text} {  if {[regexp {^.+\s[^\s]+\s\:(.*)$} $text match awaymsg]} {    putserv "PRIVMSG $whois::channel :${whois::logo} ${whois::tagf}Away:${whois::textf} $awaymsg"  }}proc whois::318 {from key text} {  namespace eval whois {        variable channel ""  }  variable whois::channel ""}proc whois::307 {from key text} {  putserv "PRIVMSG $whois::channel :${whois::logo} ${whois::tagf}Estado:${whois::textf} Nick Registrado" }proc whois::lst {nick host hand chan text} {  if {[lsearch -exact [channel info $chan] "+${whois::command}"] != -1} {    namespace eval whois {          variable channel ""        }    variable whois::channel $chan##In the chathispano network the correct command is '/whois nick nick', if you put only '/whois nick' the network hidden  'uptime' and 'idle'  information of nick.##    putserv "WHOIS $text $text"  }}</code></pre></div><span style="text-decoration:underline">Pay attention if they are to test this code on a different network to chathispano</span>, you must modify the last process of code <em class="text-italics">proc whois::lst</em><br>Normal in all networks the whois command is used like this:<br>'/Whois nick'<br>In chathispano network the correct command is:<br>'/Whois nick nick'<br>If you put '/whois nick' the network hidden information of 'idle' and 'uptime'.<br>To test it on another network, you should modify this line:<div class="codebox"><p>Code: </p><pre><code>putserv "WHOIS $text $text"</code></pre></div>Change it to this:<div class="codebox"><p>Code: </p><pre><code>putserv "WHOIS $text"</code></pre></div><strong class="text-strong">EDIT reason: </strong>Fixed<br><br>This is the part of the code that fixed the error of  <em class="text-italics">uptime</em>.<div class="codebox"><p>Code: </p><pre><code>set target [lindex [split $text " "] 1]  set signtarg "$signon $target"  set signtarg [join [lindex [split $signtarg] 0]]    set signtarg [duration [expr [unixtime] - $signtarg]] </code></pre></div> I do not see much interest in this topic, I made more changes to the code to fit 100% to chathispano.<br>Who wishes to warn me.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12499">juanamores</a> — Thu Apr 16, 2015 10:31 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[juanamores]]></name></author>
		<updated>2015-04-16T17:15:56-04:00</updated>

		<published>2015-04-16T17:15:56-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103844#p103844</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103844#p103844"/>
		<title type="html"><![CDATA[Again the Whois ..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103844#p103844"><![CDATA[
<blockquote class="uncited"><div>Not sure if he can find it.    Could this be it?  :<br>proc whois::list</div></blockquote><strong class="text-strong">willyw</strong> you're right, the process that gave the error was <em class="text-italics">proc whois::list</em>.<br>I renamed this process and the error is solved, now I have no error.<br><br>But neither the words from English into Spanish of the list are replaced. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_confused.gif" width="15" height="15" alt=":?" title="Confused"><br><br>I tried this: <div class="codebox"><p>Code: </p><pre><code>proc whois::317 {from key text} {  if {[regexp -- {.*\s(\d+)\s(\d+)\s\:} $text wholematch idle signon]} {     set signon [string map [list "Mon" "Lun" "Tue" "Mar" "Wed" "Mie" "Thu" "Jue" "Fri" "Vie" "Sat" "Sab" "Sun" "Dom"] $signon] putserv "PRIVMSG $whois::channel :${whois::logo} ${whois::tagf}Conectado :${whois::textf} \        [ctime $signon] ${whois::tagf}Inactivo:${whois::textf} [duration $idle]"  }} </code></pre></div>and this (just in case), storing the value returned by the <span style="color:blue"><strong class="text-strong">string map</strong></span> .... in another variable <em class="text-italics">signone</em>:   <div class="codebox"><p>Code: </p><pre><code>proc whois::317 {from key text} {  if {[regexp -- {.*\s(\d+)\s(\d+)\s\:} $text wholematch idle signon]} {     set signone [string map [list "Mon" "Lun" "Tue" "Mar" "Wed" "Mie" "Thu" "Jue" "Fri" "Vie" "Sat" "Sab" "Sun" "Dom"] $signon] putserv "PRIVMSG $whois::channel :${whois::logo} ${whois::tagf}Conectado :${whois::textf} \        [ctime $signone] ${whois::tagf}Inactivo:${whois::textf} [duration $idle]"  }} </code></pre></div> I also tried storing the value in ctime vers. one:<blockquote class="uncited"><div>proc whois::317 {from key text} {<br>  if {[regexp -- {.*\s(\d+)\s(\d+)\s\:} $text wholematch idle signon]} {<br>     set <span style="color:blue">ctime</span> [string map [list "Mon" "Lun" "Tue" "Mar" "Wed" "Mie" "Thu" "Jue" "Fri" "Vie" "Sat" "Sab" "Sun" "Dom"] <span style="color:blue">ctime</span>]<br> putserv "PRIVMSG $whois::channel :${whois::logo} ${whois::tagf}Conectado :${whois::textf} \<br>        [<span style="color:blue">$ctime</span> $signon] ${whois::tagf}Inactivo:${whois::textf} [duration $idle]"<br>  }<br>} </div></blockquote>I also tried storing the value in ctime vers. two:<blockquote class="uncited"><div>proc whois::317 {from key text} {<br>  if {[regexp -- {.*\s(\d+)\s(\d+)\s\:} $text wholematch idle signon]} {<br>     set <span style="color:red">ctime</span> [string map [list "Mon" "Lun" "Tue" "Mar" "Wed" "Mie" "Thu" "Jue" "Fri" "Vie" "Sat" "Sab" "Sun" "Dom"] <span style="color:red">$ctime</span>]<br> putserv "PRIVMSG $whois::channel :${whois::logo} ${whois::tagf}Conectado :${whois::textf} \<br>        [<span style="color:red">ctime</span> $signon] ${whois::tagf}Inactivo:${whois::textf} [duration $idle]"<br>  }<br>} </div></blockquote>I also tried storing the value in ctime vers. three:<blockquote class="uncited"><div>proc whois::317 {from key text} {<br>  if {[regexp -- {.*\s(\d+)\s(\d+)\s\:} $text wholematch idle signon]} {<br>     set <span style="color:green">ctime</span> [string map [list "Mon" "Lun" "Tue" "Mar" "Wed" "Mie" "Thu" "Jue" "Fri" "Vie" "Sat" "Sab" "Sun" "Dom"] <span style="color:green">$ctime</span>]<br> putserv "PRIVMSG $whois::channel :${whois::logo} ${whois::tagf}Conectado :${whois::textf} \<br>        [<span style="color:green">$ctime</span> $signon] ${whois::tagf}Inactivo:${whois::textf} [duration $idle]"<br>  }<br>} </div></blockquote>Result:<blockquote class="uncited"><div>17:40 :     @oper¦ !whois roger<br>......................etc..........................<br>17:40 ?         @Mybot ¦ [Whois] Conectado: Thu Apr 16 17:26:31 2015 Inactivo:  45 seconds</div></blockquote>Conclusion:<br><br> If the code word substitution is correct, ¿could it be that the "Thu Apr 16" value is stored in <span style="color:blue">[ctime</span> <span style="color:olive">$signon</span><span style="color:blue">]</span>?<br><br>My theory is that maybe the value "Thu Apr 16", is neither in <em class="text-italics">ctime</em> or <em class="text-italics">$signon</em> watching them in isolation.<br><br>Can that be possible?<br><strong class="text-strong">Final Edit:debuggin code</strong><div class="codebox"><p>Code: </p><pre><code>proc whois::317 {from key text} {  if {[regexp -- {.*\s(\d+)\s(\d+)\s\:} $text wholematch idle signon]} {     set signon [string map [list "Mon" "Lun" "Tue" "Mar" "Wed" "Mie" "Thu" "Jue" "Fri" "Vie" "Sat" "Sab" "Sun" "Dom"] $signon] #start debuggin mode putserv "PRIVMSG $whois::channel :signon value: $signon" putserv "PRIVMSG $whois::channel :ctime value: [ctime]" #end debuggin mode putserv "PRIVMSG $whois::channel :${whois::logo} ${whois::tagf}Conectado :${whois::textf} \        [ctime $signon] ${whois::tagf}Inactivo:${whois::textf} [duration $idle]"  }} </code></pre></div>Result:<blockquote class="uncited"><div>17:40 :     @oper¦ !whois roger<br>......................etc..........................<br>17:40 ?         @Mybot ¦ signon value: 1429217580</div></blockquote><strong class="text-strong">Tcl error [whois::317]: wrong # args: should be "ctime unixtime"</strong><br><br> My conclusion was correct right?<br><br><strong class="text-strong">New Final Edit:</strong> Check <div class="codebox"><p>Code: </p><pre><code>proc whois::317 {from key text} {  if {[regexp -- {.*\s(\d+)\s(\d+)\s\:} $text wholematch idle signon]} {     set debug [ctime $signon] set debug [string map [list "Mon" "Lun" "Tue" "Mar" "Wed" "Mie" "Thu" "Jue" "Fri" "Vie" "Sat" "Sab" "Sun" "Dom"] $debug] putserv "PRIVMSG $whois::channel :${whois::logo} ${whois::tagf}Conectado :${whois::textf} \        $debug ${whois::tagf}Inactivo:${whois::textf} [duration $idle]"  }} </code></pre></div>Result:<blockquote class="uncited"><div>17:40 :     @oper¦ !whois roger<br>......................etc..........................<br>17:40 ?         @Mybot ¦ [Whois] Conectado : Jue Apr 16 17:53:00 2015 Inactivo: 3 minutes 39 seconds</div></blockquote> <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz">  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz">  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12499">juanamores</a> — Thu Apr 16, 2015 5:15 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2015-04-16T15:26:54-04:00</updated>

		<published>2015-04-16T15:26:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103843#p103843</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103843#p103843"/>
		<title type="html"><![CDATA[Again the Whois ..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103843#p103843"><![CDATA[
The whole thing is - yes.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10420">willyw</a> — Thu Apr 16, 2015 3:26 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2015-04-16T14:52:31-04:00</updated>

		<published>2015-04-16T14:52:31-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103842#p103842</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103842#p103842"/>
		<title type="html"><![CDATA[Again the Whois ..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103842#p103842"><![CDATA[
In that case this piece of code he has would have to be in the same namespace in order to get that error, no?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Thu Apr 16, 2015 2:52 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2015-04-16T13:24:50-04:00</updated>

		<published>2015-04-16T13:24:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103841#p103841</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103841#p103841"/>
		<title type="html"><![CDATA[Again the Whois ..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103841#p103841"><![CDATA[
<blockquote class="uncited"><div><br>...<br>Look in your loaded scripts for "proc list" and unless you rename it something else the problem will persist.<br>...</div></blockquote>Not sure if he can find it.    Could this be it?  :<br>proc whois::list<br><br>found in one of his posts in this thread, above?<br><br>Looks like whoever wrote the script is using namespace.   I suspect this might make it more difficult for him to spot.<br><br>Just wanted to pass this along.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10420">willyw</a> — Thu Apr 16, 2015 1:24 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2015-04-16T12:44:31-04:00</updated>

		<published>2015-04-16T12:44:31-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103840#p103840</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103840#p103840"/>
		<title type="html"><![CDATA[Again the Whois ..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103840#p103840"><![CDATA[
The problem is not in this code, but in the fact that you have a function (proc) called <em class="text-italics">list</em> and that's interfering with the proper conduct of this code and any other code that would use the TCL's list function.<br><br>Look in your loaded scripts for "proc list" and unless you rename it something else the problem will persist.<br><br>If you or the person that made that particular script to have a function called <em class="text-italics">list</em> then should at least consider getting that code into a namespace so won't interfere with normal TCL functions.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Thu Apr 16, 2015 12:44 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[juanamores]]></name></author>
		<updated>2015-04-16T12:21:29-04:00</updated>

		<published>2015-04-16T12:21:29-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103839#p103839</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103839#p103839"/>
		<title type="html"><![CDATA[Again the Whois ..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103839#p103839"><![CDATA[
<blockquote class="uncited"><div>I meant to find where you got a <em class="text-italics">proc list</em> not replace in the line I said.  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=":wink:" title="Wink"></div></blockquote>I wish to use your idea instead of using <em class="text-italics">regsub</em>, but not how to do it without me error.<div class="codebox"><p>Code: </p><pre><code>proc whois::317 {from key text} {set signon [string map [list "Mon" "Lun" "Tue" "Mar" "Wed" "Mie" "Thur" "Jue" "Fri" "Vie" "Sat" "Sab" "Sun" "Dom"] $signon]  if {[regexp -- {.*\s(\d+)\s(\d+)\s\:} $text wholematch idle signon]} {     putserv "PRIVMSG $whois::channel :${whois::logo} ${whois::tagf}Conectado :${whois::textf} \        [ctime $signon] ${whois::tagf}Inactivo:${whois::textf} [duration $idle]"  }} </code></pre></div>How would you do this code so that no error?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12499">juanamores</a> — Thu Apr 16, 2015 12:21 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[juanamores]]></name></author>
		<updated>2015-04-16T12:11:03-04:00</updated>

		<published>2015-04-16T12:11:03-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103838#p103838</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103838#p103838"/>
		<title type="html"><![CDATA[Again the Whois ..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103838#p103838"><![CDATA[
<blockquote class="uncited"><div>greetings, do you have the final tcl for the final result ? it looks nice with the added connect time and idle time and the colored parts makes it more clear<br><br>nicely done</div></blockquote> This is the page of the original TCL: <a href="http://codemirror.net/mode/tcl/" class="postlink">here</a><br><br>If you want to do as I did, to replace <em class="text-italics">signon</em> by <em class="text-italics">uptime</em>.<br>You must modify<em class="text-italics"> proc whois::317</em> like this:<div class="codebox"><p>Code: </p><pre><code>proc whois::317 {from key text} {set upt [duration [expr [unixtime] - $::uptime]]   if {[regexp -- {.*\s(\d+)\s(\d+)\s\:} $text wholematch idle signon]} {    putserv "PRIVMSG $whois::channel :${whois::logo} ${whois::tagf}Connected:${whois::textf} \       $upt ${whois::tagf}Idle:${whois::textf} [duration $idle]"  }}</code></pre></div>If you want to translate the 'uptime' and 'idle' to Spanish, see my previous post.<br>Regarding the colors, you should set them in "Start Setup" the TCL.<br>Logo colors are set by default in the TCL on line:<div class="codebox"><p>Code: </p><pre><code>## Change logo to the logo you want at the start of the line. ##  ##  variable logo "\017\00304\002\[\00306W\003hois\00304\]\017" </code></pre></div>If you want to change the color of text in the results, you can set them in this line:<div class="codebox"><p>Code: </p><pre><code>## change textf to the colors you want for the text. ##  ##  variable textf "\017\00304" </code></pre></div>This text color is seted by red, I changed it by blue: <div class="codebox"><p>Code: </p><pre><code> variable textf "\017\00302" </code></pre></div>Any other question I am at your service <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12499">juanamores</a> — Thu Apr 16, 2015 12:11 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2015-04-16T00:40:39-04:00</updated>

		<published>2015-04-16T00:40:39-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103828#p103828</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103828#p103828"/>
		<title type="html"><![CDATA[Again the Whois ..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103828#p103828"><![CDATA[
I meant to find where you got a <em class="text-italics">proc list</em> not replace in the line I said.  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=":wink:" title="Wink"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Thu Apr 16, 2015 12:40 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2015-04-15T19:27:09-04:00</updated>

		<published>2015-04-15T19:27:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103827#p103827</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103827#p103827"/>
		<title type="html"><![CDATA[Again the Whois ..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103827#p103827"><![CDATA[
greetings, do you have the final tcl for the final result ? it looks nice with the added connect time and idle time and the colored parts makes it more clear<br><br>nicely done<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Wed Apr 15, 2015 7:27 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[juanamores]]></name></author>
		<updated>2015-04-15T14:49:06-04:00</updated>

		<published>2015-04-15T14:49:06-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103825#p103825</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103825#p103825"/>
		<title type="html"><![CDATA[Again the Whois ..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103825#p103825"><![CDATA[
<blockquote class="uncited"><div>You get that error cos you seem to have a function named <em class="text-italics">list</em>. Find it and replace it with something else.</div></blockquote>I replaced a function named <em class="text-italics">list</em> for "dias".<blockquote class="uncited"><div>set signon [string map [dias "Mon" "Lun" "Tue" "Mar" "Wed" "Mie" "Thur" "Jue" "Fri" "Vie" "Sat" "Sab" "Sun" "Dom"] $signon] </div></blockquote> I do what you've recommended but still gives me another error.<br><strong class="text-strong">Tcl error [whois::317]: invalid command name "dias"</strong><br><br>Being the word in bracket [ dias] is interpreted as a command.<br><br><strong class="text-strong">Edit</strong>: I changed my original idea<br> As I see it is very difficult to translate into Spanish the signon variable, I replaced my original idea, using uptime.<br><br>In this code I could translate uptime to Spanish:<div class="codebox"><p>Code: </p><pre><code>proc whois::317 {from key text} {set upesp [duration [expr [unixtime] - $::uptime]]regsub -all "year" $upesp "año" upespregsub -all "years" $upesp "años" upespregsub -all "month" $upesp "mes" upespregsub -all "months" $upesp "meses" upespregsub -all "week" $upesp "semana" upespregsub -all "weeks" $upesp "semanas" upespregsub -all "day" $upesp "día" upespregsub -all "days" $upesp "días" upespregsub -all "hour" $upesp "hora" upespregsub -all "hours" $upesp "horas" upespregsub -all "minute" $upesp "minuto" upespregsub -all "minutes" $upesp "minutos" upespregsub -all "second" $upesp "segundo" upespregsub -all "seconds" $upesp "segundos" upesp  if {[regexp -- {.*\s(\d+)\s(\d+)\s\:} $text wholematch idle]} {     set idlesp [duration $idle]regsub -all "year" $idlesp "año" idlespregsub -all "years" $idlesp "años" idlespregsub -all "month" $idlesp "mes" idlespregsub -all "months" $idlesp "meses" idlespregsub -all "week" $idlesp "semana" idlespregsub -all "weeks" $idlesp "semanas" idlespregsub -all "day" $idlesp "día" idlespregsub -all "days" $idlesp "días" idlespregsub -all "hour" $idlesp "hora" idlespregsub -all "hours" $idlesp "horas" idlespregsub -all "minute" $idlesp "minuto" idlespregsub -all "minutes" $idlesp "minutos" idlespregsub -all "second" $idlesp "segundo" idlespregsub -all "seconds" $idlesp "segundos" idlesp putserv "PRIVMSG $whois::channel :${whois::logo} ${whois::tagf}Conectado :${whois::textf} \        $upesp ${whois::tagf}Inactivo:${whois::textf} $idlesp"  }}</code></pre></div>Result:<blockquote class="uncited"><div>16:49 :     @oper¦ !whois roger<br>16:49 ?         @Mybot ¦ <strong class="text-strong"><span style="color:red">[</span><span style="color:violet">W</span>hois<span style="color:red">]</span> Host:</strong> <span style="color:blue">roger (<a href="mailto:roger@roger.oper">roger@roger.oper</a>)</span> Realname:<span style="color:blue"> roger</span><br>16:49 ?         @Mybot ¦ <strong class="text-strong"><span style="color:red">[</span><span style="color:violet">W</span>hois<span style="color:red">]</span> Canales:</strong> <span style="color:blue">@#channel1 @#channel2 </span><br>16:49 ?         @Mybot ¦ <strong class="text-strong"><span style="color:red">[</span><span style="color:violet">W</span>hois<span style="color:red">]</span> Servidor:</strong> <span style="color:blue">myserver.com</span><br>16:49 ?         @Mybot ¦ <strong class="text-strong"><span style="color:red">[</span><span style="color:violet">W</span>hois<span style="color:red">]</span> Services:</strong> <span style="color:blue">Nick Registrado</span><br>16:49 ?         @Mybot ¦ <strong class="text-strong"><span style="color:red">[</span><span style="color:violet">W</span>hois<span style="color:red">]</span> Conectado:</strong> <span style="color:blue">1 hora 15 minutos 25 segundos</span> <strong class="text-strong">Inactivo:</strong> <span style="color:blue">4 minutos 43 segundos</span></div></blockquote>New Edit:  Traslate idle and set colors <em class="text-italics">textf </em>of above original code<br><br><strong class="text-strong">Final Edit</strong>:  Days and Months in Spanish<br>With <strong class="text-strong"><span style="color:blue">regsub</span></strong> also got what I wanted in my original idea. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"><div class="codebox"><p>Code: </p><pre><code>proc whois::317 {from key text} {  if {[regexp -- {.*\s(\d+)\s(\d+)\s\:} $text wholematch idle signon]} {  set signonsp [ctime $signon]regsub -all "Mon" $signonsp "Lun" signonspregsub -all "Tue" $signonsp "Mar" signonspregsub -all "Wed" $signonsp "Mie" signonspregsub -all "Thur" $signonsp "Jue" signonspregsub -all "Fri" $signonsp "Vie" signonspregsub -all "Sat" $signonsp "Sab" signonspregsub -all "Sun" $signonsp "Dom" signonspregsub -all "Jan" $signonsp "Ene" signonspregsub -all "Apr" $signonsp "Abr" signonspregsub -all "Aug" $signonsp "Ago" signonspregsub -all "Dec" $signonsp "Dic" signonsp     set idlesp [duration $idle]regsub -all "year" $idlesp "año" idlespregsub -all "years" $idlesp "años" idlespregsub -all "month" $idlesp "mes" idlespregsub -all "months" $idlesp "meses" idlespregsub -all "week" $idlesp "semana" idlespregsub -all "weeks" $idlesp "semanas" idlespregsub -all "day" $idlesp "día" idlespregsub -all "days" $idlesp "días" idlespregsub -all "hour" $idlesp "hora" idlespregsub -all "hours" $idlesp "horas" idlespregsub -all "minute" $idlesp "minuto" idlespregsub -all "minutes" $idlesp "minutos" idlespregsub -all "second" $idlesp "segundo" idlespregsub -all "seconds" $idlesp "segundos" idlesp putserv "PRIVMSG $whois::channel :${whois::logo} ${whois::tagf}Conectado :${whois::textf} \        $signonsp ${whois::tagf}Inactivo:${whois::textf} $idlesp"  }}</code></pre></div>Result:<blockquote class="uncited"><div>16:49 :     @oper¦ !whois roger<br>16:49 ?         @Mybot ¦ <strong class="text-strong"><span style="color:red">[</span><span style="color:violet">W</span>hois<span style="color:red">]</span> Host:</strong> <span style="color:blue">roger (<a href="mailto:roger@roger.oper">roger@roger.oper</a>)</span> Realname:<span style="color:blue"> roger</span><br>16:49 ?         @Mybot ¦ <strong class="text-strong"><span style="color:red">[</span><span style="color:violet">W</span>hois<span style="color:red">]</span> Canales:</strong> <span style="color:blue">@#channel1 @#channel2 </span><br>16:49 ?         @Mybot ¦ <strong class="text-strong"><span style="color:red">[</span><span style="color:violet">W</span>hois<span style="color:red">]</span> Servidor:</strong> <span style="color:blue">myserver.com</span><br>16:49 ?         @Mybot ¦ <strong class="text-strong"><span style="color:red">[</span><span style="color:violet">W</span>hois<span style="color:red">]</span> Services:</strong> <span style="color:blue">Nick Registrado</span><br>16:49 ?         @Mybot ¦ <strong class="text-strong"><span style="color:red">[</span><span style="color:violet">W</span>hois<span style="color:red">]</span> Conectado:</strong> <span style="color:blue">Mie Abr 15 15:34:16 2015</span> <strong class="text-strong">Inactivo:</strong> <span style="color:blue">2 minutos 31 segundos</span></div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12499">juanamores</a> — Wed Apr 15, 2015 2:49 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2015-04-15T02:41:23-04:00</updated>

		<published>2015-04-15T02:41:23-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103823#p103823</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103823#p103823"/>
		<title type="html"><![CDATA[Again the Whois ..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103823#p103823"><![CDATA[
You get that error cos you seem to have a function named <em class="text-italics">list</em>. Find it and replace it with something else.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Wed Apr 15, 2015 2:41 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[juanamores]]></name></author>
		<updated>2015-04-14T22:25:03-04:00</updated>

		<published>2015-04-14T22:25:03-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103820#p103820</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103820#p103820"/>
		<title type="html"><![CDATA[Again the Whois ..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103820#p103820"><![CDATA[
<span style="text-decoration:underline">I tried the first</span>:  <div class="codebox"><p>Code: </p><pre><code>proc whois::317 {from key text} {set signon [string map [list "Mon" "Lun" "Tue" "Mar" "Wed" "Mie" "Thur" "Jue" "Fri" "Vie" "Sat" "Sab" "Sun" "Dom"] $signon]   if {[regexp -- {.*\s(\d+)\s(\d+)\s\:} $text wholematch idle signon]} {     putserv "PRIVMSG $whois::channel :${whois::logo} ${whois::tagf}Conectado :${whois::textf} \        [ctime $signon] ${whois::tagf}Inactivo:${whois::textf} [duration $idle]"  }} </code></pre></div><span style="text-decoration:underline">And the second:</span><div class="codebox"><p>Code: </p><pre><code>proc whois::317 {from key text} {set es [list "Dom" "Lun" "Mar" "Mie" "Jue" "Vie" "Sab"]set en [list "Sun" "Mon" "Tue" "Wed" "Thur" "Fri" "Sat"]foreach a $en b $es { lappend map "$a $b" }set signon [string map $map $signon]   if {[regexp -- {.*\s(\d+)\s(\d+)\s\:} $text wholematch idle signon]} {     putserv "PRIVMSG $whois::channel :${whois::logo} ${whois::tagf}Conectado :${whois::textf} \        [ctime $signon] ${whois::tagf}Inactivo:${whois::textf} [duration $idle]"  }}</code></pre></div>I tried testing both codes but I get the following error:<br><strong class="text-strong">Tcl error [whois::317]: wrong # args: should be "list nick host hand chan text"</strong><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12499">juanamores</a> — Tue Apr 14, 2015 10:25 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[juanamores]]></name></author>
		<updated>2015-04-14T14:32:25-04:00</updated>

		<published>2015-04-14T14:32:25-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103818#p103818</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103818#p103818"/>
		<title type="html"><![CDATA[Again the Whois ..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103818#p103818"><![CDATA[
Very grateful <strong class="text-strong">caesar</strong>  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"><br><br>Precisely the code was giving me errors in that part and was trying to fix.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12499">juanamores</a> — Tue Apr 14, 2015 2:32 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2015-04-14T01:57:10-04:00</updated>

		<published>2015-04-14T01:57:10-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103810#p103810</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103810#p103810"/>
		<title type="html"><![CDATA[Again the Whois ..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103810#p103810"><![CDATA[
All raw procs have useless regexp matches in them when the returned text will always match it, and 317 in particular doesn't have or uses some variables like ctime and A.<br><br>On top of that, if you want to change the content of a string with something different then should use <em class="text-italics">string map</em> instead of multiple <em class="text-italics">regsub -all</em> lines.<br><br>For example, instead of:<div class="codebox"><p>Code: </p><pre><code>regsub -all "Mon" ctime "Lun" ctimeregsub -all "Tue" ctime "Mar" ctimeregsub -all "Wed" $signon "Mie" signonregsub -all "Thur" $signon "Jue" signonregsub -all "Fri" $signon "Vie" signonregsub -all "Sat" $signon "Sab" signonregsub -all "Sun" $signon "Dom" signon</code></pre></div>could go nicely with just:<div class="codebox"><p>Code: </p><pre><code>set signon [string map [list "Mon" "Lun" "Tue" "Mar" "Wed" "Mie" "Thur" "Jue" "Fri" "Vie" "Sat" "Sab" "Sun" "Dom"] $signon]</code></pre></div>Where for example "Mon" will be replaced with "Lun" in the $signon variable.<br><br>Or if it's too confusing on what and where to change, and instead want to have them in two variables to be easier then:<div class="codebox"><p>Code: </p><pre><code>set es [list "Dom" "Lun" "Mar" "Mie" "Jue" "Vie" "Sab"]set en [list "Sun" "Mon" "Tue" "Wed" "Thur" "Fri" "Sat"]foreach a $en b $es { lappend map "$a $b" }set signon [string map $map $signon]</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Tue Apr 14, 2015 1:57 am</p><hr />
]]></content>
	</entry>
	</feed>
