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
Sivan
Beginner


Joined: 06 Nov 2000
Posts: 20

PostPosted: Mon Jul 14, 2003 7:10 pm   

Help with an alias
 
I need to be able to check objects for proper effects on a mud where I do the area co-ordination. It takes quite some time to check all the objects vnums with a single command for each object. What I would like is an alias to start with a certain vnum and end with a certain vnum.

Basically it would start with for example, object 1 run the command to check what the object effects are then increment by one until it gets to the end vnum.

Anyone have an idea on how to do this?
Reply with quote
Carabas
GURU


Joined: 28 Sep 2000
Posts: 434
Location: USA

PostPosted: Mon Jul 14, 2003 7:26 pm   
 
Would a simple loop do the job?

#LOOP start,end {command to check object with vnum %i}

You could use this in an alias like this:

#ALIAS checkobj {#LOOP %1,%2 {command %i}}

Usage: checkobj 1 20
command 1
command 2
command 3
...
command 20


Hope this helps.
Reply with quote
Sivan
Beginner


Joined: 06 Nov 2000
Posts: 20

PostPosted: Mon Jul 14, 2003 7:57 pm   
 
Hm, that worked but I need to do this in blocks of 100. Is there a way to add a wait for every one done so I do not spam myself off?
Reply with quote
Carabas
GURU


Joined: 28 Sep 2000
Posts: 434
Location: USA

PostPosted: Mon Jul 14, 2003 9:01 pm   
 
Yes, you can use the #WAIT command.

#WAIT milliseconds

--
#ALIAS checkobj {#LOOP %1,%2 {command %i;#WAIT 1000}}

This would wait one second before reiterating the loop.
Reply with quote
Sivan
Beginner


Joined: 06 Nov 2000
Posts: 20

PostPosted: Mon Jul 14, 2003 11:42 pm   
 
That worked like a charm.

Thanks very much.

:)
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