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

	<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>2005-01-02T00:48:09-04:00</updated>

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

		<entry>
		<author><name><![CDATA[zfitri]]></name></author>
		<updated>2005-01-02T00:48:09-04:00</updated>

		<published>2005-01-02T00:48:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=44837#p44837</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=44837#p44837"/>
		<title type="html"><![CDATA[Need help.. Creting tcl for check opened ports]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=44837#p44837"><![CDATA[
the tcl works great now.. thank you for your help and support..<br><br>now.. i want make some additional function to the tcl.. telling the online player in my server...<br><br>is there possible that i can make the tcl to look parameter on my online website because.. in my website there is status of server an online players...<br><br><a href="http://ajspeedi.ath.cx/ro/login.php" class="postlink">http://ajspeedi.ath.cx/ro/login.php</a><br><br>the server status for login, char and map server now runnning great.. just wann add the status of how many user online..<br><br>thank you.. hope answer for this post<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5751">zfitri</a> — Sun Jan 02, 2005 12:48 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2004-12-08T10:40:51-04:00</updated>

		<published>2004-12-08T10:40:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=43687#p43687</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=43687#p43687"/>
		<title type="html"><![CDATA[Need help.. Creting tcl for check opened ports]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=43687#p43687"><![CDATA[
<blockquote class="uncited"><div>ok thanxs for replying.. sorry i made the mistakes..  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"> <br><br>now the tcl work.. but the result is not what i want.. i mean.. when the server offline it still reply online... any idea.?</div></blockquote><blockquote class="uncited"><div># 90 seconds delay before re-checking to prevent flooding</div></blockquote>After doing a check, the script will not perform another check for 90 seconds, but instead use the result of the previous check. If you think 90 seconds is too long, change the line below that comment to suit your needs. <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=2878">user</a> — Wed Dec 08, 2004 10:40 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[zfitri]]></name></author>
		<updated>2004-12-08T10:26:27-04:00</updated>

		<published>2004-12-08T10:26:27-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=43685#p43685</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=43685#p43685"/>
		<title type="html"><![CDATA[Need help.. Creting tcl for check opened ports]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=43685#p43685"><![CDATA[
ok thanxs for replying.. sorry i made the mistakes..  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"> <br><br>now the tcl work.. but the result is not what i want.. i mean.. when the server offline it still reply online... any idea.?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5751">zfitri</a> — Wed Dec 08, 2004 10:26 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2004-12-08T05:24:03-04:00</updated>

		<published>2004-12-08T05:24:03-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=43676#p43676</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=43676#p43676"/>
		<title type="html"><![CDATA[Re: Try this]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=43676#p43676"><![CDATA[
<blockquote class="uncited"><div>Add the two probe <strong class="text-strong">procs</strong> from my first post...</div></blockquote>You didn't just add the two procs...you added my usage example too and the non-blocking example ...AND you somehow got the brilliant idea of renaming one of the procs <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"><br><br>Here's what you should have done (the order of the procs doesn't matter)<div class="codebox"><p>Code: </p><pre><code>bind pub - !status sstat:pubproc sstat:pub {n u h c a} {global sstatif {[info exists sstat(pending)]&amp;&amp;$sstat(pending)&gt;0} {# add channel to target list and wait for pending requestset sstat(target,$c) $nreturn}if {[info exists sstat(next)]&amp;&amp;$sstat(next)&gt;[clock sec]} {# use result of previous checkset sstat(target,$c) $nsstat:msg} else {# (re)check serversset sstat(target,$c) $nset sstat(pending) 0# 90 seconds delay before re-checking to prevent floodingset sstat(next) [expr {[clock sec]+90}]foreach {name ip port} {login 192.168.0.2 6900 char 192.168.0.2 6121 map 192.168.0.2 5121 } {if {[catch {tcpProbe $ip $port [list sstat:sock $name]} err]} {set sstat(status,$name) "OFFLINE"putlog "sstat Warning: $err"} {incr sstat(pending)}}if {$sstat(pending)==0} {puthelp "PRIVMSG $c :$n - failed miserably...contact my admin."}}}proc sstat:sock {name ok x} {global sstatif {$ok} {set sstat(re,$name) "ONLINE"} {set sstat(re,$name) "OFFLINE"}if {[incr sstat(pending) -1]==0} {set sstat(msg) "- Server Status \[- Login Server \[ $sstat(re,login) \] - Character Server \[ $sstat(re,char) \] - Map Server \[ $sstat(re,map) \] - Register \[ ajspeedi.ath.cx/ro/login.php \] - Server Name \[ aJRo \] - Service Type ( eAthena ) Domain Host ( aJRo Team ) -"sstat:msg}}proc sstat:msg {} {global sstatforeach name [array names sstat target,*] {unset sstat($name)scan $name target,%s chanputhelp "PRIVMSG $chan :$sstat(msg)"}}# the two procs from my first post:proc tcpProbe {ip port callback} {set sock [socket -async $ip $port]fileevent $sock writable [list tcpProbed $sock $callback]set sock}proc tcpProbed {sock callback} {if {[set msg [fconfigure $sock -error]]==""} {set ok 1set msg [lindex [fconfigure $sock -peername] 1]} else {set ok 0}close $sockeval [lappend callback $ok $msg]}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Wed Dec 08, 2004 5:24 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[zfitri]]></name></author>
		<updated>2004-12-07T22:27:11-04:00</updated>

		<published>2004-12-07T22:27:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=43658#p43658</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=43658#p43658"/>
		<title type="html"><![CDATA[Need help.. Creting tcl for check opened ports]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=43658#p43658"><![CDATA[
after i make some adjustment these error found when i run the eggdrop<br><br>Eggdrop v1.6.17 (C) 1997 Robey Pointer (C) 2004 Eggheads<br>[10:07] --- Loading eggdrop v1.6.17 (Wed Dec  8 2004)<br>[10:07] Tcl error in file 'ajro.tcl':<br>[10:07] wrong # args: should be "tcpProbed sock callback"<br>    while executing<br>"tcpProbed 127.0.0.1 1234 [list showResult "the thing"]"<br>    (file "ajro.tcl" line 31)<br>[10:07] * MSG534<br><br>just for note, <br><blockquote class="uncited"><div># 1st level<br># usage: tcpProbe &lt;ip&gt; &lt;port&gt; &lt;callback&gt;<br>#<br># Two arguments are appended to the callback command:<br># * A status code (1/0 for success/failure)<br># * A message (hostname/reason depending on the status code)<br>proc tcpProbed {ip port callback} {<br>   set sock [socket -async $ip $port]<br>   fileevent $sock writable [list tcpProbed $sock $callback]<br>   set sock<br>}<br>proc tcpProbed {sock callback} {<br>   if {[set msg [fconfigure $sock -error]]==""} {<br>      set ok 1<br>      set msg [lindex [fconfigure $sock -peername] 1]<br>   } else {<br>      set ok 0<br>   }<br>   close $sock<br>   eval [lappend callback $ok $msg]<br>}<br><br># example:<br>proc showResult {what ok msg} {<br>   if {$ok} {<br>      putlog "connected to $what ($msg)"<br>   } else {<br>      putlog "failed connecting to $what ($msg)"<br>   }<br>}<br>tcpProbed 127.0.0.1 1234 [list showResult "the thing"]<br><br># 2nd level<br>if {[catch {socket $ip $port} re]} {<br>   # connection failed - $re is the reason<br>} else {<br>   # connected - $re is the socket id<br>   close $re<br>}<br><br># 3rd level<br>bind pub - !status sstat:pub<br>proc sstat:pub {n u h c a} {<br>   global sstat<br>   if {[info exists sstat(pending)]&amp;&amp;$sstat(pending)&gt;0} {<br>      # add channel to target list and wait for pending request<br>      set sstat(target,$c) $n<br>      return<br>   }<br>   if {[info exists sstat(next)]&amp;&amp;$sstat(next)&gt;[clock sec]} {<br>      # use result of previous check<br>      set sstat(target,$c) $n<br>      sstat:msg<br>   } else {<br>      # (re)check servers<br>      set sstat(target,$c) $n<br>      set sstat(pending) 0<br>      # 90 seconds delay before re-checking to prevent flooding<br>      set sstat(next) [expr {[clock sec]+90}]<br>      foreach {name ip port} {<br>         login 192.168.0.2 6900<br>         char 192.168.0.2 6121<br>         map 192.168.0.2 5121<br>      } {<br>         if {[catch {tcpProbe $ip $port [list sstat:sock $name]} err]} {<br>            set sstat(status,$name) "OFFLINE"<br>            putlog "sstat Warning: $err"<br>         } {<br>            incr sstat(pending)<br>         }<br>      }<br>      if {$sstat(pending)==0} {<br>         puthelp "PRIVMSG $c :$n - failed miserably...contact my admin."<br>      }<br>   }<br>}<br>proc sstat:sock {name ok x} {<br>   global sstat<br>   if {$ok} {<br>      set sstat(re,$name) "ONLINE"<br>   } {<br>      set sstat(re,$name) "OFFLINE"<br>   }<br>   if {[incr sstat(pending) -1]==0} {<br>      set sstat(msg) "- Server Status \[- Login Server \[ $sstat(re,login) \] - Character Server \[ $sstat(re,char) \] - Map Server \[ $sstat(re,map) \] - R$<br>      sstat:msg<br>   }<br>}<br>proc sstat:msg {} {<br>   global sstat<br>   foreach name [array names sstat target,*] {<br>      unset sstat($name)<br>      scan $name target,%s chan<br>      puthelp "PRIVMSG $chan :$sstat(msg)"<br>   }<br>}</div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5751">zfitri</a> — Tue Dec 07, 2004 10:27 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2004-12-07T02:31:14-04:00</updated>

		<published>2004-12-07T02:31:14-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=43610#p43610</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=43610#p43610"/>
		<title type="html"><![CDATA[Try this]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=43610#p43610"><![CDATA[
Add the two probe procs from my first post...<div class="codebox"><p>Code: </p><pre><code>bind pub - !status sstat:pubproc sstat:pub {n u h c a} {global sstatif {[info exists sstat(pending)]&amp;&amp;$sstat(pending)&gt;0} {# add channel to target list and wait for pending requestset sstat(target,$c) $nreturn}if {[info exists sstat(next)]&amp;&amp;$sstat(next)&gt;[clock sec]} {# use result of previous checkset sstat(target,$c) $nsstat:msg} else {# (re)check serversset sstat(target,$c) $nset sstat(pending) 0# 90 seconds delay before re-checking to prevent floodingset sstat(next) [expr {[clock sec]+90}]foreach {name ip port} {login 192.168.0.2 6900 char 192.168.0.2 6121 map 192.168.0.2 5121 } {if {[catch {tcpProbe $ip $port [list sstat:sock $name]} err]} {set sstat(status,$name) "OFFLINE"putlog "sstat Warning: $err"} {incr sstat(pending)}}if {$sstat(pending)==0} {puthelp "PRIVMSG $c :$n - failed miserably...contact my admin."}}}proc sstat:sock {name ok x} {global sstatif {$ok} {set sstat(re,$name) "ONLINE"} {set sstat(re,$name) "OFFLINE"}if {[incr sstat(pending) -1]==0} {set sstat(msg) "- Server Status \[- Login Server \[ $sstat(re,login) \] - Character Server \[ $sstat(re,char) \] - Map Server \[ $sstat(re,map) \] - Register \[ ajspeedi.ath.cx/ro/login.php \] - Server Name \[ aJRo \] - Service Type ( eAthena ) Domain Host ( aJRo Team ) -"sstat:msg}}proc sstat:msg {} {global sstatforeach name [array names sstat target,*] {unset sstat($name)scan $name target,%s chanputhelp "PRIVMSG $chan :$sstat(msg)"}}</code></pre></div>...I leave the testing to you...because I dislike testing stuff <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"><br>Make sure you don't mess up the code by adding linebreaks etc (the best way to copy the code unaltered is to press the "quote" button and copy from the texarea on the posting page)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Tue Dec 07, 2004 2:31 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[zfitri]]></name></author>
		<updated>2004-12-07T01:42:21-04:00</updated>

		<published>2004-12-07T01:42:21-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=43607#p43607</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=43607#p43607"/>
		<title type="html"><![CDATA[Need help.. Creting tcl for check opened ports]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=43607#p43607"><![CDATA[
ok sorry...<br>actually me from malaysia.. so my english is poor..<br><br>what i need is a tcl for eggdrop... i'm running a private server of ragnarok on my linux slackware box. I'm thinking to make an eggdrop and put it on my irc channel for status of my server..<br><br>when my user enter my irc room they type <br><br>!status<br><br>then i want my bot to answer something like this <br><br>&lt;ajRo&gt; - Server Status [- Login Server [ ONLINE ] - Character Server [ ONLINE ] - Map Server [ ONLINE ] - Register [ ajspeedi.ath.cx/ro/login.php ] - Server Name [ aJRo ] - Service Type ( eAthena ) Domain Host ( aJRo Team ) -<br><br>ok, my irc script check the socket 6901 for character server on my lan ip slackware 192.168.0.2.. and so on..  mapserver socket 5121, charserver 6121<br><br>hope u understand what i post here<br><br>thank you very much<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5751">zfitri</a> — Tue Dec 07, 2004 1:42 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2004-12-07T01:21:36-04:00</updated>

		<published>2004-12-07T01:21:36-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=43606#p43606</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=43606#p43606"/>
		<title type="html"><![CDATA[Need help.. Creting tcl for check opened ports]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=43606#p43606"><![CDATA[
Are you talking to me? I don't know that "language". Try to describe in plain english what you're trying to create <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=2878">user</a> — Tue Dec 07, 2004 1:21 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[zfitri]]></name></author>
		<updated>2004-12-07T01:13:48-04:00</updated>

		<published>2004-12-07T01:13:48-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=43605#p43605</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=43605#p43605"/>
		<title type="html"><![CDATA[Need help.. Creting tcl for check opened ports]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=43605#p43605"><![CDATA[
ok thanxs for the quick reply :-<br>for your info i want to make this example mIRC script for my eggdrop,<br>can u confirm the tcl u post is what i'm need here..<br>thank you...<br><br>alias checkstatus { .sockclose loginsock | .sockclose mapsock | .sockclose charsock | .sockclose patchsock <br>  .sockopen loginsock 192.168.0.2 6900 <br>  .sockopen charsock 192.168.0.2 6121 <br>  .sockopen mapsock 192.168.0.2 5121 <br>  .sockopen patchsock 192.168.0.2 21 <br>} <br><br>on *:sockopen:patchsock: { <br>  if ($sockerr) { set %chropatch 4TERMINATED } <br>  else { set %chropatch 3ONLINE } <br>} <br><br>on *:sockopen:loginsock: { <br>  if ($sockerr) { set %chrologin 4TERMINATED } <br>  else { set %chrologin 3ONLINE } <br>} <br>on *:sockopen:mapsock: { <br>  if ($sockerr) { set %chromap 4TERMINATED } <br>  else { set %chromap 3ONLINE } <br>} <br>on *:sockopen:charsock: { <br>  if ($sockerr) { set %chrocharacter 4TERMINATED } <br>  else { set %chrocharacter 3ONLINE } <br>} <br><br>on *:text:*:#aJRo,#myradio,#xxx: { <br>  if (!status isin $1-) { <br>    .inc -u50 %status 1 <br>    if (%status &gt; 2) { .ignore -u20 $nick } <br>    else { goto status } <br>    :status <br>    .checkstatus <br>    .timer 1 4 msg $chan - Server Status [- Login Server [ %chrologin ] - Character Server [ %chrocharacter ] - Map Server [ %chromap ] - Register [ ajspeedi.ath.cx/ro/login.php ] - Server Name [ aJRo ] - Service Type ( eAthena ) Domain Host ( aJRo Team ) - <br>  }<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5751">zfitri</a> — Tue Dec 07, 2004 1:13 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2004-12-07T00:49:46-04:00</updated>

		<published>2004-12-07T00:49:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=43602#p43602</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=43602#p43602"/>
		<title type="html"><![CDATA[Need help.. Creting tcl for check opened ports]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=43602#p43602"><![CDATA[
Non-blocking<div class="codebox"><p>Code: </p><pre><code># usage: tcpProbe &lt;ip&gt; &lt;port&gt; &lt;callback&gt;## Two arguments are appended to the callback command:# * A status code (1/0 for success/failure) # * A message (hostname/reason depending on the status code)proc tcpProbe {ip port callback} {set sock [socket -async $ip $port]fileevent $sock writable [list tcpProbed $sock $callback]set sock}proc tcpProbed {sock callback} {if {[set msg [fconfigure $sock -error]]==""} {set ok 1set msg [lindex [fconfigure $sock -peername] 1]} else {set ok 0}close $sockeval [lappend callback $ok $msg]}# example:proc showResult {what ok msg} {if {$ok} {putlog "connected to $what ($msg)"} else {putlog "failed connecting to $what ($msg)"}}tcpProbe 127.0.0.1 1234 [list showResult "the thing"]</code></pre></div>Blocking<div class="codebox"><p>Code: </p><pre><code>if {[catch {socket $ip $port} re]} {# connection failed - $re is the reason} else {# connected - $re is the socket idclose $re}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Tue Dec 07, 2004 12:49 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[zfitri]]></name></author>
		<updated>2004-12-06T22:22:29-04:00</updated>

		<published>2004-12-06T22:22:29-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=43589#p43589</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=43589#p43589"/>
		<title type="html"><![CDATA[Need help.. Creting tcl for check opened ports]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=43589#p43589"><![CDATA[
i'm newbie is scripting.. i want to make a tcl to check my raganarok server status.. in mIRC their make that such script by checking ragnarok server opened ports such 6901 for login server ports,<br><br>are the any idea to help me creating such tcl for eggdrop..<br><br>thanxs<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5751">zfitri</a> — Mon Dec 06, 2004 10:22 pm</p><hr />
]]></content>
	</entry>
	</feed>
