| View previous topic :: View next topic |
| Author |
Message |
BeBoo Halfop
Joined: 26 Sep 2007 Posts: 42
|
Posted: Tue Oct 23, 2007 12:47 pm Post subject: Sex Dice (Current Version: 1.3b MultiLanguage by CrazyCat) |
|
|
| Code: | #---------------------------------------------------------------------#
# TechJoose:SexDice v1.3b #
# #
# Rolls the sex dice on a random or chosen person #
# #
# Usage: #
# .chanset <chan> +games #
# !sexdice [nick] #
# #
# ChangeLog: #
# 1.0a - First public alpha release #
# 1.1 - French Translation by CrazyCat #
# 1.2 - Added per channel control #
# - Added excluded users setting #
# 1.3b - MultiLanguage by CrazyCat #
# #
# TODO: #
# - More customization for display of information #
# - Ideas? Email me. #
# #
# http://www.techjoose.net #
# macbrando@gmail.com #
# BeBoo @ irc.techjoose.net / #bar #
#---------------------------------------------------------------------# |
I was bored and decided to make a pointless and very simple sex dice game. Please leave any comments or suggestions!
Download 1.2 (English Only): here
Download 1.3b MultiLanguage: here (Thanks to CrazyCat!)
Last edited by BeBoo on Fri Nov 02, 2007 10:40 am; edited 3 times in total |
|
| Back to top |
|
 |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1032 Location: France
