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

Is there a "stack" or simple way to make one?

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



Joined: 19 Mar 2011
Posts: 15

PostPosted: Sat Jun 30, 2012 8:46 pm    Post subject: Is there a "stack" or simple way to make one? Reply with quote

I'm wondering if there is a "stack" datatype available in tintin++? There is this functionality I believe in zmud.

http://en.wikipedia.org/wiki/Stack_%28abstract_data_type%29

Or would it be relatively easy to script something like this?

Some example uses of a stack:

1. For example you could "push" a bunch of targets to a stack, and then after killing each target "pop" it and then move on to the next one.

2. Or let's say you are in a fight, and a spell wears off which can't be cast in battle. Each spell that wears off could be pushed to the stack, and after the fight you cast them and pop them off the stack.

3. Or if you are a healer each round you can push X healing spells to the stack, and then prioritize by casting from the top of the stack.


Or is this not useful, and I should just accomplish the same using else-if ladders and/or variable arrays?
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3274

PostPosted: Sat Jun 30, 2012 9:25 pm    Post subject: Reply with quote

To push you can use:

#list bla insert -1 {whatever}

And to pop:

#list bla delete -1

To see the size use:

&bla[]
Back to top
View user's profile Send private message Send e-mail
taizong



Joined: 19 Mar 2011
Posts: 15

PostPosted: Sat Jun 30, 2012 9:37 pm    Post subject: Reply with quote

Thanks Scandum! That's perfect, I didn't realize that lists could be used in this way.
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 -> 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