[Script] Oracle (version actuelle : 2.3.1)
#10
Hello,

Sorry for speaking English but I can't speak French Sad

I'm testing oracle, the idea is to use it in Spanish. I think it shouldn't be any problem with Levenshtein.tcl since it should work in every language.

Neither with MenzAgitats_Soundex.tcl since I could just change the "string map" from French special chars to Spanish ones (ie. "à" to "á").

I'd also modify "string matches" and some other few things in Oracle.tcl to suit my needs.

Anyway, I'm testing all in French for now, but I can't make it work.

Citation :<panfleto> !oracle est-ce que ce script déchire sa mémère ?

Tcl error [Oracle::ask_oracle]: random limit must be greater than zero

It worked when I used !oracle command without input or only with a interrogation mark.

Citation :<panfleto> !oracle
<eggdrop> !panfleto
<panfleto> !oracle ?
<eggdrop> !panfleto ?

I'm using eggdrop 1.6.20 (*not* windrop) but I have the same problem with eggdrop 1.6.19. The three required scripts are loaded.

*Edited: pasted .set errorInfo output:

Citation :.set errorInfo

Currently: random limit must be greater than zero
Currently: while executing
Currently: "rand [llength $users_list]"
Currently: (procedure "Oracle::randnick" line 4)
Currently: invoked from within
Currently: "Oracle::randnick $nick $chan"
Currently: (procedure "Oracle::ask_oracle" line 44)
Currently: invoked from within
Currently: "Oracle::ask_oracle $_pub1 $_pub2 $_pub3 $_pub4 $_pub5"


*Edit2: Sorry, I realized that with at least a 3rd user in chan, besides the one who ask !oracle and the Oraclebot (or other bots on the botnet) the script works.

Code :
# Retourne un nick aléatoire parmi les users présents sur le chan
# (sauf l'eggdrop, sauf les autres eggs du botnet, sauf l'user qui a posé la
# question)
proc Oracle::randnick {nick chan} {
    set users_list [lreplace [set users [chanlist $chan -b|]] [set index [lsearch $users $nick]] $index]
    set users_list [lreplace $users_list [set index [lsearch $users_list $::botnick]] $index]
    return [lindex $users_list [rand [llength $users_list]]]
}

Could this be disabled without affecting the whole script?

*Edit3: I think I got it. I just need to remove proc Oracle::randnick and stop using $randnick variable Smile


Merci beaucoup.
Répondre


Messages dans ce sujet
RE: [script] Oracle v1.0 - par cestlemien - 08/06/2009, 19:23
RE: [script] Oracle v1.0 - par MenzAgitat - 08/06/2009, 20:38
RE: [script] Oracle v1.0 - par cestlemien - 08/06/2009, 23:18
RE: [script] Oracle v1.0 - par MenzAgitat - 08/06/2009, 23:41
RE: [script] Oracle v1.0 - par Helias - 09/06/2009, 21:46
RE: [script] Oracle v1.0 - par MenzAgitat - 09/06/2009, 22:10
RE: [script] Oracle v1.0 - par zarkox - 12/06/2009, 11:51
RE: [script] Oracle v1.0 - par lepheniX - 19/06/2009, 14:15
RE: [script] Oracle v1.0 - par panfleto - 13/08/2010, 17:09
RE: [script] Oracle v1.0 - par Artix - 13/08/2010, 22:08
RE: [script] Oracle v1.0 - par panfleto - 14/08/2010, 14:27

Atteindre :


Utilisateur(s) parcourant ce sujet : 1 visiteur(s)
Tchat 100% gratuit -Discutez en toute liberté