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

	<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>2014-04-15T11:06:13-04:00</updated>

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

		<entry>
		<author><name><![CDATA[ahlan]]></name></author>
		<updated>2014-04-15T11:06:13-04:00</updated>

		<published>2014-04-15T11:06:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102744#p102744</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102744#p102744"/>
		<title type="html"><![CDATA[run command from another proc command ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102744#p102744"><![CDATA[
thank you bro!!, muach muach... <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=12376">ahlan</a> — Tue Apr 15, 2014 11:06 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[heartbroken]]></name></author>
		<updated>2014-04-15T10:43:00-04:00</updated>

		<published>2014-04-15T10:43:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102743#p102743</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102743#p102743"/>
		<title type="html"><![CDATA[run command from another proc command ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102743#p102743"><![CDATA[
you can add another proc for public messages into code below :<br><div class="codebox"><p>Code: </p><pre><code>bind pubm - "*" pubm_speakproc pubm_speak {nick uhost hand chan text} {      global brb_msg oldreplytime botnick     if {![string match "brb*" $text] || ![string match "bbl*" $text]} { return }        set replytime [unixtime]      if {[expr {$replytime - $oldreplytime}]  &gt; 7} {         set brb_rmsg [lindex $brb_msg [rand [llength $brb_msg]]]         puthelp "PRIVMSG $chan :[subst -nocommands $brb_rmsg]"         set oldreplytime $replytime      } return 0  } </code></pre></div>.restart your bot ..it keeps old binds .thats why it replies twice...<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11703">heartbroken</a> — Tue Apr 15, 2014 10:43 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ahlan]]></name></author>
		<updated>2014-04-15T10:31:53-04:00</updated>

		<published>2014-04-15T10:31:53-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102742#p102742</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102742#p102742"/>
		<title type="html"><![CDATA[run command from another proc command ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102742#p102742"><![CDATA[
Maybe I write like this:<div class="codebox"><p>Code: </p><pre><code>set actReplies {   {hei $nick, do not slap me}   {ish..., $nick slapping me}   {hai, $nick, miss me?} } bind ctcp - ACTION rep_act proc rep_act {nick uhost hand dest key text} {   global botnick actReplies brb_msg      if {$dest eq $botnick &amp;&amp; ![validchan $dest]} { return 0 }   if {[string match "slaps $botnick*" $text]} {      set repact [lindex $actReplies [rand [llength $actReplies]]]      puthelp "PRIVMSG $dest :[subst -nocommands $repact]"   } elseif {[string match "bbl*" $text] || [string match "brb*" $text]} {      set repbrb [lindex $brb_msg [rand [llength $brb_msg]]]      puthelp "PRIVMSG $dest :[subst -nocommands $repbrb]"   } } set brb_msg {   {okay, $nick}   {$nick, dont take so long}   {hope you not back, $nick}   {$botnick, waiting 4 ya} } bind pubm - *brb* brb_speakbind pubm - *bbl* brb_speak  proc brb_speak {nick dest} {    global brb_msg oldreplytime botnick    set replytime [unixtime]    if {[expr {$replytime - $oldreplytime}]  &gt; 7} {       set brb_rmsg [lindex $brb_msg [rand [llength $brb_msg]]]       puthelp "PRIVMSG $dest :[subst -nocommands $brb_rmsg]"       set oldreplytime $replytime    } } set oldreplytime 0 </code></pre></div>no proc within proc. but it's working <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=12376">ahlan</a> — Tue Apr 15, 2014 10:31 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ahlan]]></name></author>
		<updated>2014-04-15T09:55:52-04:00</updated>

		<published>2014-04-15T09:55:52-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102741#p102741</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102741#p102741"/>
		<title type="html"><![CDATA[run command from another proc command ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102741#p102741"><![CDATA[
wow you're cool, heartbroken, call proc within proc solved.<br><br>but for slap respon, botnick still send msg twice:<blockquote class="uncited"><div><span style="color:indigo">* ahlan slaps severus around a bit with a large trout</span><br>&lt;mybotnick&gt; hai, ahlan, miss me?<br>&lt;mybotnick&gt; hei ahlan, do not slap me<br><span style="color:indigo">* ahlan slaps severus</span><br>&lt;mybotnick&gt; ish..., ahlan slapping me<br>&lt;mybotnick&gt; ish..., <span style="color:red">$nick</span> slapping me</div></blockquote>i add "return 1" after:<div class="codebox"><p>Code: </p><pre><code>  if {[string match "slaps $botnick*" $text]} {      puthelp "PRIVMSG $dest :[subst -nocommands $repact]"      return 1   } elseif {[string match "bbl*" $text] || [string match "brb*" $text]} { next line ....</code></pre></div>and i'ts work! bot send msg on channel once. it's that ok? coz i don't know what's mean return 1. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"><br><br>And where: <div class="codebox"><p>Code: </p><pre><code>bind pubm - *brb* brb_speakbind pubm - *bbl* brb_speak</code></pre></div>because the point is I want to capture the event either through ACTION or a regular message, with the same bot. response.<br><br>Thx again for your advice<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12376">ahlan</a> — Tue Apr 15, 2014 9:55 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[heartbroken]]></name></author>
		<updated>2014-04-15T02:52:39-04:00</updated>

		<published>2014-04-15T02:52:39-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102740#p102740</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102740#p102740"/>
		<title type="html"><![CDATA[run command from another proc command ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102740#p102740"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>set actReplies {    {hei $nick, do not slap me}    {ish..., $nick slapping me}    {hai, $nick, miss me?}  }  bind ctcp - ACTION rep_act  proc rep_act {nick uhost hand dest key text} {    global botnick actReplies    set repact [lindex $actReplies [rand [llength $actReplies]]]    if {$dest eq $botnick &amp;&amp; ![validchan $dest]} { return 0 }    if {[string match "slaps $botnick*" $text]} {       puthelp "PRIVMSG $dest :[subst -nocommands $repact]"    } elseif {[string match "bbl*" $text] || [string match "brb*" $text]} {       brb_speak $nick $dest    }  }  set brb_msg {    {okay, $nick}    {$nick, dont take so long}    {hope you not back, $nick}    {$botnick, waiting 4 ya}  }   proc brb_speak {nick dest} {     global brb_msg oldreplytime botnick     set replytime [unixtime]     if {[expr {$replytime - $oldreplytime}]  &gt; 7} {        set brb_rmsg [lindex $brb_msg [rand [llength $brb_msg]]]        puthelp "PRIVMSG $dest :[subst -nocommands $brb_rmsg]"        set oldreplytime $replytime     }  }  set oldreplytime 0 </code></pre></div>  have phun ...<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11703">heartbroken</a> — Tue Apr 15, 2014 2:52 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ahlan]]></name></author>
		<updated>2014-04-15T01:20:13-04:00</updated>

		<published>2014-04-15T01:20:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102739#p102739</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102739#p102739"/>
		<title type="html"><![CDATA[run command from another proc command ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102739#p102739"><![CDATA[
I have similar problem to fix. I get some script to modified, please help me. (i'm sorry for my bad english)<div class="codebox"><p>Code: </p><pre><code>set actReplies {  {hei $nick, do not slap me}  {ish..., $nick slapping me}  {hai, $nick, miss me?}}bind ctcp - ACTION rep_actproc rep_act {nick uhost hand chan keyword arg} {  global botnick actReplies  set repact [lindex $actReplies [rand [llength $actReplies]]]  if {![validchan $chan]} {return 0}  if {[string match "slaps $botnick*" $arg]} {     puthelp "PRIVMSG $chan :[subst $repact]"  }  elseif {[string match "bbl*" $arg] || [string match "brb*"]} {     [brb_speak $nick $uhost $handle $chan $args]  }}set brb_msg {  {okay, $nick}  {$nick, dont take so long}  {hope you not back, $nick}  {$botnick, waiting 4 ya}}bind pubm - *brb* brb_speakbind pubm - *bbl* brb_speakproc brb_speak {nick uhost handle chan args} {   global ini_msg oldreplytime botnick   set replytime [unixtime]   if { $replytime - $oldreplytime  &gt; 7} {      set brb_rmsg [lindex $brb_msg [rand [llength $brb_msg]]]      puthelp "PRIVMSG $chan :[subst $brb_rmsg]"      set oldreplytime $replytime   }}set oldreplytime 0</code></pre></div>To call procedure 'brb_speak' i write:<div class="codebox"><p>Code: </p><pre><code>[brb_speak $nick $uhost $handle $chan $args]</code></pre></div>result if slaps botnick without any word after<blockquote class="uncited"><div><span style="color:darkred">-mybot- Rehashing...</span><br><span style="color:indigo">* ahlan slaps severus</span><br>&lt;mybot&gt; hei ahlan, do not slap me<br>&lt;mybot&gt; ish..., <span style="color:red">$nick</span> slapping me</div></blockquote>result if i slaps botnick with any word after (working):<blockquote class="uncited"><div><span style="color:indigo">* ahlan slaps severus with</span><br>&lt;mybot&gt; hai, ahlan, miss me?</div></blockquote>brb action result: <blockquote class="uncited"><div><span style="color:indigo">* ahlan bbl</span><br>no reply from bot</div></blockquote>How do i fix thoose?<br>thx for advice<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12376">ahlan</a> — Tue Apr 15, 2014 1:20 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2011-03-10T16:16:33-04:00</updated>

		<published>2011-03-10T16:16:33-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96440#p96440</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96440#p96440"/>
		<title type="html"><![CDATA[run command from another proc command ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96440#p96440"><![CDATA[
Trixar:<br>Well done on the comments, though you're slightly off on the brackets...<br>Brackets are used for command substitutions, thus they are only needed when you'd like to take some further actions with the return value.<br>In this case it would mean that you try to execute the return value of "totest" as a new command, harmless as "totest" doesn't return anything in this case, but could easily get very nasty.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Thu Mar 10, 2011 4:16 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Trixar_za]]></name></author>
		<updated>2011-03-09T21:26:41-04:00</updated>

		<published>2011-03-09T21:26:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96430#p96430</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96430#p96430"/>
		<title type="html"><![CDATA[run command from another proc command ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96430#p96430"><![CDATA[
Do you know mIRC scripting? Well, take procs as an alias, because they function about the same. <br><br>Basically, you use the proc to create a custom 'command' or 'function' you want the script to use.<br><br>So to use your example, let's create script that works like you wanted:<div class="codebox"><p>Code: </p><pre><code># Some Example code for you and comments to go with it ;)# First let's bind the command properlybind pub - .loltest loltest# Now let's bind the test command, but let's make it a little more flexiable# Note how I left out nick, host, handle, chan and stuff and is only using# channel - this could be anything, but it makes more sense since that# variable will hold the channel - but more on this later. Just know that it# will now work in any channel that the bot is in when somebody# uses the .loltest command.proc totest {channel} {    puthelp "PRIVMSG $channel :this is a simple little test :D"}#Ok, now for the proc that gets called by the .loltest command.# Remember that the previous proc works like a command and just# like if or any other command (like string, etc) it needs to be called# in [] brackets - also note that since this is the proc called by the public # bind, we MUST include the standard variables nick, host, handle and# chan. Ok, now we're going to call the previous proc, but remember# that since it requires an channel variable, we MUST provide it when# the command is called with the [] brackets.proc loltest {nick host handle chan arg} {    [totest $chan]} </code></pre></div> And tada, it should be working now - sorry about the verbose comments, but they explain the basics.<br><br>Hope that helps <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10958">Trixar_za</a> — Wed Mar 09, 2011 9:26 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Gemster]]></name></author>
		<updated>2011-03-09T20:27:24-04:00</updated>

		<published>2011-03-09T20:27:24-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96429#p96429</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96429#p96429"/>
		<title type="html"><![CDATA[run command from another proc command ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96429#p96429"><![CDATA[
Hi,<br><br>Ill try to explain this the best i can.<br><div class="codebox"><p>Code: </p><pre><code>proc totest {nick host handle chan arg} {puthelp "PRIVMSG ###1 : this is a simple little test :D"}bind pub - ".loltest" loltestproc loltest {nick host handle chan arg} {totest}</code></pre></div>When i type ".loltest" in channel ###1 i want the bot to run the command "proc totest"<br><br>Thanks<br>Gemser<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11375">Gemster</a> — Wed Mar 09, 2011 8:27 pm</p><hr />
]]></content>
	</entry>
	</feed>
