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

	<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-01-02T07:30:26-04:00</updated>

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

		<entry>
		<author><name><![CDATA[BhasIRC]]></name></author>
		<updated>2010-01-02T07:30:26-04:00</updated>

		<published>2010-01-02T07:30:26-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=91518#p91518</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=91518#p91518"/>
		<title type="html"><![CDATA[ping script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=91518#p91518"><![CDATA[
Hi guys..<br><br>i need some help i hope i am posting this request in the right place<br><br>i have this ping script it works fine but i need it to work like my mirc script i will show u the tcl 1 i have now and my old mirc script with the mirc 1 if i typ !ping or !ping me it pings me and if i typ !ping user it pings the users nick i give and gives me and the user the ping reply here is both my codes<br><div class="codebox"><p>Code: </p><pre><code>### You can change these settings if you want #### Public triggers, seperated by spaces.set pingpubwords "ping pingme .ping .pingme !ping !pingme"# If you want to restrict ping requests to users with certain flags, change this.set pingreqdflags "-|-"# If you only want the bot to respond to requests from specific channels,# set them here, separated by spaces, e.g. "#foo #bar #baz".  Setting one# or more channels here makes the bot ignore the disabled chans setting.set pingenabledchans ""# If there are channels where you don't want the bot to listen for !ping# requests, set them here, seperated by spaces, e.g. "#lame #lamer #lamest".# This setting is meaningless if a specific list of channels have been given# in the enabled chans setting.set pingdisabledchans ""# Do you want to calculate ping replies in milliseconds (1) or not (0)?# Millisecond calculation only works on Tcl 8.3 and above, but you can safely# leave this enabled, the script will detect your Tcl version and disable this# if necessary.set pingmilli 1### YOU SHOULDN'T NEED TO EDIT ANYTHING BEYOND THIS POINT! #### Misc. stuffset pingver "1.0.6"set pingnver "100006"putlog "Loading eggping.tcl $pingver by Souperman..."if { ([info tclversion] &lt; 8.3) &amp;&amp; ($pingmilli == 1) } {set pingmilli 0putlog " eggping.tcl: warning: cannot calculate PINGs in milliseconds (requires Tcl 8.3 or higher). PINGs will be calculated in seconds."}# bindsforeach trigger [split $pingpubwords] { bind pub $pingreqdflags $trigger pingnickpub }bind ctcr $pingreqdflags PING pingreply# triggered by ping command on channelproc pingnickpub {nick uhost hand chan text} {if {$::pingenabledchans != ""} {foreach channel [split $::pingenabledchans] {if {[string tolower $channel] == [string tolower $chan]} {global pingchanset pingchan $chanpingnick $nickreturn 1}}return 0} else {foreach channel [split $::pingdisabledchans] {if {[string tolower $channel] == [string tolower $chan]} {return 0}}global pingchanset pingchan $chanpingnick $nickreturn 1}}# called by pingnickpub or pingnickmsg, sends a CTCP PING to $nick.proc pingnick {nick} {if {$::pingmilli} {putquick "PRIVMSG $nick :\001PING [expr {abs([clock clicks -milliseconds])}]\001"} else {putquick "PRIVMSG $nick :\001PING [unixtime]\001"}}# processes a CTCP PING reply.proc pingreply {nick uhost hand dest key args} {global pingchanset pingnum [lindex $args 0]set pingserver [lindex [split $::server :] 0]# sanity check -- only processes the CTCP PING reply if it's value is a numberif {[regexp -- {^-?[0-9]+$} $pingnum]} {if {$::pingmilli} {putquick "PRIVMSG $pingchan $nick: The lag between us is [expr {abs([expr [expr {abs([clock clicks -milliseconds])} - $pingnum] / 1000.000])}] seconds"} else {putquick "PRIVMSG $pingchan $nick: The lag between us is [expr [unixtime] - $pingnum] seconds"}}}</code></pre></div> <br>and here is the mirc code<div class="codebox"><p>Code: </p><pre><code>on *:text:!ping*:*:  {   if (!$2) {     ctcp $nick ping     notice $nick Please Wait one sec for your ping !     set -u5 %ping $nick   }  if ($2 != $null) &amp;&amp; ($2 == me) {     ctcp $nick ping     notice $nick Please Wait one sec for your ping !     set -u5 %ping $nick   }  if ($2 != $null) &amp;&amp; ($2 != $me) {     if ($2 ison $chan) {      ctcp $2 ping       notice $nick Please Wait one sec for $2 `s ping !      notice $2 Please Wait one sec for your ping ! Requested by $nick       set -u5 %pingnick $2       set -u5 %pingrequested $nick    }  }}on *:CtcpReply:ping*: {   if (%ping != $null)   notice %ping Done Your Ping is  4 $calc($ctime - $2) $+ sec   8,1 &lt;&lt;Zainul`s Ping Script&gt;&gt;  if (%pingnick != $null)  notice %pingnick Done Your Ping is  4 $calc($ctime - $2) $+ sec   8,1&lt;&lt;Zainul`s Ping Script&gt;&gt;  if (%pingrequested != $null)  notice %pingrequested Done %pingnick $+ `s Ping is  4 $calc($ctime - $2) $+ sec     8,1&lt;&lt;Zainul`s Ping Script&gt;&gt;}</code></pre></div>Thanks in advance<br>Zainul<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11039">BhasIRC</a> — Sat Jan 02, 2010 7:30 am</p><hr />
]]></content>
	</entry>
	</feed>
