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

Two bugs with some sort of complicated action

 
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Bug Reports
View previous topic :: View next topic  
Author Message
lucek



Joined: 20 Feb 2014
Posts: 5

PostPosted: Thu Feb 20, 2014 12:54 pm    Post subject: Two bugs with some sort of complicated action Reply with quote

This is my whole action:
Code:

#ACTION {^{Sa|Jest} tutaj {dwa|trzy|cztery|piec|szesc|siedem|osiem|dziwiec|dziesiec|jedno} widoczn{e|ych} wyjsc{ia|ie|}:%5.$}
{
   #line gag;
   #variable roza_d 0;
   #variable roza_u 0;
   #variable roza_s 0;
   #variable roza_n 0;
   #variable roza_w 0;
   #variable roza_e 0;
   #variable roza_sw 0;
   #variable roza_nw 0;
   #variable roza_ne 0;
   #variable roza_se 0;
   #variable {wyjscia} {%5};
   #replace {wyjscia} { i } {, };
   #regexp {$wyjscia} {\bpolnocny-wschod\b} {#var roza_ne 1;#replace {wyjscia} {polnocny-wschod} {}};
   #regexp {$wyjscia} {\bpoludniowy-wschod\b} {#var roza_se 1;#replace {wyjscia} {poludniowy-wschod} {}};
   #regexp {$wyjscia} {\bpolnocny-zachod\b} {#var roza_nw 1;#replace {wyjscia} {polnocny-zachod} {}};
   #regexp {$wyjscia} {\bpoludniowy-zachod\b} {#var roza_sw 1;#replace {wyjscia} {poludniowy-zachod} {}};
   #regexp {$wyjscia} {{[^-]}wschod} {#var roza_e 1;#replace {wyjscia} {wschod} {}};
   #regexp {$wyjscia} {{[^-]}zachod} {#var roza_w 1;#replace {wyjscia} {zachod} {}};
   #regexp {$wyjscia} {\bpolnoc\b} {#var roza_n 1;#replace {wyjscia} {polnoc} {}};
   #regexp {$wyjscia} {\bpoludnie\b} {#var roza_s 1;#replace {wyjscia} {poludnie} {}};
   #regexp {$wyjscia} {\bgora\b} {#var roza_u 1;#replace {wyjscia} {gora} {}};
   #regexp {$wyjscia} {\bdol\b} {#var roza_d 1;#replace {wyjscia} {dol} {}};
   #replace {wyjscia} { ,} {};
   #nop #echo {<afa>%1 tutaj %2 widoczn%3 wyjsc%4:<eca>%5<afa>.<099>};
   #showme {${roza_nw} ${roza_n} ${roza_ne}} {5};
   #showme {${roza_nw} ${roza_n} ${roza_ne}} {5};
   #showme {${roza_w} ${roza_u} ${roza_e}} {4};
   #showme {${roza_sw} ${roza_s} ${roza_se} $wyjscia} {3}
}
{5}



Bugs are:
#line gag doesnt work at all in this. (In other actions etc. is ok)
When I uncomment #echo I see my text and original text.
And the second one:
I need to have that line:
Code:
#showme {${roza_nw} ${roza_n} ${roza_ne}} {5};

two times to actually see update on statusbar.

This may be connected to this prompt:

Code:

#PROMPT           {^> %1}  {<cfa>Siedzisz: <ffa>@siedzenie{%0}<fff>|<cfa>Zbieranie ziol: <ffa>@zielarz{%0}<fff>|<cfa>Scinanie: <ffa>@drwal{%0}<fff>|<cfa>Zabitych: <ffa>${liczba_zabitych}<fff>|<cfa>Dzis zabitych: <ffa>${dzis_zabitych}<fff>|<cfa>Zebrane ziola: <ffa>${liczba_zeb_ziol}<fff>|<cfa>Dzis zebranych ziol: <ffa>${dzis_zeb_ziol}<fff>|<cfa>Sciete drzewa: <ffa>${liczba_sc_drzew}<fff>|<cfa>Dzis sciete: <ffa>${dzis_sc_drzew}<fff>|<cfa>Idz do: <ffa>${goto_room}|<cfa>Godzina:<ffa>$godzina<fff>@remove_text{%1}<099>} {1}


