Just something I threw together in about half an hour, because I wanted a jokes script that would allow me to have a delay between parts for multi-part jokes.
Desc:
Pulls a random joke from a file and spits it out in channel. If you format jokes with a semi-colon seperator, it'll add a small delay to the subsequent parts of a joke (for like, Have you heard about? type jokes) Lines can have more than 1 seperator.
Example: What do you call two butches bonding?;Hockey night in Canada.
The second part ("Hockey night in Canada") will be shown after the delay.
If there is no semi-colon seperator, then the entire joke on one line will be shown. Joke length per line is limited by your IRCD's line length (generally 400 chars long.)
tried your tcl but got hopeless about the way to set the jokes files.. I already set the jokes file format: "/eggdrop/jokes.txt" but when i load it always says "Jokes.tcl: No joke file found. Not binding command.."
what kind of format then should i put for the file destination? please help.
Presumably you didn't specify the correct path to the file to get that error. I also assume you're running eggdrop under a unix-like system because I don't do windoze and windoze doesn't understand [file exists] type language AFAIR.
Also note I haven't run an eggdrop for quite a few years so I have no way to debug errors any longer.
Just a comment or two; file exists (along with the other file commands) works perfectly well under windows - assuming you provide a proper file and pathname. One thing to look out for under windows-systems, is that the directory separator symbol (\) is used for escape-sequences; thus it must be escaped, or escape-substitutions must be avoided.
But, as rosc said, doublecheck the jokefile setting, especially the path. If you start the path using a /, this would be an absolute path "starting" from the root filesystem. If you installed your eggdrop in your own home directory, the setting should probably be "eggdrop/jokes.txt" rather than "/eggdrop/jokes.txt".
thanks for the advice nml375. It was able to read the file now, but then have another problem. I got several line of jokes on file jokes.txt, but when i type .joke on pub it only shows the first line joke. Tried typing .joke again and still keep showing the same line joke. Its suppose to show the entire jokes that i have in file right?