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 

read a joke from a file

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


Joined: 22 Feb 2020
Posts: 393

PostPosted: Thu Jun 10, 2021 3:14 pm    Post subject: read a joke from a file Reply with quote

What would be the best way to read a joke from a txt file like this

Code:

"joke 1 here and so on
joke1 still here and heeeeeereee
joke 1 ends here"
"joke2 starts here, and continues...
still here too!
and ends here..."


possible to use " " to specify the start and end of a line? or what would be the best way, thanks in advanced Razz
_________________
ComputerTech
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ComputerTech
Master


Joined: 22 Feb 2020
Posts: 393

PostPosted: Thu Jun 10, 2021 4:58 pm    Post subject: Reply with quote

Nevermind, Thanks to DasBrain, i found what i needed.

Here's my code:
Code:

inside jokes.txt

"joke 1 here
still here
ending here"
joke2 here
still here
ending here"

set fd "scripts/jokes.txt"
set jokes [read $fd]

_________________
ComputerTech
Back to top
View user's profile Send private message Send e-mail 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