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

	<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>2012-06-27T19:34:50-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Mysticales]]></name></author>
		<updated>2012-06-27T19:34:50-04:00</updated>

		<published>2012-06-27T19:34:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=99632#p99632</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=99632#p99632"/>
		<title type="html"><![CDATA[!ping ip/host]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=99632#p99632"><![CDATA[
Hey is the script finally broke? I tried it with the modifications, however just wants to output the "ping useage" with all the variables.. Doesnt give me the results, which I need. <br><br>Once that works, I plan to just make it ping a single IP to check if the server is online of offline. If anyone has an idea? Just not sure if this script is fully broke or not now. =/<br><br>Edit: Ah HA! After I played around some, its the same line as mentioned above, just had to change the command. <div class="codebox"><p>Code: </p><pre><code>if {[catch {exec ping -c 3 [lindex $rest 0] } ping]} { set ping 0 } </code></pre></div>Is how it should be, then adjust the lindex output as needed.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11814">Mysticales</a> — Wed Jun 27, 2012 7:34 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[alphaz]]></name></author>
		<updated>2010-08-29T23:26:46-04:00</updated>

		<published>2010-08-29T23:26:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=94161#p94161</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=94161#p94161"/>
		<title type="html"><![CDATA[!ping ip/host]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=94161#p94161"><![CDATA[
the only thing you have to change for this script to work is the following line:<div class="codebox"><p>Code: </p><pre><code>    if {[catch {exec ping [lindex $rest 0] -c 3} ping]} { set ping 1 } </code></pre></div> <br><br>change<strong class="text-strong"> set ping 1</strong> to <strong class="text-strong">set ping 0</strong> .. and it will work.. <br>this is not the perfect way to build a script.. but it does work.. <br><br>right now im working with it.. a little bit modified in lindex parts.. <br><div class="codebox"><p>Code: </p><pre><code>[9:58pm] &lt;!JavieR&gt; !ping 74.125.95.103[9:58pm] &lt;@Sidekick&gt; Pinging 74.125.95.103 with 64 bytes of data[9:58pm] &lt;@Sidekick&gt; #1: time=12.0 ms #2: time=11.7 ms #3: time=11.9 ms[9:58pm] &lt;@Sidekick&gt; 3 packets transmitted, 3 received, 0% packet loss, time 2000ms </code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11270">alphaz</a> — Sun Aug 29, 2010 11:26 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[arfer]]></name></author>
		<updated>2009-09-12T11:04:12-04:00</updated>

		<published>2009-09-12T11:04:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90232#p90232</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90232#p90232"/>
		<title type="html"><![CDATA[!ping ip/host]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90232#p90232"><![CDATA[
Looks suspiciously like the output I would expect to see if I tried to use such a script on a Windrop.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5705">arfer</a> — Sat Sep 12, 2009 11:04 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Info]]></name></author>
		<updated>2009-09-12T09:56:42-04:00</updated>

		<published>2009-09-12T09:56:42-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90231#p90231</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90231#p90231"/>
		<title type="html"><![CDATA[!ping ip/host]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90231#p90231"><![CDATA[
&lt;@Info&gt; !ping <a href="http://www.google.com" class="postlink">www.google.com</a><br>&lt;@Eggie&gt; Resultado do ping <a href="http://www.google.com" class="postlink">www.google.com</a>:<br>&lt;@Eggie&gt; couldn't create error file for command:<br>&lt;@Eggie&gt; no such file or directory   <br>&lt;@Eggie&gt;        <br>&lt;@Eggie&gt;     <br>&lt;@Eggie&gt;<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10857">Info</a> — Sat Sep 12, 2009 9:56 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2009-09-12T09:50:38-04:00</updated>

		<published>2009-09-12T09:50:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90230#p90230</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90230#p90230"/>
		<title type="html"><![CDATA[!ping ip/host]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90230#p90230"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>   if {[catch {exec ping [lindex $rest 0] -c 3} ping]} { set ping 1 }   if {[lindex $ping 0] == "0"} { putserv "PRIVMSG $channel :Este Ip ([lindex $rest 0]) está offline"; return 0 }   if {[lindex $ping 0] != "0"} {       putserv "PRIVMSG $channel :Resultado do ping [lindex $rest 0]  :"      ... rest of script continues...</code></pre></div>This here is the problem. It catches the contents of the ping command into the variable "ping". If it succeeds in getting data, it then overwrites this variable "ping" with 1 which it uses as a flag. The scripter here has broken the script himself. Using a container and flag of the same variable name...<div class="codebox"><p>Code: </p><pre><code>   if {[catch {exec ping [lindex $rest 0] -c 3} ping]} { set p 1 } { set p 0 }   if {!$p} {      putserv "PRIVMSG $channel :Este Ip ([lindex $rest 0]) está offline"      return 0   } else {      putserv "PRIVMSG $channel :Resultado do ping [lindex $rest 0]:"      ...rest of script continues....</code></pre></div>This corrects the flawed variable problem. But doesn't correct those awful lindex on strings, but as nml375 said it's doubtful these cause problems except with nicknames/data containing tcl special characters.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Sat Sep 12, 2009 9:50 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Info]]></name></author>
		<updated>2009-09-12T09:48:07-04:00</updated>

		<published>2009-09-12T09:48:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90229#p90229</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90229#p90229"/>
		<title type="html"><![CDATA[!ping ip/host]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90229#p90229"><![CDATA[
Eggie just tells me that all IPs and hosts are offline.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10857">Info</a> — Sat Sep 12, 2009 9:48 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2009-09-12T08:45:47-04:00</updated>

		<published>2009-09-12T08:45:47-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90228#p90228</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90228#p90228"/>
		<title type="html"><![CDATA[!ping ip/host]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90228#p90228"><![CDATA[
It would be very helpful if you could post any logged error messages related to loading/using this script...<br><br>One thing that stands out though, is a large number of improper use of the lindex command on strings, although I doubt this is the sole issue...<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Sat Sep 12, 2009 8:45 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Info]]></name></author>
		<updated>2009-09-12T06:38:54-04:00</updated>

		<published>2009-09-12T06:38:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90227#p90227</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90227#p90227"/>
		<title type="html"><![CDATA[!ping ip/host]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90227#p90227"><![CDATA[
Hi everyone!<br><br>I've download a script to ping an ip/host at egghelp.org, but it doesnt work.<br><div class="codebox"><p>Code: </p><pre><code>######################################################### Tcl Feita por MrBoss (MrBoss@BRASnet.org)            ## A tcl de !ping HOST/IP foi desenvolvida para         ## pingar o IP/Host pela maquina onde é rodado eggdrop  ## Além de mostrar a resposta do ping no canal qual o   ## comando foi digitado.                                ################################################################################################################## COMANDO VIA CANAL:                                   ##                                                      ## !Ping 127.0.0.1  ou !Ping www.linksoft.com.br        ##                                                      ##################################################################################################################################################### Não mude nada em baixo , pois a TCL poderá não funcionar corretamente !!!!!!!!!!!!!!!!!!############################################################################################bind pub - !ping pub_pingproc pub_ping {nick uhost hand channel rest} {if {[catch {exec ping [lindex $rest 0] -c 3} ping]} { set ping 1 }if {[lindex $ping 0] == "0"} { putserv "PRIVMSG $channel :Este Ip ([lindex $rest 0]) está offline"; return 0 }if {[lindex $ping 0] != "0"} {putserv "PRIVMSG $channel :Resultado do ping [lindex $rest 0]:"putserv "PRIVMSG $channel :[lindex $ping 0] [lindex $ping 1] [lindex $ping 2] [lindex $ping 3] [lindex $ping 4] [lindex $ping 5]"putserv "PRIVMSG $channel :[lindex $ping 6] [lindex $ping 7] [lindex $ping 8] [lindex $ping 9] [lindex $ping 10] [lindex $ping 11] [lindex $ping 12] [lindex $ping 13]"putserv "PRIVMSG $channel :[lindex $ping 14] [lindex $ping 15] [lindex $ping 16] [lindex $ping 17] [lindex $ping 18] [lindex $ping 19] [lindex $ping 20] [lindex $ping 21]"putserv "PRIVMSG $channel :[lindex $ping 22] [lindex $ping 23] [lindex $ping 24] [lindex $ping 25] [lindex $ping 26] [lindex $ping 27] [lindex $ping 28] [lindex $ping 29]"putserv "PRIVMSG $channel :[lindex $ping 30] [lindex $ping 31] [lindex $ping 32] [lindex $ping 33] [lindex $ping 34]"putserv "PRIVMSG $channel :[lindex $ping 38] [lindex $ping 39] [lindex $ping 40] [lindex $ping 41] [lindex $ping 42] [lindex $ping 43]"putserv "PRIVMSG $channel :[lindex $ping 44] [lindex $ping 45] [lindex $ping 46] [lindex $ping 47] [lindex $ping 48] [lindex $ping 49]"return 0}}putlog "Tcl de !Ping IP/Host load"putlog "!PING By MrBoss v1.0"</code></pre></div>What's wrong with this code?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10857">Info</a> — Sat Sep 12, 2009 6:38 am</p><hr />
]]></content>
	</entry>
	</feed>
