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

Bug in multiword aliases

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



Joined: 11 Feb 2009
Posts: 48

PostPosted: Thu Jun 28, 2012 11:42 am    Post subject: Bug in multiword aliases Reply with quote

Bug in multiword aliases. If you use a variable anywhere in your alias body, it will send the alias arguments to the mud. UNLESS you use the arguments somewhere in the alias. See below for examples.

Quote:
#alias {test thing} {#var {somevar} {0};}
#OK. {test thing} NOW ALIASES {#var {somevar} {0};} @ {5}.
test thing
There is no reason to 'thing' here. (This means tt++ sent "thing" to the mud)


Quote:
#alias {test thing} {#showme {%1};#var {somevar} {0};}
#OK. {test thing} NOW ALIASES {#showme {%1};#var {somevar} {0};} @ {5}.
test thing
thing
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3796

PostPosted: Thu Jun 28, 2012 1:29 pm    Post subject: Reply with quote

That's classic alias behavior. Try:

#alias {test thing%1} {#showme {%1};#var {somevar} {0};}
Back to top
View user's profile Send private message Send e-mail
mrbigtaco



Joined: 26 Jun 2011
Posts: 54

PostPosted: Wed Jun 26, 2013 1:21 am    Post subject: Reply with quote

I've been hitting this issue lately as well and I'm a bit at a loss at the inconsistent behavior. Can you explain a bit further why it would be desirable to have parameters passed in to an alias dumped straight to the mud after the processing of the alias terminates (but only some of the time)? I'm not familiar with a use case of why it would be useful or desirable... and it's certainly becoming awkward to try to predict when it will or will not send the extra unused parameters to the mud. Putting catch alls at the beginning like #var temp %0 seems to preempt the behavior, but that's a hack of a workaround?

Example:
Code:
#alias .test2 {#echo {this is a test2!};.test parm1 parm2;};
#alias .test {#echo {this is a test!}};


Output:
Code:
#alias .test {#echo {this is a test!}};
#OK. {.test} NOW ALIASES {#echo {this is a test!}} @ {5}.
.test
this is a test!
.test parm1
this is a test!
#alias .test2 {#echo {this is a test2!};.test parm1 parm2;};
#OK. {.test2} NOW ALIASES {#echo {this is a test2!};.test parm1 parm2;} @ {5}.
.test2
this is a test2!
this is a test!
.test2 parm3
this is a test2!
this is a test!
There is no reason to 'parm3' here.
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: Thu Jun 27, 2013 8:38 pm    Post subject: Reply with quote

[Off-topic]: Um, from the date stamps on the previous posts it appears that the last one (from mrbigtaco) was posted before the original question was asked (by reality3). What is causing this temporal anomaly? Confused
Back to top
View user's profile Send private message
mrbigtaco



Joined: 26 Jun 2011
Posts: 54

PostPosted: Sun Jul 07, 2013 11:43 pm    Post subject: Reply with quote

Slysven wrote:
[Off-topic]: Um, from the date stamps on the previous posts it appears that the last one (from mrbigtaco) was posted before the original question was asked (by reality3). What is causing this temporal anomaly? Confused

2 days before the one year anniversary is all :-)
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: Thu Jul 25, 2013 9:45 pm    Post subject: Reply with quote

Sometimes I feel really stupid - and just occasionally I amUse your Head
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3796

PostPosted: Sat Aug 10, 2013 3:09 pm    Post subject: Reply with quote

mrbigtaco wrote:
I've been hitting this issue lately as well and I'm a bit at a loss at the inconsistent behavior. Can you explain a bit further why it would be desirable to have parameters passed in to an alias dumped straight to the mud after the processing of the alias terminates (but only some of the time)?


In the first one you execute: #echo {something} param

In the second you execute: #echo {something};param

In the first example 'param' gets ignored.
Back to top
View user's profile Send private message Send e-mail
mrbigtaco



Joined: 26 Jun 2011
Posts: 54

PostPosted: Mon Aug 12, 2013 5:23 pm    Post subject: Reply with quote

From your answer, I can see now that all arguments passed to an alias are appended to the end of the content of the alias... I never saw this documented in #help alias or elsewhere, so that's where the confusion probably was. I'm not sure this is technically a bug in that case, but the documentation could include a note to be a bit clearer about how parameters will be appended by default if they aren't explicitly referenced.
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3796

PostPosted: Fri Aug 16, 2013 1:39 pm    Post subject: Reply with quote

I guess I can try to formulate that better.

The behavior is pretty consistent, with automatic argument handling that you can overwrite if needed.
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 -> 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