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 variables in lists...

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



Joined: 16 Aug 2007
Posts: 11

PostPosted: Thu Jan 31, 2008 9:18 pm    Post subject: Question about variables in lists... Reply with quote

I have a list of people that can order me to do stuff via tells...

I have a static list of people, and I want to add in whoever I'm following at the current time... I call the variable $tank... here's the list (names removed to protect the innocent):

Code:
#VARIABLE         {authUsers}             { {$tank} {sam} {joe} {Albert} {george} {jordan} {mel} {gracie} {frankie} {wanda} {fishhead}}



and here's how its used:

Code:
#ACTION           {%0 tells you: "do %1"}  {#list {authUsers} {fnd} {%0} {tmp};#IF {$tmp > 0} {%1} {tell %0 Sorry, you are not authorized.}}  {5}


but the $tank variable never gets parsed it appears, as the person assigned to the $tank variable can't order me to do anything.

Any ideas? Thanks in advance Smile
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Fri Feb 01, 2008 4:05 am    Post subject: Reply with quote

You can't store variables inside variables, you could try the following though:

Code:

#ACTION           {%0 tells you: "do %1"}  {#list {authUsers} {fnd} {%0} {tmp};#IF {$tmp > 0 || "%0" == "$tank"} {%1} {tell %0 Sorry, you are not authorized.}}  {5}


Another option is reserving the first item of the list for the tank and use: #list authUsers set 1 $tank whenever you switch tanks.
Back to top
View user's profile Send private message Send e-mail
drenesh



Joined: 16 Aug 2007
Posts: 11

PostPosted: Fri Feb 01, 2008 4:22 am    Post subject: Thanks :) Reply with quote

Thanks for the reply Smile

I hadn't realized that you could use C style "or" switches. Smile Good to know Smile
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 -> 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