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

Question about alias interpretation/parsing

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



Joined: 04 Jun 2008
Posts: 1

PostPosted: Wed Jun 04, 2008 6:39 pm    Post subject: Question about alias interpretation/parsing Reply with quote

I'm trying to create an alias that will automatically define some actions, which define variables, run a command that these actions operate on, and then parse the result to get some numbers out of this mess.

The problem I'm running into is that all of the tintin special commands in this alias seem to be run ahead anything else, no matter where in the alias they're at.

Example:
#alias {getmax} {#action {You have %%0 exp and are level %%1.} {#var {curexp} {%%0};#var {curlev} {%%1}}; score;#math {maxlev} {$curlev + 3};#unaction {You have %%0 exp and are level %%1.};#unvar {curexp};#unvar {curlev}}

When I run that though, the #actions get defined, and the #math is run ahead of the 'score' command, which is what the action operates on, so I get errors regarding the variables not being set yet.

I glanced at the source code but couldn't determine exactly why it's operating out of order on Tintin specials first. I guess what I'm looking for is some way to force in-order execution of these things.
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3281

PostPosted: Thu Jun 05, 2008 9:36 am    Post subject: Reply with quote

What you're forgetting is that it takes a relatively long time for the mud to send back the score information.

The following should do the trick:

Code:

#alias {getmax}
{
    #action {You have %%0 exp and are level %%1.}
    {
        #math {maxlev} {%%1 + 3};
        #unaction {You have %%%0 exp and are level %%%1.};
    };
    score
}
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