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

	<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>2010-02-10T01:10:55-04:00</updated>

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

		<entry>
		<author><name><![CDATA[BhasIRC]]></name></author>
		<updated>2010-02-10T01:10:55-04:00</updated>

		<published>2010-02-10T01:10:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=92033#p92033</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=92033#p92033"/>
		<title type="html"><![CDATA[help please]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=92033#p92033"><![CDATA[
thanks<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11039">BhasIRC</a> — Wed Feb 10, 2010 1:10 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2010-02-08T15:04:08-04:00</updated>

		<published>2010-02-08T15:04:08-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=92018#p92018</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=92018#p92018"/>
		<title type="html"><![CDATA[help please]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=92018#p92018"><![CDATA[
I'd do it something like this:<br>Use <strong class="text-strong">scan</strong> to extract the date part from the "time registered" message recieved from chanserv, and then use <strong class="text-strong">clock scan</strong> to convert this into a "unixtime timestamp". The exact pattern to use with scan might wary, but atleast the following one should work with the example output from dalnet (using curly brackets to avoid command substitution):<br>{Time registered : %[a-zA-Z0-9/: ]}<br><br>Next, get the difference between "then" and "now" (<strong class="text-strong">clock seconds</strong>) by subtracting then from now. This gets you the number of seconds the nick has been registered. Now to convert this into something more read-friendly - use eggdrop's <strong class="text-strong">duration</strong> command and send the result to the desired channel...<br><br>All in all, something like this:<div class="codebox"><p>Code: </p><pre><code>...} elseif {[string match -nocase "*time registered*" $msg]} {            putserv "PRIVMSG $vNsinfoChannel :$msg"            putserv "PRIVMSG $vNsinfoChannel :Registered for [duration [expr [clock seconds] - [clock scan [lindex [scan $msg {Time registered : %[a-zA-Z0-9/: ]}] 0]]]]."} ...</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Mon Feb 08, 2010 3:04 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[BhasIRC]]></name></author>
		<updated>2010-02-08T08:13:23-04:00</updated>

		<published>2010-02-08T08:13:23-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=92017#p92017</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=92017#p92017"/>
		<title type="html"><![CDATA[help please]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=92017#p92017"><![CDATA[
hi ok i got this code out this forum now it works great just i need the script to also say how long the nick is registered eg. 3 months not jus the time reistered how do i do this , here is the code<div class="codebox"><p>Code: </p><pre><code># nsinfo.tcl set vNsinfoServices "nickserv@services.dal.net" set vNsinfoChannel #eggtcl bind PUB - !nsinfo pNsinfoSend bind NOTC - * pNsinfoReceive proc pNsinfoSend {nick uhost hand chan text} {     global vNsinfoChannel vNsinfoServices     if {[string equal -nocase $chan $vNsinfoChannel]} {         set target [string tolower [regsub -all -- {[\s]{2,}} [string trim $text] { }]]         if {[llength [split $target]] == 1} {             if {[regexp -- {^[\x41-\x7D][-\d\x41-\x7D]*$} $target]} {                 putserv "PRIVMSG $vNsinfoServices :INFO $target"             } else {putserv "PRIVMSG $vNsinfoChannel :$target is not a valid nick"}         } else {putserv "PRIVMSG $vNsinfoChannel :correct usage !nsinfo &lt;nick&gt;"}     }     return 0 } proc pNsinfoReceive {nick uhost hand text dest} {     global vNsinfoChannel vNsinfoServices     if {([isbotnick $dest]) &amp;&amp; ([string match -nocase ${nick}* $vNsinfoServices])} {         set msg [stripcodes bcruag [string trim $text]]         if {[string match -nocase "*info for*" $msg]} {             putserv "PRIVMSG $vNsinfoChannel :$msg"         } elseif {[string match -nocase "*currently on irc*" $msg]} {             putserv "PRIVMSG $vNsinfoChannel :$msg"         } elseif {[string match -nocase "*last seen address*" $msg]} {             putserv "PRIVMSG $vNsinfoChannel :$msg"         } elseif {[string match -nocase "*last seen time*" $msg]} {             putserv "PRIVMSG $vNsinfoChannel :$msg"         } elseif {[string match -nocase "*time registered*" $msg]} {             putserv "PRIVMSG $vNsinfoChannel :$msg"         } elseif {[string match -nocase "*time now*" $msg]} {             putserv "PRIVMSG $vNsinfoChannel :$msg"         } elseif {[string match -nocase "*options: *" $msg]} {             putserv "PRIVMSG $vNsinfoChannel :$msg"         } elseif {[string match -nocase "*end of info*" $msg]} {             putserv "PRIVMSG $vNsinfoChannel :$msg"         } elseif {[string match -nocase "*is not registered*" $msg]} {             putserv "PRIVMSG $vNsinfoChannel :$msg"         } elseif {[string match -nocase "*is frozen*" $msg]} {             putserv "PRIVMSG $vNsinfoChannel :$msg"         } elseif {[string match -nocase "*cannot be registered*" $msg]} {             putserv "PRIVMSG $vNsinfoChannel :$msg"         }     }     return 0 } putlog "nsinfo.tcl loaded" # eof </code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11039">BhasIRC</a> — Mon Feb 08, 2010 8:13 am</p><hr />
]]></content>
	</entry>
	</feed>
