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

creating macro off variable list

 
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Script Help
View previous topic :: View next topic  
Author Message
gulca



Joined: 11 May 2011
Posts: 5

PostPosted: Fri Oct 14, 2011 11:55 am    Post subject: creating macro off variable list Reply with quote

I have problem trying to do the following.

I pre-define a list of variables
Code:
#list dying create $dying1 $dying2 $dying3

I then define a variable index to keep track
Code:
#var dying_index 1

Now I want to set macros to dying individuals, and let say the current individual is in variable name, which I set it to $dying1
Code:
#var name Bob
#var $dying[$dying_index] $name

For the macro, I try to set it this way but it doesn't work. I pre-define a set of macro keys I want to use, note it will be F1 F3 F4 with their code equiv
Code:

#list function_keys create \e0R \e0S \e[15~
#macro $function_keys[$dying_index] {cast 'heal' $dying[$dying_index]}


The thing is #showme on $dying1 gives me Bob, and $dying[$dying_index] gives me $dying1 but the macro doesn't work.

How do I make it work?

Basically I want the macro F1 in this case to have the command
cast 'heal' $dying1

Thanks. Maybe there's an easier way to do this.
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3274

PostPosted: Fri Oct 14, 2011 4:32 pm    Post subject: Reply with quote

Probably easiest to set the macros up once:

Code:

#macro {\eOR} {cast 'heal' $dying[1]}
#macro {\e0S  {cast 'heal' $dying[2]}
etc


I guess you could also try:
Code:

#loop {1} {3} {cnt}
{
    #line substitute variables
    {
        #macro $function_keys[$cnt] {cast 'heal' $$dying[$cnt]}
    }
}
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 -> Script Help 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