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

	<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-07-30T21:20:46-04:00</updated>

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

		<entry>
		<author><name><![CDATA[demond]]></name></author>
		<updated>2005-07-30T21:20:46-04:00</updated>

		<published>2005-07-30T21:20:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=53550#p53550</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=53550#p53550"/>
		<title type="html"><![CDATA[Member Management List Help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=53550#p53550"><![CDATA[
*sigh*<br><br>another shining example of how not to handle data &amp; files<br><br>anyway:<div class="codebox"><p>Code: </p><pre><code>proc adddcc {hand idx arg} {  global backupfile addcmd nick time dateset time1 [ctime [unixtime]]  if {$arg != ""} {    set fsw [open $backupfile a+]    seek $fsw start    set argword [lindex [split $arg] 0]    while {![eof $fsw]} {      set fileword [lindex [split [gets $fsw]] 0]      if {[string eq -noc $fileword $argword]} {        putdcc $idx "$argword is already there"        close $fsw        return 0      }          }    puts $fsw "$arg added by $nick on $time1"    close $fsw    putlog "$arg has been added"  } else {    putlog "You have to put something after $addcmd"  }  return 0} </code></pre></div>I hope you can figure out the other 2 add procs yourself<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5056">demond</a> — Sat Jul 30, 2005 9:20 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Kraka]]></name></author>
		<updated>2005-07-30T20:17:25-04:00</updated>

		<published>2005-07-30T20:17:25-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=53548#p53548</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=53548#p53548"/>
		<title type="html"><![CDATA[Member Management List Help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=53548#p53548"><![CDATA[
I have this script and I was wondering what code I would have to put in to make it check the list to make sure the nick that is being added isn't already on the list and if it is to announce it.  The command is like !addmem &lt;nick&gt; &lt;posistion&gt;<br>so the list is like:<br>Nick1 OP<br>Nick2 Voice<br>I want it to just check for the nick and not the posistion.  If anyone can help that would be great.  Here is the code to the part that I already have:<br><br><div class="codebox"><p>Code: </p><pre><code>######################################################################################################################   Info : This tcl is made for shell provider         ####   You can Add Staff, Del Staff, View Staff,          ####   View URL and View Uptime.                          ####                                                      ####   Programmer : AcADIeN on Efnet (#hands)             ####   Email : admin@tohands.org                          ####   Website : http://www.tohands.org                   #############################################################Bugs from older version:                               ###   Uptime reply didn't do the right job                ############################################################# channel where it's workingset chan "#channel"# backupfile is the place where the data will be saveset backupfile "/home/user/eggdrop/provider.txt"# FLAG# who can do the addcommand (give me a flag)set adminflag "X"# this is the command# if you set the msg in dcc... the command will have a "." in front# if you set it in PRIVATE MSG or CHANNEL... the command will have a "!" in front# Like add if you set the addmsg in DCC... you have to use ".add" but if you set# in PRIVATE or CHANNEL... you have to use "!add"## understand?? if not well use another scriptset addcommand "addmem"set delcommand "delmem"set staffcommand "members"# addmsg,delmsg,uptimemsg,staffmsg and urlmsg is where the addcommand will work# 0 = in DCC# 1 = in PRIVATE MSG# 2 = in CHANNELset addmsg "2"set delmsg "2"set staffmsg "2"        # uptimereply,staffreply and urlreply is where the uptimecommand will reply# Public option will do the same thing as PRIVATEMSG if the msg command (below) # is set to PRIVATE MSG# 0 = in PRIVATE MSG# 1 = in PRIVATE NOTICE# 2 = Public set staffreply "0" #################################################### DO NOT CHANGE ANYTHING AFTER THIS LINE ####################################################if {$addmsg == 0} {  set addbind dcc  set addcmd "$addcommand"} elseif {$addmsg == 1} {  set addbind msg  set addcmd "!$addcommand"} else {              set addbind pub  set addcmd "!$addcommand"}                       bind $addbind $adminflag $addcmd add$addbindif {$delmsg == 0} {  set delbind dcc  set delcmd "$delcommand"} elseif {$delmsg == 1} {  set delbind msg  set delcmd "!$delcommand"} else {              set delbind pub  set delcmd "!$delcommand"}                       bind $delbind $adminflag $delcmd del$delbindif {$staffmsg == 0} {  set staffbind dcc  set staffcmd "$staffcommand"} elseif {$staffmsg == 1} {  set staffbind msg  set staffcmd "!$staffcommand"} else {              set staffbind pub  set staffcmd "!$staffcommand"}                       bind $staffbind - $staffcmd staff$staffbindproc adddcc {hand idx arg} {  global backupfile addcmd nick time dateset time1 [ctime [unixtime]]  if {$arg != ""} {    set fsw [open $backupfile a+]    puts $fsw "$arg added by $nick on $time1"    close $fsw    putlog "$arg has been added"  } else {    putlog "You have to put something after $addcmd"  }  return 0} proc addmsg {nick uhost hand arg} {           global backupfile addcmd time dateset time1 [ctime [unixtime]]  if {$arg != ""} {    set fsw [open $backupfile a+]    puts $fsw "$arg added by $nick on $time1"    close $fsw    putserv "PRIVMSG $nick :$arg has been added"  } else {    putserv "PRIVMSG $nick :You have to put something after $addcmd"  }  return 0}proc addpub {nick uhost handle channel arg} {  global backupfile addcmd chan time dateset time1 [ctime [unixtime]]  if {$chan == $channel} {    if {$arg != ""} {      set fsw [open $backupfile a+]      puts $fsw "$arg added by $nick on $time1"      close $fsw      putserv "PRIVMSG $channel :$arg has been added"    } else {      putserv "PRIVMSG $channel :You have to put something after $addcmd"    }  }  return 0}proc staffdcc {hand idx arg} {  global backupfile  set fs [open $backupfile r]  putlog "Members are :"  while {![eof $fs]} {    gets $fs line    putlog "$line"  }  close $fs  return 0}                                      proc staffmsg {nick uhost hand arg} {  global backupfile staffreply  set fs [open $backupfile r]  if {$staffreply == 0 || $staffreply == 2} {    putserv "PRIVMSG $nick :Members are :"  } else {    putserv "NOTICE $nick :Members are:"  }  while {![eof $fs]} {    gets $fs line    if {$staffreply == 0 || $staffreply == 2} {      putserv "PRIVMSG $nick :$line"    } else {      putserv "NOTICE $nick :$line"    }  }  close $fs  return 0}proc staffpub {nick uhost handle channel arg} {  global backupfile staffreply chan  if {$chan == $channel} {    set fs [open $backupfile r]    if {$staffreply == 0} {      putserv "PRIVMSG $nick :Members are :"    } elseif {$staffreply == 1} {      putserv "NOTICE $nick :Members are:"    } else {      putserv "PRIVMSG $channel :Members are:"    }    while {![eof $fs]} {      gets $fs line      if {$staffreply == 0} {        putserv "PRIVMSG $nick :$line"      } elseif {$staffreply == 1} {        putserv "NOTICE $nick :$line"      } else {        putserv "PRIVMSG $channel :$line"      }    }    close $fs  }  return 0}proc deldcc {hands idx arg} {  global backupfile delcmd  if {$arg != ""} {    set infile [open $backupfile r]    set outfile [open $backupfile.tmp w]    set find 0     while {![eof $infile]} {      gets $infile line      if {![string match [string tolower $arg]* [string tolower $line]]} {        puts $outfile $line            } else {        set find 1       }    }    close $infile    close $outfile       if {$find == 1} {                  file rename -force $backupfile.tmp $backupfile      putlog "$arg is deleted"    } else {                     putlog "$arg not found"                   }  } else {    putlog "You have to put something after $delcmd"  }  return 0}proc delmsg {nick uhost hand arg} {  global backupfile delcmd  if {$arg != ""} {    set infile [open $backupfile r]    set outfile [open $backupfile.tmp w]    set find 0     while {![eof $infile]} {      gets $infile line      if {![string match [string tolower $arg]* [string tolower $line]]} {      puts $outfile $line            } else {      set find 1       }    }    close $infile    close $outfile       if {$find == 1} {                  file rename -force $backupfile.tmp $backupfile      putserv "PRIVMSG $nick :$arg is deleted"    } else {                     putserv "PRIVMSG $nick :$arg not found"                   }  } else {    putserv "PRIVMSG $nick :You have to put something after $delcmd"  }  return 0}proc delpub {nick uhost handle channel arg} {  global backupfile delcmd chan  if {$chan == $channel} {    if {$arg != ""} {      set infile [open $backupfile r]      set outfile [open $backupfile.tmp w]      set find 0       while {![eof $infile]} {        gets $infile line        if {![string match [string tolower $arg]* [string tolower $line]]} {          puts $outfile $line              } else {          set find 1         }      }      close $infile      close $outfile         if {$find == 1} {                    file rename -force $backupfile.tmp $backupfile        putserv "PRIVMSG $channel :$arg is deleted"      } else {                       putserv "PRIVMSG $channel :$arg not found"                     }    } else {      putserv "PRIVMSG $channel :You have to put something after $delcmd"    }  }  return 0} putlog "provider.tcl v0.7.1 by AcADIeN (http://www.tohands.org)"</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6124">Kraka</a> — Sat Jul 30, 2005 8:17 pm</p><hr />
]]></content>
	</entry>
	</feed>
