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.

List Text in a file [Solved]

Help for those learning Tcl or writing their own scripts.
Post Reply
User avatar
kris
Voice
Posts: 14
Joined: Tue Sep 12, 2006 10:46 am
Location: Perth, Australia
Contact:

List Text in a file [Solved]

Post by kris »

Code: Select all

bind msg "-|-" married msg_married
proc msg_married { nick userhost handle text } {
set file "marriage.role"
set found 0
set fs [open $file r]
while {![eof $fs]} {
gets $fs line
putquick "NOTICE $nick :$line and $line"
}
close $fs
}
i want it to come out as: e.g:
kris and NoMansLand
test and test1

The database is setup as

nick1
nick2
nick3
nick4

any help is greatly appreciated thanks!!
Last edited by kris on Sun Nov 05, 2006 10:55 pm, edited 1 time in total.
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

You already started a topic about this not too long ago.
User avatar
kris
Voice
Posts: 14
Joined: Tue Sep 12, 2006 10:46 am
Location: Perth, Australia
Contact:

Post by kris »

no the last one was deleting text from a file. this one isnt this is making it loop and list all the nicks in the file, because im designing a e-Marriage service.
and one of my admins had said, why dont we do this. and i started doing it, and it doesnt remove the text, just lists it. completely different.

- edit -

dont worry, heres the code for later reference when people need help with the same thing.

Code: Select all

bind msg "-|-" married msg_married
proc msg_married { nick userhost handle text } {
set file "marriage.role"
set found 0
set fs [open $file r]
while {![eof $fs]} {
gets $fs line
gets $fs lne
putquick "NOTICE $nick :$lne and $line"
}
close $fs
}
thanks, metroid
KrisDC Eggdrop Services - 2006
Post Reply