egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

List Text in a file [Solved]

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
kris
Voice


Joined: 12 Sep 2006
Posts: 14
Location: Perth, Australia

PostPosted: Sun Nov 05, 2006 12:07 pm    Post subject: List Text in a file [Solved] Reply with quote

Code:

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
Back to top
View user's profile Send private message Visit poster's website
metroid
Owner


Joined: 16 Jun 2004
Posts: 771

PostPosted: Sun Nov 05, 2006 2:04 pm    Post subject: Reply with quote

You already started a topic about this not too long ago.
Back to top
View user's profile Send private message
kris
Voice


Joined: 12 Sep 2006
Posts: 14
Location: Perth, Australia

PostPosted: Sun Nov 05, 2006 10:51 pm    Post subject: Reply with quote

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:

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
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber