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

	<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-01-24T00:05:36-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Alchera]]></name></author>
		<updated>2005-01-24T00:05:36-04:00</updated>

		<published>2005-01-24T00:05:36-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=45768#p45768</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=45768#p45768"/>
		<title type="html"><![CDATA[Deleting all users in a userfile]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=45768#p45768"><![CDATA[
<blockquote class="uncited"><div><div class="codebox"><p>Code: </p><pre><code>foreach user [userlist] { if {![matchattr $user n]} { deluser $user }}</code></pre></div>Would delete all users except the owners. :\</div></blockquote>I have been toying with the above and have so far come up with the following:<div class="codebox"><p>Code: </p><pre><code>set userdel(trigger) "$::botnick"set cmdchar_ "!"proc cmdchar { } {global cmdchar_; return $cmdchar_}bind pub - [cmdchar]$userdel(trigger) pub_userdelproc pub_userdel {nick uhost hand chan rest} {    global userdel    set rest [stripcodes bcruag $rest]    if {![matchattr $hand n]} {sendnotc "notice $nick :I don't like you."; return}    set cmd [strlwr [lindex $rest 0]]    if {[string match {userdel} $cmd]} {        set thechan [strlwr [lindex $rest 1]]        if {$thechan != ""} {            set thechan [chanaddapt $thechan]        } elseif {$thechan == ""} {            set thechan $chan        }        if {![validchan $thechan]} {sendnotc "notice $nick :I'm not on $thechan."; return}        sendnotc "notice $nick :\002***\002 Deleting user list of $thechan \002***"            if {[userlist $thechan] == ""} {    sendnotc "notice $nick :No Entries."    } else {    foreach user [userlist |nmov $thechan] {        if {[matchattr $user bof]} { continue }    deluser $user            }}sendnotc "notice $nick :\002*** Users deleted! ***"    } else {sendnotc "notice $nick :Error! Use: $::cmdchar_$userdel(trigger) userdel \[channel\]."; return}}# chanaddapt - checks channel name and adds # if needed.proc chanaddapt {chan} {if {[string index $chan 0] != "#" &amp;&amp; [string index $chan 0] != "&amp;"} {set newchan #$chanreturn $newchan}return $chan}# end chanaddaptproc sendnotc {text} {    putquick "$text"}</code></pre></div>Now, although the above works as expected, what I would really like to be able to do is delete the users of a particular channel without having to rely on flags i.e after the bot has been removed from a channel. I would also like to be able to do the flag checking bit if the bot is still in the targeted channel.<br><br>I've been running around in circles trying to achieve this to no avail.<br><br>Is it possible?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3646">Alchera</a> — Mon Jan 24, 2005 12:05 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[metroid]]></name></author>
		<updated>2005-01-14T07:31:44-04:00</updated>

		<published>2005-01-14T07:31:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=45384#p45384</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=45384#p45384"/>
		<title type="html"><![CDATA[Deleting all users in a userfile]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=45384#p45384"><![CDATA[
oops, didn't see this was an old topic. I haven't logged in awhile it seems :p<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5078">metroid</a> — Fri Jan 14, 2005 7:31 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[metroid]]></name></author>
		<updated>2005-01-14T07:30:37-04:00</updated>

		<published>2005-01-14T07:30:37-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=45382#p45382</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=45382#p45382"/>
		<title type="html"><![CDATA[Deleting all users in a userfile]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=45382#p45382"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>foreach user [userlist] { if {![matchattr $user n]} { deluser $user }}</code></pre></div>Would delete all users except the owners. :\<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5078">metroid</a> — Fri Jan 14, 2005 7:30 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[kic]]></name></author>
		<updated>2005-01-12T12:14:27-04:00</updated>

		<published>2005-01-12T12:14:27-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=45320#p45320</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=45320#p45320"/>
		<title type="html"><![CDATA[Deleting all users in a userfile]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=45320#p45320"><![CDATA[
<blockquote class="uncited"><div>That's totally deleting the user file and creating a new one. I think no one would do that, because they would have to add themselves, their flags etc and owner settings back in again. Only remove all the other users, except yourself which is obvious. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"></div></blockquote>You do not have to add yourself, flags, owner status, etc.<br>When you /msg the bot hello again it will do all of that for you automatically.<br><br>His question was how to delete ALL of the users in the userfile, and that is the best way to do it.<br><br>regards,<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5874">kic</a> — Wed Jan 12, 2005 12:14 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2005-01-12T05:53:58-04:00</updated>

		<published>2005-01-12T05:53:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=45303#p45303</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=45303#p45303"/>
		<title type="html"><![CDATA[Deleting all users in a userfile]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=45303#p45303"><![CDATA[
That's totally deleting the user file and creating a new one. I think no one would do that, because they would have to add themselves, their flags etc and owner settings back in again. Only remove all the other users, except yourself which is obvious. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Wed Jan 12, 2005 5:53 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[kic]]></name></author>
		<updated>2005-01-11T17:35:52-04:00</updated>

		<published>2005-01-11T17:35:52-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=45285#p45285</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=45285#p45285"/>
		<title type="html"><![CDATA[Re: Deleting all users in a userfile]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=45285#p45285"><![CDATA[
<blockquote class="uncited"><div>Is there a way to mass delete ALL the users in the userfile? I don't want to do 160 deletes seperate because some idiot didn't know what he was doing?</div></blockquote>1.) connect to your shell account.<br>2.) bring your bot offline with: .die  in dcc chat<br>3.) locate your bots userfile on your shell<br>3.) delete the userfile altogether: rm -rf userfile<br>4.) restart your bot with the -m switch<br>5.) go to IRC and msg your bot 'hello' <br><br>You will now have a clean userfile, with you being the only user on the box. This is cleaner than opening the userfile directly with pico and removing lines, and then overwriting. You will avoid possible file corruption this way.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5874">kic</a> — Tue Jan 11, 2005 5:35 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Alchera]]></name></author>
		<updated>2005-01-10T08:06:31-04:00</updated>

		<published>2005-01-10T08:06:31-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=45229#p45229</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=45229#p45229"/>
		<title type="html"><![CDATA[Deleting all users in a userfile]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=45229#p45229"><![CDATA[
<blockquote class="uncited"><div>I don't want to do 160 deletes seperate because some idiot didn't know what he was doing?</div></blockquote>Miss something? No one in their right mind would want to sit down and do that rubbish "manually". <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3646">Alchera</a> — Mon Jan 10, 2005 8:06 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2005-01-09T23:05:24-04:00</updated>

		<published>2005-01-09T23:05:24-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=45211#p45211</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=45211#p45211"/>
		<title type="html"><![CDATA[Deleting all users in a userfile]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=45211#p45211"><![CDATA[
Or you can also do it manually which I prefer. Kill the bot at first. In the shell dir /eggdrop open up the .user file, via pico or download it onto your hard disk. <br><br>Delete all the lines which say --HOSTS as well the ones which mention the users flags and handles. Then upload the file back, or if you are doing it on your shell save it via pico or the editor you are using. Reload the bot back in the background and DCC to it and type .save, that should do it manually.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Sun Jan 09, 2005 11:05 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[demond]]></name></author>
		<updated>2005-01-08T13:05:44-04:00</updated>

		<published>2005-01-08T13:05:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=45205#p45205</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=45205#p45205"/>
		<title type="html"><![CDATA[Deleting all users in a userfile]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=45205#p45205"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>.tcl foreach u [userlist] {if {$u != "yourbothandle"} {deluser $u}}.save</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5056">demond</a> — Sat Jan 08, 2005 1:05 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stevegarbz]]></name></author>
		<updated>2005-01-08T12:57:16-04:00</updated>

		<published>2005-01-08T12:57:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=45204#p45204</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=45204#p45204"/>
		<title type="html"><![CDATA[Deleting all users in a userfile]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=45204#p45204"><![CDATA[
Is there a way to mass delete ALL the users in the userfile? I don't want to do 160 deletes seperate because some idiot didn't know what he was doing?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5732">stevegarbz</a> — Sat Jan 08, 2005 12:57 pm</p><hr />
]]></content>
	</entry>
	</feed>
