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

	<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>2021-04-15T17:37:51-04:00</updated>

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

		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2021-04-15T17:37:51-04:00</updated>

		<published>2021-04-15T17:37:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109746#p109746</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109746#p109746"/>
		<title type="html"><![CDATA[Setting $chan when not a arg]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109746#p109746"><![CDATA[
Really interesting, I never tested this way to use ping (or probably other ctcp commands), it could help for some scripts.<br><br>Gonne read another time the rfc-1459 <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=691">CrazyCat</a> — Thu Apr 15, 2021 5:37 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ComputerTech]]></name></author>
		<updated>2021-04-15T14:42:38-04:00</updated>

		<published>2021-04-15T14:42:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109745#p109745</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109745#p109745"/>
		<title type="html"><![CDATA[Setting $chan when not a arg]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109745#p109745"><![CDATA[
Interesting DasBrain, thanks very much for that  <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=12849">ComputerTech</a> — Thu Apr 15, 2021 2:42 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[DasBrain]]></name></author>
		<updated>2021-04-15T15:07:24-04:00</updated>

		<published>2021-04-15T14:33:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109744#p109744</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109744#p109744"/>
		<title type="html"><![CDATA[Setting $chan when not a arg]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109744#p109744"><![CDATA[
There is an other way - as you can pass any data through the CTCP ping (the other side will return the data back to you), you can use this to keep track of who this PING belongs to.<br><br>In other words, if you send a "/CTCP &lt;somenick&gt; PING FOO", they will reply with "/CTCR &lt;yournick&gt; PING FOO".<br><div class="codebox"><p>Code: </p><pre><code>set pingspending [dict create]set pingcounter 0proc ct:pub:ping {nick host hand chan text} {   global pingpending pingcounter   incr pingcounter   set who [lindex [split $text] 0]   dict set pingpending $pingcounter nick $nick   dict set pingpending $pingcounter chan $chan   dict set pingpending $pingcounter who $who   dict set pingpending $pingcounter time [clock clicks -milliseconds]   putquick "PRIVMSG $pingwho :\001PING $pingcounter\001"}proc ct:pingr {nick uhost hand dest keyword text} {   global pingpending   if {![dict exists $pingpending $text]} {return}   set data [dict get pingpending $text]   dict unset pingpending $text   set time [expr {([clock clicks -milliseconds] - [dict get $data time]) / 1000.000}]   set char "="   if {[expr {round($time / 0.5)}] &gt; 10} {set red 10} else {set red [expr {round($time / 0.5)}]}   set green [expr {10 - $red}]   set output \00303[string repeat $char $green]\003\00304[string repeat $char $red]\003   if {($ctping(msg) == "0")} {      putquick "PRIVMSG [dict get $data chan] :\[\0030${colo}PING\003\] reply from $nick: \[\0030${colo}$time\003\] seconds $output"   } else {      putquick "NOTICE [dict get $data nick] :\[\0030${colo}PING\003\] reply from $nick: \[\0030${colo}$time\003\] seconds"   }} </code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12909">DasBrain</a> — Thu Apr 15, 2021 2:33 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ComputerTech]]></name></author>
		<updated>2021-04-15T14:08:03-04:00</updated>

		<published>2021-04-15T14:08:03-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109743#p109743</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109743#p109743"/>
		<title type="html"><![CDATA[Setting $chan when not a arg]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109743#p109743"><![CDATA[
forgot about this post.<br><br>Yes willyw, that would make the ping reply proc output to the $nick<br><br>I also changed to <div class="codebox"><p>Code: </p><pre><code>unset pingchan($nick)</code></pre></div> and it works great  <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=12849">ComputerTech</a> — Thu Apr 15, 2021 2:08 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2021-02-10T20:00:24-04:00</updated>

		<published>2021-02-10T20:00:24-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109403#p109403</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109403#p109403"/>
		<title type="html"><![CDATA[Setting $chan when not a arg]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109403#p109403"><![CDATA[
<blockquote class="uncited"><div><div class="codebox"><p>Code: </p><pre><code>...putquick "NOTICE $nick :\[\0030${colo}PING\003\] reply from ...</code></pre></div>...</div></blockquote>What's stored in $nick there?   <br>Is that what you really want there?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10420">willyw</a> — Wed Feb 10, 2021 8:00 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ComputerTech]]></name></author>
		<updated>2021-02-10T19:55:22-04:00</updated>

		<published>2021-02-10T19:55:22-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109402#p109402</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109402#p109402"/>
		<title type="html"><![CDATA[Setting $chan when not a arg]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109402#p109402"><![CDATA[
well maybe i could do<br><div class="codebox"><p>Code: </p><pre><code>unset pingchan($nick)</code></pre></div><br>I'll try come up with more ideas myself while you're sleeping.  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_cool.gif" width="15" height="15" alt="8)" title="Cool"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12849">ComputerTech</a> — Wed Feb 10, 2021 7:55 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2021-02-10T19:29:12-04:00</updated>

		<published>2021-02-10T19:29:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109401#p109401</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109401#p109401"/>
		<title type="html"><![CDATA[Setting $chan when not a arg]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109401#p109401"><![CDATA[
So you do:<div class="codebox"><p>Code: </p><pre><code>unset pingchan</code></pre></div>You unset the full array when you got the first ping reply ? What about the others if they did !ping at the same moment ?<br><br>And you don't check if pingchan($pingwho) exists, you just use it... This code is not really better than your previous one, I'll try to show ytou how to do that in a few hours, it's sleepin time now <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=691">CrazyCat</a> — Wed Feb 10, 2021 7:29 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ComputerTech]]></name></author>
		<updated>2021-02-10T19:58:10-04:00</updated>

		<published>2021-02-10T17:25:36-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109400#p109400</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109400#p109400"/>
		<title type="html"><![CDATA[Setting $chan when not a arg]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109400#p109400"><![CDATA[
got a working version which does the job  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"> <br><div class="codebox"><p>Code: </p><pre><code># Start Of Configuration ############################Set trigger of the Command.set ctping(trig) "@"###################Set flag for Commands.###Owner     = n#Master    = m#Op        = o#Voice     = v#Friend    = f#Everyone  = -set ctping(flag) "-|-"###################Set to use Notice Or Channel for Output of Command###1 = Notice#0 = Channelset ctping(msg) "0"###################Set Colour of Output###White       = 0#Black       = 1#Dark Blue   = 2#Green       = 3#Red         = 4#Brown       = 5#Purple      = 6#Orange      = 7#Yellow      = 8#Light Green = 9#DarkCyan    = 10#LightCyan   = 11#LightBlue   = 12#Pink        = 13#Dark Grey   = 14#Light Grey  = 15set colo "3"###################Set Time per usage of Command##set ctping(time) "5"######################### End Of Configuration ##################################################################################################################################################################bind pub $ctping(flag) $ctping(trig)ping ct:pub:pingbind ctcr - PING ct:pingrproc ct:pub:ping {nick host hand chan text} {global pingchan pingwhoset pingwho [lindex [split $text] 0]if {$pingwho == ""} {set pingwho $nick}putquick "PRIVMSG $pingwho :\001PING [clock clicks -milliseconds]\001"set pingchan($pingwho) $chan}proc ct:pingr {nick uhost hand dest keyword text} {global pingchan ctping colo pingwhoset time [expr {([clock clicks -milliseconds] - $text) / 1000.000}]set char "="if {[expr {round($time / 0.5)}] &gt; 10} {set red 10} else {set red [expr {round($time / 0.5)}]}set green [expr {10 - $red}]set output \00303[string repeat $char $green]\003\00304[string repeat $char $red]\003if {($ctping(msg) == "0")} {putquick "PRIVMSG $pingchan($pingwho) :\[\0030${colo}PING\003\] reply from $pingwho: \[\0030${colo}$time\003\] seconds $output"} else {putquick "NOTICE $nick :\[\0030${colo}PING\003\] reply from $pingwho: \[\0030${colo}$time\003\] seconds"}unset pingchan}</code></pre></div>Probably not the best heh  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_lol.gif" width="15" height="15" alt=":lol:" title="Laughing"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12849">ComputerTech</a> — Wed Feb 10, 2021 5:25 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2021-02-10T08:47:34-04:00</updated>

		<published>2021-02-10T08:47:34-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109398#p109398</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109398#p109398"/>
		<title type="html"><![CDATA[Setting $chan when not a arg]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109398#p109398"><![CDATA[
Sure, I just gave an indication on the kind of variable to use, no more.<br>There is several examples here about how to manage that.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Wed Feb 10, 2021 8:47 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2021-02-10T01:59:39-04:00</updated>

		<published>2021-02-10T01:59:39-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109395#p109395</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109395#p109395"/>
		<title type="html"><![CDATA[Setting $chan when not a arg]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109395#p109395"><![CDATA[
Since there's no code to clear the array it will pile up and eat his RAM at some point. Apart this, he needs to add a piece of code to track nickname changes, parts, quits and maybe some flood control mechanism just to be on the safe side.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Wed Feb 10, 2021 1:59 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2021-02-09T19:26:49-04:00</updated>

		<published>2021-02-09T19:26:49-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109394#p109394</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109394#p109394"/>
		<title type="html"><![CDATA[Setting $chan when not a arg]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109394#p109394"><![CDATA[
<blockquote class="uncited"><div>:<br>...<div class="codebox"><p>Code: </p><pre><code>set pingchan($nick) $chan</code></pre></div></div></blockquote><br>Just thinking ...<br><br>Wouldn't it be possible, with a lot of users, to thus have a huge array?<br>Would it consume a lot of memory?<br><br>Would it be wise to come up with some code to clear it all, somehow?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10420">willyw</a> — Tue Feb 09, 2021 7:26 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ComputerTech]]></name></author>
		<updated>2021-02-09T14:47:57-04:00</updated>

		<published>2021-02-09T14:47:57-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109393#p109393</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109393#p109393"/>
		<title type="html"><![CDATA[Setting $chan when not a arg]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109393#p109393"><![CDATA[
Oh i see CrazyCat, Thank You for the idea  <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=12849">ComputerTech</a> — Tue Feb 09, 2021 2:47 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2021-02-09T11:39:37-04:00</updated>

		<published>2021-02-09T11:39:37-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109392#p109392</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109392#p109392"/>
		<title type="html"><![CDATA[Setting $chan when not a arg]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109392#p109392"><![CDATA[
It works because the ping reply is quick and you don't have a lot of queries.<br><br>If you have several users on several channels asking for a ping in a few delay, the reply can go to the bad chan.<br><br>You'd better store chan in an array:<div class="codebox"><p>Code: </p><pre><code>set pingchan($nick) $chan</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Tue Feb 09, 2021 11:39 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ComputerTech]]></name></author>
		<updated>2021-02-09T05:42:59-04:00</updated>

		<published>2021-02-09T05:42:59-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109390#p109390</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109390#p109390"/>
		<title type="html"><![CDATA[Setting $chan when not a arg]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109390#p109390"><![CDATA[
Meh, i'll post my entire script and not bother creating examples heh<br><div class="codebox"><p>Code: </p><pre><code>bind pub $ctping(flag) $ctping(trig)ping ct:pub:pingbind ctcr - PING ct:pingrset pingchan "" proc pub:ping {nick host hand chan text} {  global pingchan pingwho  set pingwho [lindex [split $text] 0]     if {$pingwho == ""} {set pingwho $nick}  putquick "PRIVMSG $pingwho :\001PING [clock clicks -milliseconds]\001"  set pingchan $chan } proc ct:pingr {nick uhost hand dest keyword args} {  global pingchan ctping colo pingwho char  set time [expr {([clock clicks -milliseconds] - $args) / 1000.000}]      if {[expr {round($time / 0.5)}] &gt; 10} {set red 10} else {set red [expr {round($time / 0.5)}]}      set green [expr {10 - $red}]      set output \00303[string repeat $char $green]\003\00304[string repeat $char $red]\003  if {($ctping(msg) == "0")} {   putquick "PRIVMSG $pingchan :\[\0030${colo}PING\003\] reply from $pingwho: $output \[\0030${colo}$time\003\] seconds"  } else {   putquick "NOTICE $nick :\[\0030${colo}PING\003\] reply from $pingwho: \[\0030${colo}$time\003\] seconds"  } }</code></pre></div>so as you can see proc 1 sets $pingchan and then use global to bring it to proc 2, script works perfect  <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=12849">ComputerTech</a> — Tue Feb 09, 2021 5:42 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2021-02-09T01:58:32-04:00</updated>

		<published>2021-02-09T01:58:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109388#p109388</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109388#p109388"/>
		<title type="html"><![CDATA[Setting $chan when not a arg]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109388#p109388"><![CDATA[
The function that is triggered by the <em class="text-italics">bind pub</em> expects 5 arguments and you provided just 4 in your second function.<div class="codebox"><p>Code: </p><pre><code>proc test:two {nick host hand chan text} { # your code}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Tue Feb 09, 2021 1:58 am</p><hr />
]]></content>
	</entry>
	</feed>
