Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Josiah.Bruns
Apprentice


Joined: 04 Mar 2007
Posts: 103

PostPosted: Thu Sep 17, 2009 5:15 am   

need help with Role Call
 
ok i have 4 chars
my leader tank is going to say role call and the other chars all respond here.
it comes in on 3 different lines
what i want to do is if they don't all answer have my mage run a macro called gather party which teleports him to the leader then summons the other 2 chars.

You say: role call
> << Night >> here
<< Memphis >> here
<< Trixen >> here

some times it looks like this some times there are other lines of text between the responses.

Thanks for any help.
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Thu Sep 17, 2009 4:29 pm   
 
The approach I would take is to do this.

1. Make a list of every one in your party
2. Just before role call make a copy of that list
3. Trigger the role call and remove each member from the temp copy
4. If after roll call the temp copy is not empty, call you macro to gather the party.
_________________
Asati di tempari!
Reply with quote
Josiah.Bruns
Apprentice


Joined: 04 Mar 2007
Posts: 103

PostPosted: Fri Sep 18, 2009 8:08 pm   ok now what
 
i did what you suggested and it works marvelous. i create string list and add all the names then call role and delete everyone who answers.

how to i then get the vaules out of the array of unknown length and stop when i am done?

i would think that i need to look at the first index and summon that person then delete them then ????

is there a command that will check the array to see if its empty?
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4686
Location: Pensacola, FL, USA

PostPosted: Fri Sep 18, 2009 10:49 pm   
 
#DELITEM varnamewithoutthe@ member

#IF (@arrayname) {will return true if it has any value other than 0}
_________________
Discord: Shalimarwildcat
Reply with quote
Liath
Novice


Joined: 25 Aug 2009
Posts: 38

PostPosted: Sat Sep 19, 2009 8:17 am   
 
could also use #WHILE (@arrayname >0) {dostuff}
Reply with quote
Posideon
Beginner


Joined: 06 Feb 2005
Posts: 26

PostPosted: Sun Sep 20, 2009 4:00 pm   
 
You could also use %numitems(@arrayname) to check the size, and to look at first index then access it and delete it use the %pop() function. Does exactly what you want.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
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

© 2009 Zugg Software. Hosted by Wolfpaw.net