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 

Bogus trivia non-english users answer problem.

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
Keen
Voice


Joined: 28 Jan 2009
Posts: 10

PostPosted: Thu Mar 15, 2012 10:32 pm    Post subject: Bogus trivia non-english users answer problem. Reply with quote

Hello many of my users come from english speaking countries. So bogus trivia must accept both non-english and english char answers.

For example if the answer of the question is "Şeytan" the english speaking users cant type Şeytan they have to write seytan/Seytan because there is no turkish chars in ther computer. But the bogus trivia bot does not accept this answer. can we make it with a code such this?
Quote:

regsub -all {ğ} $tx "g" tx
regsub -all {Ğ} $tx "G" tx
regsub -all {ü} $tx "u" tx
regsub -all {Ü} $tx "U" tx
regsub -all {ş} $tx "s" tx
regsub -all {Ş} $tx "S" tx
regsub -all {ı} $tx "i" tx
regsub -all {İ} $tx "I" tx
regsub -all {ö} $tx "o" tx
regsub -all {Ö} $tx "O" tx
regsub -all {ç} $tx "c" tx
regsub -all {Ç} $tx "C" tx

i want bot accept both Ç and C hars but i dont know how to do. thank you.
Back to top
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Fri Mar 16, 2012 1:30 am    Post subject: Reply with quote

You should use Johannes13's two function to encode and decode a text to and from Turkish to English instead of the regsubs.
Code:

proc enc v {
  subst [regsub -all {[^a-zA-Z0-9\-_\.~]} [encoding convertto utf-8 $v] {[format %%%02X [scan {\0} %c]]}]
}

proc decode v {
  encoding convertfrom utf-8 [subst -nocommands -novariables [regsub -all {%([a-fA-F0-9]{2})} $v {\u\1}]]
}

_________________
Once the game is over, the king and the pawn go back in the same box.
Back to top
View user's profile Send private message
Keen
Voice


Joined: 28 Jan 2009
Posts: 10

PostPosted: Fri Mar 16, 2012 12:48 pm    Post subject: Reply with quote

thank you caesar but im new in tcl. Can you implement this code for me to the bogus tcl? Thank you.
Back to top
View user's profile Send private message
kingkong
Voice


Joined: 08 Apr 2012
Posts: 10

PostPosted: Sun Apr 08, 2012 5:19 am    Post subject: Reply with quote

According to your words, I assume that your bot can accept Turkish chars. So, You don't need to recode or edit anything in tcl.
All you need to do is just to put both of answers in your question file. seperate the answers with * sign. just edit your answers in such questions as like that and bot will accept both(answer can be more than one or two) of the answers;

question*answer1*answer2

in your case;

question*Seytan*Şeytan

so, nothing else will need to do.
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
Page 1 of 1

 
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