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

	<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>2002-09-25T23:28:10-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2002-09-25T23:28:10-04:00</updated>

		<published>2002-09-25T23:28:10-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=11390#p11390</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=11390#p11390"/>
		<title type="html"><![CDATA[Coolness...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=11390#p11390"><![CDATA[
I just thought you might like to see the final code that is currently in production...<div class="codebox"><p>Code: </p><pre><code># Location to save filesset location "/home/ircadmin/MonkBOT/userlists/"# Channel to watchset chan "#unrealplayground"# How often to update file in minutesset updatetime 2# Check to see if the timer is running - only needed really during a .rehashputlog "users2list.tcl v1.0 has started"if {![info exists fileusers_running]} {  timer $updatetime fileusers  set fileusers_running 1}proc fileusers {} {  global updatetime chan file location  if {![validchan $chan]} {    putlog "ERROR - users2file.tcl - I am not on $chan, so I cannot output lists"    return 1  }  set l1 [chanlist $chan]  set l2 {}  set l3 {}  foreach u $l1 {    if {[isop $u $chan]} {      lappend l3 "@"    } elseif {[isvoice $u $chan]} {      lappend l3 "+v"    } else {      lappend l3 ""    }    lappend l3 $u    lappend l3 [getchanidle $u $chan]    lappend l3 "[getchanhost $u $chan]"    lappend l2 [join $l3 {,}]    set l3 {}  }  #write the files  set fp [open "${location}${chan}.users.txt" w]  puts $fp [join $l1 {,}]  close $fp  set fp [open "${location}${chan}.status.txt" w]  puts $fp [join $l2 \n]  close $fp  #restart the timer  timer $updatetime fileusers}</code></pre></div>Works like a champ...  Thanks a ton, ppslim!<p>Statistics: Posted by Guest — Wed Sep 25, 2002 11:28 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2002-09-25T17:18:08-04:00</updated>

		<published>2002-09-25T17:18:08-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=11384#p11384</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=11384#p11384"/>
		<title type="html"><![CDATA[Simple Script Request... I think...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=11384#p11384"><![CDATA[
yes and no.<br><br>the script is used, by calling the procudure fileusers, and passing a file, and channel name.<br><br>You can simply pass the location, using the $file var.<br><br>IE.<br><br>instead of using:<br>fileusers mychan #channel<br><br>Which would create 2 files, named mychan.users and mychan.status, inside the bots directory.<br><br>You could use<br>fileusers /home/ppslim/filestore/mychan #channel<br><br>This would create 2 files<br>/home/ppslim/filestore/mychan.status<br>/home/ppslim/filestore/mychan.users<br><br>As for the catch statment. This is used mainly as a error prevention.<br><br>It would not hurt to remove this, as it is more of a standard practice for me.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Wed Sep 25, 2002 5:18 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2002-09-25T14:47:07-04:00</updated>

		<published>2002-09-25T14:47:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=11375#p11375</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=11375#p11375"/>
		<title type="html"><![CDATA[Question...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=11375#p11375"><![CDATA[
Thanks ppslim - code looks great, and I will test it this evening.  Question though...<br><div class="codebox"><p>Code: </p><pre><code>  set fp [open "${location}${chan}.users.txt" w]   puts $fp [join l1 {,}]   catch {close $fp}   set fp [open "${location}${chan}.status.txt" w]   puts $fp [join $l2 \n]   catch {close $fp} </code></pre></div>I tweaked the code a bit...  Notice the additon of the var $location.  Will it work that way?  Also...  Why did you use catch?  I would assume (maybe incorrectly) that just closing a file wouldn't cause an error...  I mean, I am glad to take your word for it - you haven't steered me wrong yet...  I'm just curious, and this is how I learn.<br><br>Thanks again for the script - I really do appreciate it.<p>Statistics: Posted by Guest — Wed Sep 25, 2002 2:47 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2002-09-25T04:54:38-04:00</updated>

		<published>2002-09-25T04:54:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=11337#p11337</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=11337#p11337"/>
		<title type="html"><![CDATA[Simple Script Request... I think...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=11337#p11337"><![CDATA[
So you wish to create a file, with a list of users. Is this of eggdrop overall, or just a channel.<br><br>I am guessing just a channel<br><div class="codebox"><p>Code: </p><pre><code>proc fileusers {chan file} {  if {![validchan $chan]} { return -1 }  set l1 [chanlist $chan]  set l2 {}  set l3 {}  foreach u $l1 {    if {[isop $u $chan]} {      lappend l3 "@"    } elseif {[isvoice $u $chan]} {      lappend l3 "+v"    } else {      lappend l3 ""    }    #lappend l3 [lindex [split [getchanhost $nick $chan] @] 0]    lappend l3 [nick2hand $u $chan]    lappend l3 [getchanidle $u $chan]    #lappend l3 [maskhost "${u}[getchanhost $u $chan]"]    lappend l3 "${u}[getchanhost $u $chan]"    lappend l2 [join $l3 {,}]    set l3 {}  }  set fp [open "${file}.users" w]  puts $fp [join l1 {,}]  catch {close $fp}  set fp [open "${file}.status" w]  puts $fp [join $l2 \n]  catch {close $fp}}</code></pre></div>It was not clear what you wanted for username or hostmask.<br><br>As such, it currently uses the username from the "nick!username@host". You can comment out that line, and uncomment the toher, to use the handle they have on the bot.<br><br>Also, the hostmask was not clear. Do you want a mask (*!*user@*.host) or the IRC userhost (nick!user@host). It currently uses the userhost.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Wed Sep 25, 2002 4:54 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2002-09-25T02:11:11-04:00</updated>

		<published>2002-09-25T02:11:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=11336#p11336</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=11336#p11336"/>
		<title type="html"><![CDATA[Simple Script Request... I think...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=11336#p11336"><![CDATA[
Shouldn't be too much... I looked to see if I could find examples or scripts that will do what I want...  But I don't see anything...<br><br>I need a script that will create 2 text files...<br><br>one will be a comma delimited user list, i.e.:<blockquote class="uncited"><div>user1,user2,user3,user4,etc...</div></blockquote>the second is similar, only it is in this format:<br>userstatus (voice, op, etc),username,idletime in min,hostmask<br><br>so:<blockquote class="uncited"><div>@,user1,5,blah!<a href="mailto:blah@some.cheesy.net">blah@some.cheesy.net</a><br>+v,user2,3,user2!<a href="mailto:user2@some.cheesy.net">user2@some.cheesy.net</a></div></blockquote>can anyone help me out with this?  The first one is the most important to me...<br><br>Thanks in advance!<p>Statistics: Posted by Guest — Wed Sep 25, 2002 2:11 am</p><hr />
]]></content>
	</entry>
	</feed>
