| View previous topic :: View next topic |
| Author |
Message |
scope Voice
Joined: 05 Nov 2006 Posts: 10
|
Posted: Sun Nov 05, 2006 12:15 am Post subject: starting a game [hangman] |
|
|
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 |
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Sun Nov 05, 2006 3:08 am Post subject: |
|
|
| What game? What are the bind's flags for it? Does it have any "if's" that make it check matchattr? etc.. |
|
| Back to top |
|
 |
scope Voice
Joined: 05 Nov 2006 Posts: 10
|
Posted: Sun Nov 05, 2006 6:54 am Post subject: |
|
|
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 |
|
| Back to top |
|
 |
scope Voice
Joined: 05 Nov 2006 Posts: 10
|
Posted: Sun Nov 05, 2006 11:19 am Post subject: |
|
|
it ok now. sorted!
was bind flag.
thanks for you help. |
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Sun Nov 05, 2006 4:43 pm Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
scope Voice
Joined: 05 Nov 2006 Posts: 10
|
Posted: Sun Nov 05, 2006 7:49 pm Post subject: |
|
|
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  |
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Sun Nov 05, 2006 10:52 pm Post subject: patchfile |
|
|
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...) |
|
| Back to top |
|
 |
scope Voice
Joined: 05 Nov 2006 Posts: 10
|
Posted: Mon Nov 06, 2006 9:39 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Wed Nov 08, 2006 10:56 pm Post subject: hangman - sort guessed letters fix |
|
|
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: |
#################################################################################################
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 ) 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. |
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Fri Nov 10, 2006 2:06 am Post subject: more bugs - doesn't close open files ;/ |
|
|
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  |
|
| Back to top |
|
 |
|