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

Losing % symbols.

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



Joined: 12 Jan 2014
Posts: 3
Location: United States

PostPosted: Sun Jan 12, 2014 1:46 pm    Post subject: Losing % symbols. Reply with quote

Hey,

I'm pretty new to tintin so apologies if this is really basic or stupid.

I'm running TT++ 2.0.9 on my mac (10.6.8) and have been trying to get an auto heal to work:

#al {setnul} {#nu #var nulm %0;#nu say Heal set to %0}

#alias {nulmira} {#nu #act {^<Null %0(} {#if {%%0<$nulm} {mira2}}}

#alias {mira2} {fmira null;#nu #unact {^<Null %0(};#nu #act {Your life has been restored.} {nulmira}}

{setnul} creates a #var for Null's current HP.
{nulmira} turns the auto-heal on
{mira2} prevents the auto-heal from spamming.


Here's the problem:

When I set this up and check the actions I see this:

#ACTION {^<Null (}={#if {%0<$nulm} {mira2}} @ {5}


The first %0 is gone and the %%0 is replaced with %0


So what am I doing wrong?

Thanks for your patience
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Sun Jan 12, 2014 5:31 pm    Post subject: Reply with quote

The #alias uses %0 just like the action does, which means you need to escape the %0 which you can do by adding an extra %.

So you'd use:

Code:

#alias {nulmira} {#nu #act {^<Null %%0(} {#if {%%0<$nulm} {mira2}}}


I'm not sure if you come from a wintin95 background, but in tintin++ you escape for each nested trigger (alias/action typically), the braces are irrelevant.
Back to top
View user's profile Send private message Send e-mail
false_aesthetic



Joined: 12 Jan 2014
Posts: 3
Location: United States

PostPosted: Sun Jan 12, 2014 7:31 pm    Post subject: Reply with quote

No,

I don't come from Wintin. I've only used tintin but on a very very basic level (aliases for dirs, logging in, etc). I'm trying to make the gameplay a bit more involved now.

Would you please explain what you mean by "you need to escape the %0 "

I understand adding an extra % but I'm not sure why you don't do that on both sides see below:

Code:

#alias {nulmira} {#nu #act {^<Null %%0(} {#if {%%%0<$nulm} {mira2}}}
[/quote]
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Mon Jan 13, 2014 5:50 pm    Post subject: Reply with quote

I see the confusion, I changed that because I don't see how using %%%0 would result in valid script code in that scenario.

It would result in a literal '%0' being evaluated, which means the if check would always be false.

If you want a % to be placed in front of it you could try: \%%%0 but that would not result in a valid expression, so the if check would still always be false.
Back to top
View user's profile Send private message Send e-mail
false_aesthetic



Joined: 12 Jan 2014
Posts: 3
Location: United States

PostPosted: Mon Jan 13, 2014 11:49 pm    Post subject: Reply with quote

I'm sorry to be a pain.

Previous suggestion didn't work.

I tried something else today:

In the score I have the following.

Align: 830

I wanted to create an action that check the alignment and triggers "use cross" if my alignment is below 700.


Code:

#var {goodalign} {700}
1.    #act {Align:      %1} {#if {%1<$goodalign} {use cross}}

and I tried

2.    #act {Align:      %1} {#if {%%1<$goodalign} {use cross}}



Using TT 2.0.9 if try 1. No mater what my align is, I will use cross.
If I try 2. nothing happens.

Now if I try a previous version of TT

I get the following:

1. gives me:
#MATH EXP: INVALID INPUT {830 |<700}

2. gives me:
#MATH EXP: INVALID INPUT {%830 |<700}


I've had a few other players try to help me out, it works for them but they're either using tt++ on a PC or using wintin.

I'm wondering if there's a possibility that #if just doesn't work with my setup.


Thanks for your patience.
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Tue Jan 14, 2014 10:54 am    Post subject: Reply with quote

Looks like the mud prints: Align: 830 |

If that's the case try:

Code:

#act {Align: %1 |} {#if {%1 < $goodalign} {use cross}


You can use: #debug action on to see what goes on behind the scenes.
Back to top
View user's profile Send private message Send e-mail
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