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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Lilith383
Beginner


Joined: 10 Mar 2003
Posts: 17
Location: USA

PostPosted: Mon Nov 24, 2003 4:14 am   

Multiple Tells/Messages
 
Say I want to send the same messsage to more than one person at a time rather than have to manually type:

'tell gordeth do you want to buy equip?'
'tell Zeus do you want to buy equip?'
'tell john do you want to buy equip?'

Can someone make a script where all you have to do is name all the people you want to message then give the message? Something like this:

'Tell gordeth, Zeus, John do you want to buy gear?'

If anyone could help me with this, i'd be most appreciative, thanks.
Reply with quote
Vittorio
Beginner


Joined: 22 Oct 2003
Posts: 10

PostPosted: Mon Nov 24, 2003 4:35 am   
 
This doesn't take an infinite amount of names, but I reckon 10 should be enough.

#ALIAS btell {#pr msg "Enter a message";#fo %1|%2|%3|%4|%5|%6|%7|%8|%9|%10 {#if %i!="" {tell %i @msg} {#abort}}}
#VAR msg {}

To send a bulk tell, enter BTELL <name1> <name2> ... <name10>, then enter the message when prompted.

e.g. BTELL gordeth zeus john, then enter "Do you want to buy gear?" when prompted.

-V.
Reply with quote
Lilith383
Beginner


Joined: 10 Mar 2003
Posts: 17
Location: USA

PostPosted: Mon Nov 24, 2003 12:37 pm   
 
Perfect! Thank you so much =)
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Mon Nov 24, 2003 11:44 pm   
 
Here's a slightly different #FORALL loop. It allows the user to name any number of people to ask, and you no longer need the #IF check. Other than that, Vittorio hit the nail on the head there.

#forall %replace(%-1," ","|") {tell %i @msg}
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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