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

	<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>2013-01-16T20:17:58-04:00</updated>

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

		<entry>
		<author><name><![CDATA[MasterScript]]></name></author>
		<updated>2013-01-16T20:17:58-04:00</updated>

		<published>2013-01-16T20:17:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=100618#p100618</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=100618#p100618"/>
		<title type="html"><![CDATA[Need help change command]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=100618#p100618"><![CDATA[
i have a tcl script to check access<br>Public command /msg botnet access #chan nick<br>For example: /msg botnet access #bots MasterScript<br><br>I need some help to change this to /msg botnet access nick<br>For example: /msg botnet access MasterScript<br><br>It means remove chan.<br><br>There is the tcl script:<br><br><strong class="text-strong">access</strong><br><div class="codebox"><p>Code: </p><pre><code>proc do_access {nick chan msbots1 host} {  # This proc MUST be kept as streamlined as possible  global home botnick bcast  if {![validchan $chan]} {    putquick "NOTICE $nick :\0034ERROR: \002$chan\002 is not a registered channel."    return 0  } elseif {$msbots1 == ""} {    putquick "NOTICE $nick :\0034ERROR: Please use: \002(/msg) $botnick access &lt;#channel&gt; &lt;nick&gt;\002"    return 0  } elseif {![onchan $msbots1 $chan]} {    putquick "NOTICE $nick :\0034ERROR: \002$msbots1\002 isn't in $chan"    return 0  }  if {[validuser $msbots1]} {    set hand2 $msbots1    set hand3 [nick2hand $hand2 $chan]  } elseif {[validuser [nick2hand $msbots1 $chan]]} {    set hand2 $msbots1    set hand3 [nick2hand $hand2 $chan]  } else {    putquick "NOTICE $nick :\0034ERROR: \002$msbots1\002 is not a valid user."    return 0  }  set access "N/A"  # Default global access to null string for use later on    set gaccess ""   if {[matchattr $hand3 |v $chan]} {    set access "Automatically Voiced"  } elseif {[matchattr $hand3 |a $chan]} {    set access "Automatic Operator"  } elseif {[matchattr $hand3 |o $chan]} {    set access "Channel Operator"  } elseif {[matchattr $hand3 |m $chan]} {    set access "Channel Co-Administrator"  } elseif {[matchattr $hand3 |n $chan]} {    set access "Channel Administrator"  } elseif {[matchattr $hand3 n]} {    set gaccess "Bot Administrator"  } elseif {[matchattr $hand3 m]} {    set gaccess "Botnet Co-Administrator"  } elseif {[matchattr $hand3 o]} {    set gaccess "Botnet Operator"  }  set rhosts [getuser $hand3 HOSTS]  set comment [getchaninfo $hand3 $chan]  putlog "!$nick ($host)! access $chan $hand3"  if {$bcast == "1"} {    putquick "PRIVMSG $home :$nick!$host requested to see access for $hand3 on $chan ..showing..."     }  putquick "NOTICE $nick :\002Nickname:\002 \00312$hand2"  putquick "NOTICE $nick :\002Handle:\002 \00312$hand3"  putquick "NOTICE $nick :\002Access in $chan:\002 \00312$access"  putquick "NOTICE $nick :\002Comment:\002 \00312$comment"  putquick "NOTICE $nick :\002Remote Hostnames:\002 \00312$rhosts"   if {[matchattr $hand3 D]} {    putquick "NOTICE $nick :\0033\002$hand2\002\0034 is a disabled user."    return 0    }  # Now display global permissions if anoy  if {$gaccess != ""} {    putquick "NOTICE $nick :\002Global Permissions:\002\00312 $gaccess"  }  return 0}</code></pre></div><br><strong class="text-strong">Check Access</strong><br><div class="codebox"><p>Code: </p><pre><code>proc checkaccess {hand1 chan hand2} {  set hand1lev 0  set hand2lev 0        if {[matchattr $hand1 |a $chan]} {    set hand1lev 1  }  if {[matchattr $hand1 |v $chan]} {    set hand1lev 2  }   if {[matchattr $hand1 |o $chan]} {    set hand1lev 3  }     if {[matchattr $hand1 |m $chan]} {    set hand1lev 4  }  if {[matchattr $hand1 |n $chan]} {    set hand1lev 5  }  if {[matchattr $hand1 o]} {    set hand1lev 6  }  if {[matchattr $hand1 m]} {    set hand1lev 7  }  if {[matchattr $hand1 n]} {    set hand1lev 8  }  if {[matchattr $hand2 |a $chan]} {    set hand2lev 1  }       if {[matchattr $hand2 |v $chan]} {    set hand2lev 2  }  if {[matchattr $hand2 |o $chan]} {    set hand2lev 3  }  if {[matchattr $hand2 |m $chan]} {    set hand2lev 4  }  if {[matchattr $hand2 |n $chan]} {    set hand2lev 5  }  if {[matchattr $hand2 o]} {    set hand2lev 6  }  if {[matchattr $hand2 m]} {    set hand2lev 7  }  if {[matchattr $hand2 n]} {    set hand2lev 8  }  set result [expr $hand1lev - $hand2lev]  if {$result == -1 } { return 0 }  if {$result == -2 } { return 0 }  if {$result == -3 } { return 0 }  if {$result == -4 } { return 0 }  if {$result == -5 } { return 0 }  return $result}</code></pre></div><strong class="text-strong">Msg Access</strong><br><div class="codebox"><p>Code: </p><pre><code>proc msg:access {nick host handle arg} {  global botnick  # Argument = channel  set argument [lindex $arg 0]  if {[string match "#*" $argument]} {    if {[validchan $argument]} {      set chan $argument      set msbots1 [lindex $arg 1]    } else {      putquick "NOTICE $nick :\0034ERROR - This bot is not in $argument."      return 0    }  } else {    putquick "NOTICE $nick :\0034ERROR - You need to specify a channel."    return 0  }  do_access $nick $chan $msbots1 $host  return 0}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6140">MasterScript</a> — Wed Jan 16, 2013 8:17 pm</p><hr />
]]></content>
	</entry>
	</feed>