|
Posted: Wed Oct 24, 2007 4:37 am Post subject: |
|
|
Really funny, I'm making a translation of it in french and I'll add two more parameters:
- list of authorized chans (I don't want the script works on all the channel the bot is)
- list of excluded pples (I hate kissing (or more) service'bots)
I'll transmit you my modifications. _________________ https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community. |
|
| Back to top |
|
 |
BeBoo Halfop
Joined: 26 Sep 2007 Posts: 42
|
Posted: Wed Oct 24, 2007 10:36 am Post subject: |
|
|
| That was actually in my next version... Heh.. Before I released it, I took out the udef of "games." Thanks for the translate! |
|
| Back to top |
|
 |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1032 Location: France
|
Posted: Wed Oct 24, 2007 10:52 am Post subject: |
|
|
Here's my version
So, included the two features I spoke about and I've translated it.
I've reduced the namespace to only one level, but feel free to re-adapt rhe tcl as you made it previously
You'll notice I supress the global and use the direct call ($::var). _________________ https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community. |
|
| Back to top |
|
 |
Zircon Op
Joined: 21 Aug 2006 Posts: 191 Location: Montreal
|
Posted: Wed Oct 24, 2007 2:41 pm Post subject: |
|
|
Hello CrazyCat and BeBoo
First, thanks BeBoo for this script.
CrazyCat, can you please translate in french OnThisDay.tcl done by BeBoo also ? |
|
| Back to top |
|
 |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1032 Location: France
|
|
| Back to top |
|
 |
BeBoo Halfop
Joined: 26 Sep 2007 Posts: 42
|
Posted: Wed Oct 24, 2007 3:59 pm Post subject: |
|
|
I don't see why not but the information is from NY Times so the output will not be in french... If you do translate, please make sure I get credit for creation. Thanks.
Also, I'm gonna tweak your french version of this script a tad and post it up here. |
|
| Back to top |
|
 |
BeBoo Halfop
Joined: 26 Sep 2007 Posts: 42
|
Posted: Wed Oct 24, 2007 4:29 pm Post subject: |
|
|
| CrazyCat wrote: | Here's my version
So, included the two features I spoke about and I've translated it.
I've reduced the namespace to only one level, but feel free to re-adapt rhe tcl as you made it previously
You'll notice I supress the global and use the direct call ($::var). |
I tested your script and got the following error:
Tcl error [sexdice::roll]: invalid command name "filt"
Any ideas? |
|
| Back to top |
|
 |
Zircon Op
Joined: 21 Aug 2006 Posts: 191 Location: Montreal
|
Posted: Wed Oct 24, 2007 4:40 pm Post subject: |
|
|
hello BeBoo
I tested the french version, and it s working for me, althought the names of the channels have to be in lowercase, otherwise, it doent work. Also, it may be better to turn off the log on the partyline.
By the way, why not be able to turn ON/OFF dynamically in the partyline for authorised channels, like :
.chanset #adult +sexdice
.chanset #religion -sexdice |
|
| Back to top |
|
 |
BeBoo Halfop
Joined: 26 Sep 2007 Posts: 42
|
Posted: Wed Oct 24, 2007 4:46 pm Post subject: |
|
|
| Zircon wrote: | hello BeBoo
I tested the french version, and it s working for me, althought the names of the channels have to be in lowercase, otherwise, it doent work. Also, it may be better to turn off the log on the partyline.
By the way, why not be able to turn ON/OFF dynamically in the partyline for authorised channels, like :
.chanset #adult +sexdice
.chanset #religion -sexdice |
As stated above, before I released it, i deleted the requirement of having +games on the chan. It would be a lot easier than filtering for chans thru a variable and having to rehash just to add a chan to the list. I am currently working on version 1.1 to be released alongside Cat's french version. I will make the change there. |
|
| Back to top |
|
 |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1032 Location: France
|
Posted: Thu Oct 25, 2007 3:55 am Post subject: |
|
|
| BeBoo wrote: |
I tested your script and got the following error:
Tcl error [sexdice::roll]: invalid command name "filt"
Any ideas? |
I've updated the tcl during the day, peharps the version you DL wasn't the good one.
Try getting the last one and if the error persists, modify the line #84:
| Code: | | set wb [lsearch [filt $mylist] [filt $exclude]] |
may become:
| Code: | | set wb [lsearch [sexdice::filt $mylist] [sexdice::filt $exclude]] |
The other way is to have the filt procedure global (out of the namespace)...
| Zircon wrote: | By the way, why not be able to turn ON/OFF dynamically in the partyline for authorised channels, like :
.chanset #adult +sexdice
.chanset #religion -sexdice |
I was thinking about it too, adding udef flags for authorized channels and for forbidden users.
I'll wait for the next version from BeBoo, it'll be a collaborative work  _________________ https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community. |
|
| Back to top |
|
 |
BeBoo Halfop
Joined: 26 Sep 2007 Posts: 42
|
Posted: Thu Oct 25, 2007 2:34 pm Post subject: |
|
|
New version is available (1.2). Change log and download links can be found in the first post!
Thanks for your help thusfar, CrazyCat! |
|
| Back to top |
|
 |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1032 Location: France
|
Posted: Fri Oct 26, 2007 5:46 am Post subject: |
|
|
you're welcome...
btw, I'll do the 1.3 version wich might really interest both of us: multilanguage version (dynamically setted).
I'm affraid I'll have just a few time to work on it, so I think I'll released it on monday, 29th. _________________ https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community. |
|
| Back to top |
|
 |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1032 Location: France
|
Posted: Tue Oct 30, 2007 9:11 am Post subject: |
|
|
Sorry but creating a multilanguage version is not so simple that I thought.
I've tried different ways:
* adding namespaces in $::sexdice
* adding external namespaces and import them
* ...
The first method was the one I prefered, but it doesn't work:
| Code: | namespace eval test {
namespace eval fr {
variable dice1 { "first" "second" "third" }
}
namespace eval en {
variable dice1 { "efirst" "esecond" "ethird" }
}
set lang "en"
putlog "test 1: [lindex $test::[subst $lang]::dice1 1]"
# Tcl error: can't read "test::": no such variable
putlog "test 2: [lindex [subst $lang]::dice1 0]"
# test 2:
} |
(comments are output in the console)...
I think I'll use dbfiles to work if there's no internal solution... _________________ https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community. |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Tue Oct 30, 2007 10:30 am Post subject: |
|
|
Could tweak it like this:
| Code: | namespace eval test {
namespace eval fr {
variable dice1 { "first" "second" "third" }
}
namespace eval en {
variable dice1 { "efirst" "esecond" "ethird" }
}
set lang "en"
putlog "test 1: [lindex [set test::[subst $lang]::dice1] 1]"
}
|
_________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
|