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

	<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-03-15T15:38:00-04:00</updated>

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

		<entry>
		<author><name><![CDATA[greenbear]]></name></author>
		<updated>2005-03-15T15:38:00-04:00</updated>

		<published>2005-03-15T15:38:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47715#p47715</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47715#p47715"/>
		<title type="html"><![CDATA[Taking an input from a shell command]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47715#p47715"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>set fruitname "oranges"bind pub -|- !fruit pub:fruitproc pub:fruit {n u h c a} { global fruitname putserv "PRIVMSG $c :Today's fruit is $fruitname!"}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=24">greenbear</a> — Tue Mar 15, 2005 3:38 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[TurboChicken]]></name></author>
		<updated>2005-03-15T15:25:41-04:00</updated>

		<published>2005-03-15T15:25:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47714#p47714</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47714#p47714"/>
		<title type="html"><![CDATA[Taking an input from a shell command]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47714#p47714"><![CDATA[
works a treat mate... cheers....<br><br>i used $::botnick and it worked... how would i use "global"?<br><br>and see... i can do something's by myself!!!!!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5488">TurboChicken</a> — Tue Mar 15, 2005 3:25 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[greenbear]]></name></author>
		<updated>2005-03-15T15:17:02-04:00</updated>

		<published>2005-03-15T15:17:02-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47713#p47713</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47713#p47713"/>
		<title type="html"><![CDATA[Taking an input from a shell command]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47713#p47713"><![CDATA[
It's a global var, so you either have to define it inside your proc, using 'global', or use $::botnick instead of $botnick.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=24">greenbear</a> — Tue Mar 15, 2005 3:17 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[TurboChicken]]></name></author>
		<updated>2005-03-15T15:10:24-04:00</updated>

		<published>2005-03-15T15:10:24-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47712#p47712</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47712#p47712"/>
		<title type="html"><![CDATA[Taking an input from a shell command]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47712#p47712"><![CDATA[
well i think i have it working... just through trial and eror... i've gone through about 6 lots of hair....<br><br>one question i have:<br><br>all my bots have the nick Turbo-&lt;2 or 3 char ref&gt;<br><br>i want the script to take out the last 2 chars and put them in a var that i can use in the reply.<br><br>this is what i got so far<div class="codebox"><p>Code: </p><pre><code>   set serverbw [lindex [split $botnick \-] 1]</code></pre></div>but i get a tcl error<div class="codebox"><p>Code: </p><pre><code>Tcl error [botnetusage]: can't read "botnick": no such variable</code></pre></div>now i've used that variable as part of the trigger on the other script and it works fine... y can i not use it there?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5488">TurboChicken</a> — Tue Mar 15, 2005 3:10 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[greenbear]]></name></author>
		<updated>2005-03-15T13:36:29-04:00</updated>

		<published>2005-03-15T13:36:29-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47708#p47708</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47708#p47708"/>
		<title type="html"><![CDATA[Taking an input from a shell command]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47708#p47708"><![CDATA[
I don't see anything wrong, so here's a few guesses  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> <br><br>Maybe it's having trouble seing the bot (wrong botname). <br>One way to find out is to use putallbots instead of putbot.<br><br>Replace<div class="codebox"><p>Code: </p><pre><code>putbot Turbo-BW "bwmsg ..."</code></pre></div>With<div class="codebox"><p>Code: </p><pre><code>putallbots "bwmsg ..."</code></pre></div>That'll make any bot in the botnet with the bwmsg bind respond.<br><br>If that doesn't help, try changing the bind from +W to +b<br><br>And if the msg is too long, it might be cut off by the irc-server, and you get nothing.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=24">greenbear</a> — Tue Mar 15, 2005 1:36 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[TurboChicken]]></name></author>
		<updated>2005-03-15T13:20:20-04:00</updated>

		<published>2005-03-15T13:20:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47705#p47705</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47705#p47705"/>
		<title type="html"><![CDATA[Taking an input from a shell command]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47705#p47705"><![CDATA[
i've made an evolution of the script....<br><br>so that one bot can be in a channel and someone type !bwusage &lt;2char identifier&gt;<br><br>as all the bots that are running this script are named Turbo-DG Turbo-GC etc.<br><br>i am using the botnet to communicate with the other bots<br><br>so in one channel someone types it and it sends a msg over the botnet to that bot.... and then that bot sends a msg back through the botnet to give the line of text.<br><br>now i'm almost there but i've only made it work once... and i'm not sure what i have changed to make it not work.<br><br>so anyway... here's the code<br><br>Turbo-BW is the master... that is in the channel and responding to commands.<div class="codebox"><p>Code: </p><pre><code>bind pubm B "#turbo-test !bwusage*" adminbwusageproc adminbwusage {n u h c a} {  set bwbot [lindex $a 1]  putbot Turbo-$bwbot "bwusage"}</code></pre></div>that's the listena and send part... i've checked that part using console +htrv and i can see the message being sent over.<br><br>no on Turbo-DG which is the one that i want to know the bw of.<div class="codebox"><p>Code: </p><pre><code>bind bot W bwusage botnetusageproc botnetusage {b k a} { set d [eval exec vnstat --dumpdb] set i 1 foreach l [split $d \n] {  if $i==44 {   set line $l   ...   lots of code that i know works   ...   if {$est &lt; 800.00} {     putbot Turbo-BW "bwmsg \002IN BW:\002  $in GB &gt;&gt;&gt;&gt;&gt;&gt; \002OUT BW:\002  $out GB &gt;&gt;&gt;&gt;&gt;&gt; \002TOTAL:\002  $tot GB &gt;&gt;&gt;&gt;&gt;&gt; \002ESTIMATED:\002 \0039 $est\003 GB"   }   if {$est &gt; 800.00} {     putbot Turbo-BW "bwmsg \002IN BW:\002  $in GB &gt;&gt;&gt;&gt;&gt;&gt; \002OUT BW:\002  $out GB &gt;&gt;&gt;&gt;&gt;&gt; \002TOTAL:\002  $tot GB &gt;&gt;&gt;&gt;&gt;&gt; \002ESTIMATED:\002 \0034 $est\003 GB"   }  } incr i 1 }}</code></pre></div>*note i know this part is working because i tried to replace the putbot part in there with just "putserv "PRIVMSG turbochic :working" and that responded but when i tried "putbot Turbo-BW "bwmsg working" " it didn't work<br><br>and now back on Turbo-BW (the master)<br><div class="codebox"><p>Code: </p><pre><code>bind bot W bwmsg adminmsgproc adminmsg {b k a} {puthelp "PRIVMSG #turbo-test :$a"}</code></pre></div>and nothing is responding...<br><br>both bots have the +W flag on them<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5488">TurboChicken</a> — Tue Mar 15, 2005 1:20 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[greenbear]]></name></author>
		<updated>2005-03-12T19:35:04-04:00</updated>

		<published>2005-03-12T19:35:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47517#p47517</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47517#p47517"/>
		<title type="html"><![CDATA[Taking an input from a shell command]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47517#p47517"><![CDATA[
If you take me somewhere sunny for the honeymoon, then yea, why not.  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_redface.gif" width="15" height="15" alt=":oops:" title="Embarassed"><br><br>Oh, and I forgot to divide totGB in the code above, but I'm sure you'll figure it out.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=24">greenbear</a> — Sat Mar 12, 2005 7:35 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[TurboChicken]]></name></author>
		<updated>2005-03-12T19:27:41-04:00</updated>

		<published>2005-03-12T19:27:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47516#p47516</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47516#p47516"/>
		<title type="html"><![CDATA[Taking an input from a shell command]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47516#p47516"><![CDATA[
will you marry me?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5488">TurboChicken</a> — Sat Mar 12, 2005 7:27 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[greenbear]]></name></author>
		<updated>2005-03-12T18:46:02-04:00</updated>

		<published>2005-03-12T18:46:02-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47513#p47513</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47513#p47513"/>
		<title type="html"><![CDATA[Taking an input from a shell command]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47513#p47513"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>set line "m;0;1110636195;133;2131;183;111;1"# split up the list on ; and find the info.# 4th and 5th word on the list, counting from 0.set inMB [lindex [split $line \;] 3]set outMB [lindex [split $line \;] 4]# do the math, making sure it uses decimalsset inGB [expr $inMB/1024.0]set outGB [expr $outMB/1024.0]set totGB [expr $outMB+$inMB]# make it look pretty, with only 2 decimalsset in [format %.2f $inGB]set out [format %.2f $outGB]set total [format %.2f $totGB]# or if you only want the totalset totalGB [expr ($inMB+$outMB)/1024.0]set total [format %.2f $totalGB]</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=24">greenbear</a> — Sat Mar 12, 2005 6:46 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[TurboChicken]]></name></author>
		<updated>2005-03-12T18:07:25-04:00</updated>

		<published>2005-03-12T18:07:25-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47512#p47512</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47512#p47512"/>
		<title type="html"><![CDATA[Taking an input from a shell command]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47512#p47512"><![CDATA[
ahhh... it was confusing the hell outta me...<br><br>but i got it sorted... it works ok....<br><br>&lt;Turbochicken&gt; !bwusage<br>&lt;Turbo1&gt; IN BW:     126.71 MB  OUT BW:      1,740 MB TOTAL:      1,866 MB<br><br>now i have something to add to it... coz that way is only giving in MB and really want it in GB..<br><br>so the script also output's something else.... dumpdb<br><br>which for one output's a load of useless crap... but it does output the RAW figure in MB...<br><br>so i can do a calc on it and get GB...<br><br>problem being i'm no good with calculating things and the output is kinda hard to parse<br><br>m;0;1110636195;133;2131;183;111;1<br><br>&lt;indcates it's month&gt;;&lt;howmany months ago&gt;;&lt;no idea&gt;;&lt;in bw (MB)&gt;;&lt;out&gt;;&lt;no idea on the rest&gt;<br><br>so i can use the same as the other one to find it by finding the first one that has an "m" in it.  that bit's fine.... but i need to get that in bw number out and out bw out....<br><br>do a calc... set inbwGB $inbw/1024 ( which should be a number value to 2 decimal places) and same for out....<br>and the set totbwGB ($inbw+$outbw)/1024<br><br>then i can output that...<br><br>i know it's a lot to ask and it seems like you've already done most of the script for me.... i am usually good with scripting... be this thing is kinda beyond me.... i've never had to do calc's before<br><br>if you could even tell me how to split the line up at ";" and then take out the sections i need... i could do the rest...<br>and as for calc... just gimme an example calc line... and i will work it out from there.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5488">TurboChicken</a> — Sat Mar 12, 2005 6:07 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[greenbear]]></name></author>
		<updated>2005-03-12T17:31:11-04:00</updated>

		<published>2005-03-12T17:31:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47509#p47509</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47509#p47509"/>
		<title type="html"><![CDATA[Taking an input from a shell command]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47509#p47509"><![CDATA[
I just use concat to remove leading whitespace's, so that it looks prettier  <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=24">greenbear</a> — Sat Mar 12, 2005 5:31 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[TurboChicken]]></name></author>
		<updated>2005-03-12T17:10:45-04:00</updated>

		<published>2005-03-12T17:10:45-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47508#p47508</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47508#p47508"/>
		<title type="html"><![CDATA[Taking an input from a shell command]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47508#p47508"><![CDATA[
yeah spotted that too<br><br><br>one thing i wanted to ask tho.... what exactly does the <div class="codebox"><p>Code: </p><pre><code>putserv "PRIVMSG $c :[concat $l]"</code></pre></div>do?  i understand privmsg to channel ($c) but i don't get y there is [concat in there<br><br>i.e when i'm doing the string range part... would just putting the $l bit work?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5488">TurboChicken</a> — Sat Mar 12, 2005 5:10 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[greenbear]]></name></author>
		<updated>2005-03-12T16:06:20-04:00</updated>

		<published>2005-03-12T16:06:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47506#p47506</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47506#p47506"/>
		<title type="html"><![CDATA[Taking an input from a shell command]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47506#p47506"><![CDATA[
ah yea, I made a typo, it should be<div class="codebox"><p>Code: </p><pre><code>bind pub -|- !bwusage vnstatproc vnstat {n u h c t} { set d [eval exec vnstat -m] foreach l [split $d \n] {  if [string match -noc *[strftime %b]* $l] {    putserv "PRIVMSG $c :[concat $l]"  } } </code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=24">greenbear</a> — Sat Mar 12, 2005 4:06 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[TurboChicken]]></name></author>
		<updated>2005-03-12T15:09:51-04:00</updated>

		<published>2005-03-12T15:09:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47505#p47505</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47505#p47505"/>
		<title type="html"><![CDATA[Taking an input from a shell command]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47505#p47505"><![CDATA[
well that should work ok as a temp solution until i can get out the stuff and parse it abit.<br><br>but there seems to be a problem with your code :/<br><br><div class="codebox"><p>Code: </p><pre><code>bind pub -|- !bwusage vnstatproc vnstat [n u h c t] { set d [eval exec vnstat -m] foreach l [split $d \n] {  if [string match -noc *[strftime %b]* $l] {    putserv "PRIVMSG $c :[concat $l]"  } }}</code></pre></div>i'm getting an error on rehash.<br><br>scripts/bwtest.tcl: invalid command name "n"<br><br>any ideas?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5488">TurboChicken</a> — Sat Mar 12, 2005 3:09 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[greenbear]]></name></author>
		<updated>2005-03-12T14:34:13-04:00</updated>

		<published>2005-03-12T14:34:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47502#p47502</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47502#p47502"/>
		<title type="html"><![CDATA[Taking an input from a shell command]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47502#p47502"><![CDATA[
<blockquote class="uncited"><div>i don't understand what *[strftime %b]*  is looking for?</div></blockquote>It returns the current month, in a 3 char format. ie. Mar<br><br>So the code just look for the line that have 'Mar' in it and send it to irc.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=24">greenbear</a> — Sat Mar 12, 2005 2:34 pm</p><hr />
]]></content>
	</entry>
	</feed>
