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

	<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>2015-05-03T18:48:55-04:00</updated>

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

		<entry>
		<author><name><![CDATA[juanamores]]></name></author>
		<updated>2015-05-03T18:48:55-04:00</updated>

		<published>2015-05-03T18:48:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=104012#p104012</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=104012#p104012"/>
		<title type="html"><![CDATA[BIND PUB and BIND MSGM args]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=104012#p104012"><![CDATA[
I have a code that lists the help commands the bot.<br>To execute the command channel (for full list commands) is: <blockquote class="uncited"><div>!commands</div></blockquote>To execute the command channel (for full particular command) is: <blockquote class="uncited"><div>!commands &lt;command&gt;</div></blockquote>For private messages is (for full list commands) : <blockquote class="uncited"><div>commands</div></blockquote>But, not works for messages: <blockquote class="uncited"><div>commands &lt;command&gt;</div></blockquote> <br><br>How do you, for boT interpret the event MSGM arguments after the command text?<br>Just accept me the command without arguments, that is, the command that displays a list of available commands of the bot, but does not allow me to show support for a particular command, running the <em class="text-italics">SWITCH</em> command .<br><br><span style="text-decoration:underline">Example of part code</span> (the commands list is very long to put it all):<div class="codebox"><p>Code: </p><pre><code>##default prefix !, You can replace it##set prefix "!"set canal_radio #chann1 set canal_djs #chann2set canal_admin #chann3bind pub oa|n [string trim $prefix]commands pub:helpbind msgm oa|n commands pub:helpproc pub:help {nick uhost hand chan args} {global botnick prefix canal_admin canal_djsset args [split [cleanarg $args]]if {(![matchattr $nick a|n]) &amp;&amp; ([matchattr $nick +o])} {if {[llength $args]&lt;1} {putmsg $nick "Commands list for Administrators"putmsg $nick [encoding convertfrom utf-8 " - [string trim $prefix]comm1 - task xxx perform "]putmsg $nick [encoding convertfrom utf-8 " - [string trim $prefix]comm2 - task xxx perform "]putmsg $nick [encoding convertfrom utf-8 " - [string trim $prefix]comm3 - task xxx perform "]### ....More help command.............###} else {if {[string index $args 0] == "$prefix"} { set args [string trimleft $args $prefix] }set lines [comm1 comm2 comm3]if {([lsearch -exact [string tolower $lines] $args] == -1)} { putmsg $chan "$nick Sorry I have no help for that command. \002$args.";return } switch [lindex $args 0] {"comm1" {putmsg $nick "\002\0036&lt;===--- !comm1 ---===&gt;\0036\002"putmsg $nick "Usage: [string trim $prefix]comm1 &lt;nick Dj&gt;"putmsg $nick "Usage channels: $canal_admin and $canal_djs"putmsg $nick [encoding convertfrom utf-8 "Function: xxxxxxx"]putmsg $nick "\002\0036&lt;===--- End help comannd !comm1 ---===&gt;\0036\002"}"comm2" {putmsg $nick "\002\0036&lt;===--- !comm2 ---===&gt;\0036\002"putmsg $nick "Usage: [string trim $prefix]comm2 &lt;#channel&gt;"putmsg $nick "Usage channels: $canal_admin and $canal_djs"putmsg $nick [encoding convertfrom utf-8 "Function: xxxxxxx"]putmsg $nick "\002\0036&lt;===--- End help comannd !comm2 ---===&gt;\0036\002"}"comm3" {putmsg $nick "\002\0036&lt;===--- !comm3 ---===&gt;\0036\002"putmsg $nick "Usage: [string trim $prefix]comm3 &lt;nick&gt;"putmsg $nick "Usage channels: $canal_admin and"putmsg $nick [encoding convertfrom utf-8 "Function: xxxxxxx"]putmsg $nick "\002\0036&lt;===--- End help comannd !comm3 ---===&gt;\0036\002"}}}} else {if {[llength $args]&lt;1} {putmsg $nick "Commands list for Roots"putmsg $nick [encoding convertfrom utf-8 " - [string trim $prefix]comm1 - task xxx perform "]putmsg $nick [encoding convertfrom utf-8 " - [string trim $prefix]comm2 - task xxx perform "]putmsg $nick [encoding convertfrom utf-8 " - [string trim $prefix]comm3 - task xxx perform "]### ....More help command.............###} else {if {[string index $args 0] == "$prefix"} { set args [string trimleft $args $prefix] }set lines [comm1 comm2 comm3]if {([lsearch -exact [string tolower $lines] $args] == -1)} { putmsg $chan "$nick Sorry I have no help for that command. \002$args.";return } switch [lindex $args 0] {"comm1" {putmsg $nick "\002\0036&lt;===--- !comm1 ---===&gt;\0036\002"putmsg $nick "Usage: [string trim $prefix]comm1 &lt;nick Dj&gt;"putmsg $nick "Usage channels: $canal_admin and $canal_djs"putmsg $nick [encoding convertfrom utf-8 "Function: xxxxxxx"]putmsg $nick "\002\0036&lt;===--- End help comannd !comm1 ---===&gt;\0036\002"}"comm2" {putmsg $nick "\002\0036&lt;===--- !comm2 ---===&gt;\0036\002"putmsg $nick "Usage: [string trim $prefix]comm2 &lt;#channel&gt;"putmsg $nick "Usage channels: $canal_admin and $canal_djs"putmsg $nick [encoding convertfrom utf-8 "Function: xxxxxxx"]putmsg $nick "\002\0036&lt;===--- End help comannd !comm2 ---===&gt;\0036\002"}"comm3" {putmsg $nick "\002\0036&lt;===--- !comm3 ---===&gt;\0036\002"putmsg $nick "Usage: [string trim $prefix]comm3 &lt;nick&gt;"putmsg $nick "Usage channels: $canal_admin and"putmsg $nick [encoding convertfrom utf-8 "Function: xxxxxxx"]putmsg $nick "\002\0036&lt;===--- End help comannd !comm3 ---===&gt;\0036\002"}}}}}proc cleanarg {arg} { set temp ""for {set i 0} {$i &lt; [string length $arg]} {incr i} {  set char [string index $arg $i]  if {($char != "\12") &amp;&amp; ($char != "\15")} {   append temp $char  } } set temp [string trimright $temp "\}"] set temp [string trimleft $temp "\{"]return $temp}</code></pre></div><strong class="text-strong">EDIT:</strong> Add to end processes that I forgot to put code before.<br><strong class="text-strong">EDIT2:</strong> Translate variable name 'prefijo' to English 'prefix'.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12499">juanamores</a> — Sun May 03, 2015 6:48 pm</p><hr />
]]></content>
	</entry>
	</feed>
