This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.
For more information, see this announcement post . Click the X in the top right-corner of this box to dismiss this message.
Old posts that have not been replied to for several years.
V
ViU
Post
by ViU » Thu Aug 12, 2004 10:52 am
I have a simple script:
Code: Select all
bind pub - !kaffe kaffe
proc kaffe {nick host hand chan text} {
if {$text == "mjölk"} {
putserv "PRIVMSG $chan :\001ACTION hämtar en kopp kaffe med mjölk åt $nick"
}
}
It works if I try to match it against something without scandinavian characters. But if I try to match it against scandinavian it doesent react, I'd guess that its because somewhere the scandinavian characters in $test gets translated into some code, and thats why it wont match.
Anybody have any idea on how to solve this?
netux
Voice
Posts: 19 Joined: Fri Jul 30, 2004 8:42 pm
Post
by netux » Thu Aug 12, 2004 5:43 pm
i think you need to split text firsts but i'm not shure just try it
Code: Select all
bind pub - !kaffe kaffe
proc kaffe {nick host hand chan text} {
set stext [split $text]
if {$stext == "mjölk"} {
putserv "PRIVMSG $chan :\001ACTION hämtar en kopp kaffe med mjölk åt $nick"
}
}
Alchera
Revered One
Posts: 3344 Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:
Post
by Alchera » Thu Aug 12, 2004 6:47 pm
Noticed something that might need fixing.
Code: Select all
putserv "PRIVMSG $chan :\001ACTION hämtar en kopp kaffe med mjölk åt $nick\001"
Shell character settings affect how the bot "sees" and displays special characters.
Add [SOLVED] to the thread title if your issue has been.
Search |
FAQ |
RTM
awyeah
Revered One
Posts: 1580 Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:
Post
by awyeah » Thu Aug 12, 2004 8:35 pm
Take a look at this post.
*ASCII Codes*
You might need to convert them into hexadecimals first and then try to match them.
Plus, try using 'string match', or 'string equal' that is more appropriate than using the '==' comparator.
Something like this should do it:
Code: Select all
if {([string equal "mjölk" $text])} {
or
if {([string equal "mj\xF6lk" $text])} {
·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
greenbear
Owner
Posts: 733 Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway
Post
by greenbear » Thu Aug 12, 2004 9:02 pm
if Alchera's fix didnt work, try using 'encoding'
Code: Select all
set bleh [encoding convertfrom identity $bleh]
... you get the idea..