This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.
For more information, see this announcement post . Click the X in the top right-corner of this box to dismiss this message.
Old posts that have not been replied to for several years.
knilch
Voice
Posts: 11 Joined: Wed Feb 18, 2004 7:52 pm
Post
by knilch » Wed Apr 14, 2004 10:54 am
Hi folks!
I need a tcl script for my eggdrop, but i do not how to do.
My eggdrop should create a file (php, html or cgi) where the names of users in a specific channel is listed. for each username one line and the name should be in brackets.
for example:
(user1)
(user2)
...
I hope that someone could help me, because i'm not able to do it on my own.
Thanks a lot.
knilch
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Wed Apr 14, 2004 11:34 am
username is the name under he/she is known by the bot?
Once the game is over, the king and the pawn go back in the same box.
knilch
Voice
Posts: 11 Joined: Wed Feb 18, 2004 7:52 pm
Post
by knilch » Wed Apr 14, 2004 2:25 pm
no - ALL user should be displayed - all people who are on the channel
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Wed Apr 14, 2004 2:55 pm
use something like:
Code: Select all
foreach line [channel #channel] {
set user [lindex $line 0]
# add $user one by one in your page or whatever
}
nickname, handle, join, idle and uhost is the content of the entire line.
Once the game is over, the king and the pawn go back in the same box.
knilch
Voice
Posts: 11 Joined: Wed Feb 18, 2004 7:52 pm
Post
by knilch » Wed Apr 14, 2004 2:59 pm
hum, i don't understand this.
sorry, i not fit in tcl
dollar
Op
Posts: 178 Joined: Tue Oct 28, 2003 3:47 pm
Location: Netherlands
Post
by dollar » Wed Apr 14, 2004 3:01 pm
caesar wrote: use something like:
Code: Select all
foreach line [channel #channel] {
set user [lindex $line 0]
# add $user one by one in your page or whatever
}
nickname, handle, join, idle and uhost is the content of the entire line.
What about [chanlist #channel]?
dollar (or something similar) at:
#eggdrop / #tcl - undernet
#egghelp / #tcl / #eggtcl - efnet
#eggdrop.support / #tcl - quakenet
#eggdrop - ircnet
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Wed Apr 14, 2004 3:49 pm
Oups!
It should be chanlist not channel. I was thinking at the dcc .channel command and in TCL is chanlist and kinda mixed them a bit
Here is an basic "export" thing:
Code: Select all
bind dcc o export my:export
proc my:export {hand idx text} {
set chan [lindex $text 0]
if {![string match "#*" $chan] || $text == ""} {
putdcc $idx "Usage: .export #channel"
return
}
set file [open "result.txt" w]
puts $file "Users in $chan channel:"
foreach line [chanlist $chan] {
puts $file [lindex $line 0]
}
close $file
putdcc $idx "Export completed."
}
Once the game is over, the king and the pawn go back in the same box.
knilch
Voice
Posts: 11 Joined: Wed Feb 18, 2004 7:52 pm
Post
by knilch » Wed Apr 14, 2004 4:37 pm
but this version only works if i request it at the partyline, right?
i need this script updating himself
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Thu Apr 15, 2004 11:43 am
Code: Select all
bind time - ?0* my:status
bind time - ?5* my:status
proc my:status {minute hour day month year} {
set chan "#channel"
set file [open "result.txt" w]
puts $file "Users in $chan channel:"
foreach line [chanlist $chan] {
puts $file [lindex $line 0]
}
close $file
}
This should do a status every 5 minutes.
Once the game is over, the king and the pawn go back in the same box.
knilch
Voice
Posts: 11 Joined: Wed Feb 18, 2004 7:52 pm
Post
by knilch » Thu Apr 15, 2004 11:47 am
yea, that looks fine, thanks. but the nicknames should be written in brackets like (nickname). is that possible, too?
user
Posts: 1452 Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway
Post
by user » Thu Apr 15, 2004 11:53 am
knilch wrote: but the nicknames should be written in brackets like (nickname). is that possible, too?
Brackets look like this: [], and yes, it's possible. Try to figure out where to put them yourself (clue: 'puts $file' is the part where content is written to the file)
Have you ever read "The Manual"?
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Thu Apr 15, 2004 11:54 am
Once the game is over, the king and the pawn go back in the same box.
knilch
Voice
Posts: 11 Joined: Wed Feb 18, 2004 7:52 pm
Post
by knilch » Thu Apr 15, 2004 11:56 am
thanks, i'll try it. very kind of you!
knilch
Voice
Posts: 11 Joined: Wed Feb 18, 2004 7:52 pm
Post
by knilch » Thu Apr 15, 2004 12:18 pm
hmm i loaded the script but my result.txt is empty.
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Thu Apr 15, 2004 12:47 pm
Have you changed from #channel to the actual name of your channel? I am talking about the set chan "#channel" line.
Once the game is over, the king and the pawn go back in the same box.