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.

starting a game [hangman]

Support & discussion of released scripts, and announcements of new releases.
Post Reply
s
scope
Voice
Posts: 10
Joined: Sun Nov 05, 2006 12:09 am

starting a game [hangman]

Post by scope »

hi all

my first post here because ive never had a problem with eggdrop untill now lol.
i decided to spice my bot up a bit and add a game script.
the problem is i can start the game by using the command !startgame but my guests that join the channel cant. i want it so my guests can start the game too
it must be a simple solution but i cant think what it is. ive added public commands but to no avail.
would be grateful for any help.
thanks

topic moved from Scripting Help and script name appended to title - slennox
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

What game? What are the bind's flags for it? Does it have any "if's" that make it check matchattr? etc..
s
scope
Voice
Posts: 10
Joined: Sun Nov 05, 2006 12:09 am

Post by scope »

the game is hangman.
here is the tcl script: hangman
it's my first game and im not entirely sure what im looking for.

thanks for your reply
s
scope
Voice
Posts: 10
Joined: Sun Nov 05, 2006 12:09 am

Post by scope »

it ok now. sorted!
was bind flag.
thanks for you help.
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

I did some mods to that game myself, but haven't published it since such is specifically prohibited by the script author. There's a few problems with the script. Maybe I can post a diff file, if you know how to use 'diff' to apply the changes.
s
scope
Voice
Posts: 10
Joined: Sun Nov 05, 2006 12:09 am

Post by scope »

you can post it if you like mate. thanks

i did some mods to, like correcting the spelling mistakes lol.

i got the !hangmanstart cmd to work for all people on the channel but i would like to set the .hangman cmd to so others can start there custom games.
not found out how to do this yet though :roll:
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

patchfile

Post by rosc2112 »

I posted a patch file here:

http://members.dandy.net/~fbn/hangman.diff.txt

Main changes were to create a msg bind to allow people to do
/msg botnick hangcust My Custom puzzle, added more of a helpfile, fixed a few bugs, fixed ugly colors, formatting and spelling errors, etc.

I have not figured out how the "hint" stuff was meant to be formatted, and there is an unused proc in the script "proc hangman_fake" that I have no clue about.. And obviously the scripts instructions were wrong, as typing "!hangman" does not start the game..

I wonder if this script could be considered abandoned so someone else could re-release it.

Anyway, the above changes work for me, although they're not pretty (I'd just as soon re-write the script, but...)
s
scope
Voice
Posts: 10
Joined: Sun Nov 05, 2006 12:09 am

Post by scope »

well mate that is a massive improvement. thanks

seeing the last release date was in 2002 i wouldent of thought the author would of minded and probably would welcome the bug fixes.
but im not up on copyrights lol.

the mods you made though are spot on. works great now.

cheers again.
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

hangman - sort guessed letters fix

Post by rosc2112 »

I made another small fix for the hangman101 script, this is to make it sort the guessed letters:

in proc hangman_show, just before the line with "switch $hangman(level)"

Code: Select all

#################################################################################################
set hangman(guessed) [string trim [join [lsort [lrange [split $hangman(guessed) {}] 0 end]] {}]]
I just noticed the script also bugs out if you hammer guesses at it (heh another false claim by the original author :P) I suspect that's cos it messes up the timers.

It also considers non-alpha chars as guesses, i'll prolly fix it so it doesn't.
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

more bugs - doesn't close open files ;/

Post by rosc2112 »

Gah, just noticed while debugging a different script that this hangman script does not close open files..Lovely.. There are 4 "open" calls, and only 2 closes, so whoever uses the script might want to grep through the file and find the opens, then also add in appropriate "catch {close $in}" and "catch {close $out}" lines where they belong :P
Post Reply