And the funny function:

Code:
#FUNCTION {remove_text}
{
   #IF {"%0" != ""}
   {
   #showme {%0}
   };
   #return |
}


Other functions in prompt work as expected (the above one too) but this function simply is showing text after prompt because previous one prompt ^> $ doesnt catch for example > BlahBlah. And this was also good but still I couldnt gag line when I have sub/action for "> anything" I saw my sub and original line always. And I need to have any #return in this to not show full %0 in statusbar.

Debug:
Code:

#DEBUG ACTION {^{Sa|Jest} tutaj {dwa|trzy|cztery|piec|szesc|siedem|osiem|dziwiec|dziesiec|jedno} widoczn{e|ych} wyjsc{ia|ie|}:%5.$}
[02] line gag
[02] variable roza_d 0
[02] variable roza_u 0
[02] variable roza_s 0
[02] variable roza_n 0
[02] variable roza_w 0
[02] variable roza_e 0
[02] variable roza_sw 0
[02] variable roza_nw 0
[02] variable roza_ne 0
[02] variable roza_se 0
[02] variable {wyjscia} { zachod, poludnie, polnocny-zachod, polnocny-wschod, norka i poczta}
[02] replace {wyjscia} { i } {, }
[15] regexp {$wyjscia} {\bpolnocny-wschod\b}
[02] variable roza_ne 1
[02] replace {wyjscia} {polnocny-wschod} {}
[15] regexp {$wyjscia} {\bpoludniowy-wschod\b}
[15] regexp {$wyjscia} {\bpolnocny-zachod\b}
[02] variable roza_nw 1
[02] replace {wyjscia} {polnocny-zachod} {}
[15] regexp {$wyjscia} {\bpoludniowy-zachod\b}
[15] regexp {$wyjscia} {{[^-]}wschod}
[15] regexp {$wyjscia} {{[^-]}zachod}
[02] variable roza_w 1
[02] replace {wyjscia} {zachod} {}
[15] regexp {$wyjscia} {\bpolnoc\b}
[15] regexp {$wyjscia} {\bpoludnie\b}
[02] variable roza_s 1
[02] replace {wyjscia} {poludnie} {}
[15] regexp {$wyjscia} {\bgora\b}
[15] regexp {$wyjscia} {\bdol\b}
[02] replace {wyjscia} { ,} {}
[02] nop #echo {<afa>Jest tutaj szesc widocznych wyjsc:<eca> zachod, poludnie, polnocny-zachod, polnocny-wschod, norka i poczta<afa>.<099>}
[02] showme {${roza_nw} ${roza_n} ${roza_ne}} {5}
[02] showme {${roza_nw} ${roza_n} ${roza_ne}} {5}
[02] showme {${roza_w} ${roza_u} ${roza_e}} {4}
[02] showme {${roza_sw} ${roza_s} ${roza_se} $wyjscia} {3}
Jest tutaj szesc widocznych wyjsc: zachod, poludnie, polnocny-zachod, polnocny-wschod, norka i poczta.


Additional info:
Version of TinTin++ 2.01.0
OS: OS X
Back to top
View user's profile Send private message
lucek



Joined: 20 Feb 2014
Posts: 5

PostPosted: Fri Feb 21, 2014 5:47 am    Post subject: Reply with quote

I think the problem is in showme because when I put them in function and call them I see the 3rd row showme on screen and in statusbar and the original action trigger. Code of this is mostly changed, current version is at:
https://github.com/luc3k/TinTin-Barsawia/blob/master/roza.tin

Edit:

And if I delete that showme completely I will not see the original action as expected.
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Fri Feb 21, 2014 7:13 pm    Post subject: Reply with quote

You need to move #line gag to the end of the action.

#line gag gags the next line, which in this case is the #echo / #showme.
Back to top
View user's profile Send private message Send e-mail
lucek



Joined: 20 Feb 2014
Posts: 5

PostPosted: Sat Feb 22, 2014 3:59 am    Post subject: Reply with quote

Thanks, it helped for both situations. Sorry for bothering about this Wink
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 -> Bug Reports 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