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.

Announce: Jokes.tcl Script

Support & discussion of released scripts, and announcements of new releases.
Post Reply
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Announce: Jokes.tcl Script

Post by rosc2112 »

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.)

http://members.dandy.net/~fbn/jokes.tcl.txt
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

v0.1b

Post by rosc2112 »

Minor update to shuffle the jokes when loading them so it produces more random output.
g
gasak
Halfop
Posts: 45
Joined: Mon Aug 09, 2010 11:09 pm

Post by gasak »

hi rosc2112,

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.

Thanks.
Learning Knows No Boundaries!!
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

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.
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

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".
NML_375
g
gasak
Halfop
Posts: 45
Joined: Mon Aug 09, 2010 11:09 pm

Post by gasak »

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?

Please advice.
Learning Knows No Boundaries!!
Post Reply