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
carparker76
Newbie


Joined: 19 May 2016
Posts: 2

PostPosted: Thu May 19, 2016 6:04 pm   

help with randomizing the order of an alias
 
i am using an alias to create multiple portals going to different rooms

#alias portals {portal 4601 10000;portal 4601 29906;portal 4601 29903;portal 4601 1271;portal 4601 29910;portal 4601 27000;portal 4601 29909;portal 4601 1279;portal 4601 29904;portal 4601 10000;portal 4601 9902;portal 4601 1245;portal 4601 15698;portal 4601 21746;portal 4601 21599;portal 4601 10000;portal 4601 25945;portal 4601 11551;portal 4601 1270;portal 4601 26258}

(portal command) (type of portal) (room number)

currently to randomize i am cutting and pasting a section to reorder

i am interested in learning/figuring out how to randomize it each time i do the alias

so far I've have been reading for a few hours and things like variable list that does 1 action of the list, i would like to do all

i am pretty inexperienced at this, if someone could help me out that would be awesome!
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Thu May 19, 2016 7:52 pm   
 
Put this in the command line and see what it makes. It will remove your existing portals alias to ensure that there is no confusion.
Code:
#UNALIAS portals
#CLASS RandPortals
#VAR PortalLocations {10000|10000|10000|29906|29903|1271|29910|27000|29909|1279|29904|9902|1245|15698|21746|21599||25945|11551|1270|26258}
#ALIAS portals {#SEND {portal 4601 %item(@PortalLocations,%random(1,%numitems(@PortalLocations)))}}
#CLASS 0
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
carparker76
Newbie


Joined: 19 May 2016
Posts: 2

PostPosted: Thu May 19, 2016 9:43 pm   
 
wow great!

originally i wanted each portal to be made at once with a different order, which means each room does get used.

but for practicality it isn't not a big deal if a few rooms don't get used. this is much better then what i was doing. thank you!
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