egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Sex Dice (Current Version: 1.3b MultiLanguage by CrazyCat)
Goto page 1, 2  Next
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
BeBoo
Halfop


Joined: 26 Sep 2007
Posts: 42

PostPosted: Tue Oct 23, 2007 12:47 pm    Post subject: Sex Dice (Current Version: 1.3b MultiLanguage by CrazyCat) Reply with quote

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
View user's profile Send private message
CrazyCat
Revered One


Joined: 13 Jan 2002
Posts: 1032
Location: France

PostPosted: Wed Oct 24, 2007 4:37 am    Post subject: Reply with quote

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) Very Happy

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
View user's profile Send private message Visit poster's website
BeBoo
Halfop


Joined: 26 Sep 2007
Posts: 42

PostPosted: Wed Oct 24, 2007 10:36 am    Post subject: Reply with quote

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
View user's profile Send private message
CrazyCat
Revered One


Joined: 13 Jan 2002
Posts: 1032
Location: France

PostPosted: Wed Oct 24, 2007 10:52 am    Post subject: Reply with quote

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 Smile

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
View user's profile Send private message Visit poster's website
Zircon
Op


Joined: 21 Aug 2006
Posts: 191
Location: Montreal

PostPosted: Wed Oct 24, 2007 2:41 pm    Post subject: Reply with quote

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
View user's profile Send private message
CrazyCat
Revered One


Joined: 13 Jan 2002
Posts: 1032
Location: France

PostPosted: Wed Oct 24, 2007 3:34 pm    Post subject: Reply with quote

I think I can, if I'm authorized by BeBoo.
_________________
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
View user's profile Send private message Visit poster's website
BeBoo
Halfop


Joined: 26 Sep 2007
Posts: 42

PostPosted: Wed Oct 24, 2007 3:59 pm    Post subject: Reply with quote

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
View user's profile Send private message
BeBoo
Halfop


Joined: 26 Sep 2007
Posts: 42

PostPosted: Wed Oct 24, 2007 4:29 pm    Post subject: Reply with quote

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 Smile

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
View user's profile Send private message
Zircon
Op


Joined: 21 Aug 2006
Posts: 191
Location: Montreal

PostPosted: Wed Oct 24, 2007 4:40 pm    Post subject: Reply with quote

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
View user's profile Send private message
BeBoo
Halfop


Joined: 26 Sep 2007
Posts: 42

PostPosted: Wed Oct 24, 2007 4:46 pm    Post subject: Reply with quote

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
View user's profile Send private message
CrazyCat
Revered One


Joined: 13 Jan 2002
Posts: 1032
Location: France

PostPosted: Thu Oct 25, 2007 3:55 am    Post subject: Reply with quote

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 Smile
_________________
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
View user's profile Send private message Visit poster's website
BeBoo
Halfop


Joined: 26 Sep 2007
Posts: 42

PostPosted: Thu Oct 25, 2007 2:34 pm    Post subject: Reply with quote

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
View user's profile Send private message
CrazyCat
Revered One


Joined: 13 Jan 2002
Posts: 1032
Location: France

PostPosted: Fri Oct 26, 2007 5:46 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
CrazyCat
Revered One


Joined: 13 Jan 2002
Posts: 1032
Location: France

PostPosted: Tue Oct 30, 2007 9:11 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Tue Oct 30, 2007 10:30 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases All times are GMT - 4 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber