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

variable "database?"

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



Joined: 02 Jan 2007
Posts: 16

PostPosted: Tue Jan 02, 2007 3:55 am    Post subject: variable "database?" Reply with quote

Ok, first off - hats off to creator(s) of TinTin++, it's extremely versatile.

Now. I'm wondering how I can setup a variable/action of some sort
so that once i get certain input, a variable changes to the next thing in a predefined list.

EX: there is no mob of that name around here.
changes variable "wheremob" to a new predefined mob, and whenever that text is found, it will rotate to a new item on the list.

I'm stuck at how I would make a list that could be rotated through.

EX: variable list:
mob_a
mob_b
mob_c
where mob_a
there is no mob of that name around here
#variable wheremob mob_b
where mob_b
et cetera et cetera...

Does anyone follow me? I'd appreciate any help I can get on this one.
Thank you Big Smile
_________________
TinTin++ is great, thanks to creator(s)
Back to top
View user's profile Send private message AIM Address
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Tue Jan 02, 2007 9:29 am    Post subject: Reply with quote

You could do something like this:

Code:

#var wherelist {{mob_a} {mob_b} {mob_c}}

#act {^there is no mob of that name around here}
{
   #math wherenow $wherenow + 1;

   #if {$wherenow <= $wherelen}
   {
      #list wherelist get $wherenow wheremob;
      where $wheremob
   }
}

#alias wheremob
{
   #var wherenow 1;
   #list wherelist len wherelen;
   #list wherelist get $wherenow wheremob;
   where $wheremob
}
Back to top
View user's profile Send private message Send e-mail
bloodbunnyn



Joined: 02 Jan 2007
Posts: 16

PostPosted: Tue Jan 02, 2007 3:18 pm    Post subject: Reply with quote

I haven't got it to work yet, but it makes sense Smile thanks for help.

I do get an error with this line
Code:
#if {$wherenow <= $wherelen}


"#MATH EXP: INVALID INPUT {22 <= $wherelen}"

Hmm.
_________________
TinTin++ is great, thanks to creator(s)
Back to top
View user's profile Send private message AIM Address
davevnj



Joined: 22 Nov 2006
Posts: 55

PostPosted: Wed Jan 03, 2007 12:18 pm    Post subject: Reply with quote

this means the wherelen hasn't been defined at the time of the action. Defore defining the actions, set wherelen to 1 or some other meaningful initial value (like the length of your list).
Back to top
View user's profile Send private message Visit poster's website
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