TinTin++ Mud Client The TinTin++ message board

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
TinTin++ Mud Client

strange output in big5

 
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> General Discussion
View previous topic :: View next topic  
Author Message
xoop



Joined: 04 May 2010
Posts: 9

PostPosted: Sat Aug 04, 2012 1:56 am    Post subject: strange output in big5 Reply with quote

I get strange output when I assign variable with big5 words.
Code:


#ACTION {~\e[2;37;0m\e[1;31m%1\(%2\)\e[2;37;0m\e[36m%*,聽說他最近在%3,}
{
        #variable qmtc {%1};
        #variable qmte {%2};
        #showme {---%1---%2---%3---} {1};
}


"蘭州城" should be shown with %3, but I get "蘭吒x7B城" as a result.
Any tips?

My tintin++ is 2.00.7 and the config as below.
Code:

[AUTO TAB     ] [    5000] Scroll back buffer lines used for tab completion
[BUFFER SIZE  ] [   20000] The size of the scroll back buffer
[CHARSET      ] [    BIG5] The character set encoding used by TinTin++
[CONNECT RETRY] [      15] Seconds TinTin++ will try to connect before giving up
[COMMAND COLOR] [   <078>] The color of echoed commands
[COMMAND ECHO ] [      ON] Your commands are echoed in split mode
[HISTORY SIZE ] [    1000] The size of the command history
[LOG          ] [     RAW] The data format of the log files
[PACKET PATCH ] [     0.5] Seconds TinTin++ will try to patch broken packets
[REPEAT ENTER ] [     OFF] You send a carriage return on an enter
[REPEAT CHAR  ] [       !] The character used for repeating commands
[SCROLL LOCK  ] [      ON] You do not see mud output while scrolling
[SPEEDWALK    ] [     OFF] Your input is not scanned for speedwalk directions
[TINTIN CHAR  ] [       #] The character used for TinTin++ commands
[VERBATIM     ] [     OFF] Your keyboard input is parsed by TinTin++
[VERBATIM CHAR] [       \] The character used for unparsed text
[VERBOSE      ] [     OFF] Messages while reading in a script file are gagged
[WORDWRAP     ] [     OFF] Mud output is line wrapped
[256 COLORS   ] [      ON] Your terminal is 256 color capable
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Sat Aug 04, 2012 11:07 am    Post subject: Reply with quote

It's a bug in tinexp.c somewhere around line 518. Change the old block of code to the following and recompile:

Code:

                                                while (*ptt)
                                                {

                                                        if (HAS_BIT(ses->flags, SES_FLAG_BIG5) && *ptt & 128 && ptt[1] != 0)
                                                        {
                                                                *pto++ = *ptt++;
                                                                *pto++ = *ptt++;
                                                                continue;
                                                        }
Back to top
View user's profile Send private message Send e-mail
xoop



Joined: 04 May 2010
Posts: 9

PostPosted: Sun Aug 05, 2012 1:00 am    Post subject: Reply with quote

It works fine.Thanks a lot! Thumbs Up
Back to top
View user's profile Send private message
Slysven



Joined: 10 Apr 2011
Posts: 365
Location: As "Jomin al'Bara" in WoTMUD or Wiltshire, UK

PostPosted: Sun Aug 05, 2012 4:19 pm    Post subject: Reply with quote

The change being 4 references to pti changing to ptt i.e. from:
Code:
                  while (*ptt)
                  {
                     if (HAS_BIT(ses->flags, SES_FLAG_BIG5) && *pti & 128 && pti[1] != 0)
                     {
                        *pto++ = *pti++;
                        *pto++ = *pti++;
                        continue;
                     }
to:
Code:
                  while (*ptt)
                  {
                     if (HAS_BIT(ses->flags, SES_FLAG_BIG5) && *ptt & 128 && ptt[1] != 0)
                     {
                        *pto++ = *ptt++;
                        *pto++ = *ptt++;
                        continue;
                     }
Back to top
View user's profile Send private message
xoop



Joined: 04 May 2010
Posts: 9

PostPosted: Mon Sep 03, 2012 4:43 am    Post subject: Reply with quote

Slysven wrote:
The change being 4 references to pti changing to ptt i.e. from:
Code:
                  while (*ptt)
                  {
                     if (HAS_BIT(ses->flags, SES_FLAG_BIG5) && *pti & 128 && pti[1] != 0)
                     {
                        *pto++ = *pti++;
                        *pto++ = *pti++;
                        continue;
                     }
to:
Code:
                  while (*ptt)
                  {
                     if (HAS_BIT(ses->flags, SES_FLAG_BIG5) && *ptt & 128 && ptt[1] != 0)
                     {
                        *pto++ = *ptt++;
                        *pto++ = *ptt++;
                        continue;
                     }

Thanks for reply. I've fixed it.!!^_^
Back to top
View user's profile Send private message
xoop



Joined: 04 May 2010
Posts: 9

PostPosted: Mon Sep 03, 2012 5:45 am    Post subject: Reply with quote

Here is another big5 output problem.
I get mob's Chinese name in BIG5 from quest NPC.
Code:

#ACTION {~\e[2;37;0m\e[1;31m%1\(%2\)\e[2;37;0m\e[36m%*,聽說他最近在%3{,|派,|一帶,|城,|附近,|派一帶,|城一帶,|派附近,|城附近,}}
{
        #variable qmtlo {};
        #variable qmtc {%1};
        #variable qmte {%2};
        ...
}
{3}

And I can't match it when I find the mob.
Code:

#ACTION {^  %*高手 %5\(%6\)$}
{
        #if {"%5" == "$qmtc" && "%6" == "$qmte"}
        {
                kill $qmte;
                9;
                #tick ada {9;9} {2};
        };
        #if {"%5" != "$qmtc" && "%6" == "$qmte"}
        {
                kill $qmte;
                9;
                #tick ada {9;9} {2};
                #var qmdone 2;
                #showme {----$qmtc----%5----$qmte----} {1};
        };
}
{7}


eg. mob's Chinese name is "貝塵稟"

Maybe I can check only English but sometimes different Chinese words get the same pronouncation , like 貝 and 被, pronounced "bei".
Sorry for my poor English, and any help or tips?
Thanks a lot.
Back to top
View user's profile Send private message
Slysven



Joined: 10 Apr 2011
Posts: 365
Location: As "Jomin al'Bara" in WoTMUD or Wiltshire, UK

PostPosted: Mon Sep 03, 2012 9:11 am    Post subject: Reply with quote

I am sorry but I could not see how 貝塵稟 is going to match in the #ACTIONs - however to test don't forget that you can use a "#SHOWME {test string}" when you are debugging things and not even connected to a MUD server which will get checked against the #ACTIONs that you have got in place.

Also be careful with the numbering of the place-holders i.e. the %{?}, in the first #ACTION, the wildcard %* will, being the third place-holder actually I think come up as %3, what you have as %3 should be really be %4 and what ever gets found out of {,|派,|一帶,|城,|附近,|派一帶,|城一帶,|派附近,|城附近,} will become %5...

Just my 2 {minor currency unit of your choice} worth, it may not actually be any help Bye
Back to top
View user's profile Send private message
xoop



Joined: 04 May 2010
Posts: 9

PostPosted: Mon Sep 03, 2012 8:34 pm    Post subject: Reply with quote

I write a test #action and change %* to %4. %5 is mob's Chinese name and %6 is mob's English name.
Code:

#var cname {}
#var ename {}
#var showcount 0;
#var namelist[] {}

#ACTION {^  %4高手 %5\(%6\)$}
{
        #if {"$showcount" == "0"}
        {
                #var cname %5;
                #var ename %6;
                #var showcount 1;
        };
        #elseif {"$showcount" == "1"}
        {
                #if {"$cname" == "%5" && "$ename" == "%6"} {#showme {all the same!};#var showcount 0;};
                #elseif {"$cname" != "%5" && "$ename" == "%6"} {#var namelist[$ename] {{cns}{%5}{cnt}{$cname}};#showme {cname isn't the same! %5 and $cname} {1};#var showcount 0;};
        };
}
{5}

And then get the following. These quest mobs get their names randomly. I'll keep trying why they look the same and #action doesn't work. Thanks to your help.^_^
Code:

#VARIABLE {namelist}={{}{}{huyan jiqi}{{cns}{呼延稷祈}{cnt}{呼延稷祈}}}
Back to top
View user's profile Send private message
Slysven



Joined: 10 Apr 2011
Posts: 365
Location: As "Jomin al'Bara" in WoTMUD or Wiltshire, UK

PostPosted: Mon Sep 03, 2012 11:32 pm    Post subject: Reply with quote

Looking at the first post I note that you are trying to escape the '(' and ')' with '\' before them - do you actually need to do this? The #HELP for ACTION suggests ( ) are treated as normal "unless used with braces" but I'm not entirely sure what that means. As I understanding it: '(' and ')' are "Parenthesis", '{' and '}' are "Curly brackets", '[' and ']' are "Square Brackets"... Confused

{Ah, a quick check with Wikipedia tells me that what I would call curly brackets ARE these "braces"} and a little thought suggests that you do not escape '(' and ')' in say here:
Code:
#ACTION {You have %d experience points (%d to next level).} {#VAR xp %1; #VAR xp_to_next_level %2}
Which will to trigger on, e.g.:
Code:
"You have 123456 experience points (7890 to next level)."

[$xp will get value 123456, $xp_to_next_level will be 7890]
but you DO need to here:
Code:
#ACTION {In the %1{ | \(carried\) | \(worn\) }you find:} {#VAR container %1; #VAR container_location %2}
Which will trigger on (the first line of):
Code:
"In the pouch (carried) you find:
20 Gold Crowns
a lantern
[3]a hunk of meat"

[$container will be "pouch", $container_location will be "(carried)"]
Does this make any difference to what you may need to use and can anyone else confirm that I have got my thoughts right?
Back to top
View user's profile Send private message
xoop



Joined: 04 May 2010
Posts: 9

PostPosted: Tue Sep 04, 2012 2:40 am    Post subject: Reply with quote

I'll try these later. In previous version of tintin++ sometimes triggers don't work when "(" isn't escaped. The second situation is similar to mine.
Back to top
View user's profile Send private message
xoop



Joined: 04 May 2010
Posts: 9

PostPosted: Tue Sep 04, 2012 8:16 am    Post subject: Reply with quote

xoop wrote:
I'll try these later. In previous version of tintin++ sometimes triggers don't work when "(" isn't escaped. The second situation is similar to mine.


It looks the same.

Code:

#ACTION {^  %4高手 %5\(%6\)$}
{
        #var namelist[%6] {{cns}{%5}{cnt}{%6}};
}
{7}

result:
#VARIABLE {namelist}={{}{}{fa pianbian}{{cns}{法片忭}{cnt}{fa pianbian}}{feng pin}{{cns}{鳳品}{cnt}{feng pin}}{gong chuan}{{cns}{龔傳}{cnt}{gong chuan}}{gu wen}{{cns}{谷文}{cnt}{gu wen}}{guan ban}{{cns}{管班}{cnt}{guan ban}}{gui nan}{{cns}{歸楠}{cnt}{gui nan}}{kang bachen}{{cns}{康霸宸}{cnt}{kang bachen}}

And don't escape
Code:

#ACTION {^  %4高手 %5\(%6\)$}
{
        #var namelist[%6] {{cns}{%5}{cnt}{%6}};
}
{7}

result:
#VARIABLE {namelistII}={{}{}{dong ding}{{cns}{董鋌}{cnt}{dong ding}}{dong siji}{{cns}{董祀疾}{cnt}{dong siji}}{fa pianbian}{{cns}{法片忭}{cnt}{fa pianbian}}{feng pin}{{cns}{鳳品}{cnt}{feng pin}}

I think that the action's priority is the reason to my triggers before.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> General Discussion All times are GMT - 5 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
Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads
TinTin++ Homepage

Powered by phpBB © 2001, 2002 phpBB Group