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
TerrellKl
Novice


Joined: 30 Aug 2005
Posts: 49

PostPosted: Thu Sep 15, 2005 9:38 pm   

#showdb Decending like
 
I got a trigger that counts the number of times someone triggers one of my spells.. to be cast upon them. It stores these numbers in a variable called numbers like so

Alexander 1
Rufus 12
Zultan 5

When i put in
#showdb @numbers

it shows it in that order.. i need to to show it like
Rufus 12
Zultan 5
Alexander 1

Anyways i can do this?
Reply with quote
TerrellKl
Novice


Joined: 30 Aug 2005
Posts: 49

PostPosted: Thu Sep 15, 2005 10:39 pm   
 
Also need to know the opposite of #add to subtract a number from a variable.

or tell me how to set a variable to automatically count down every 100 seconds make it go down 1.
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Fri Sep 16, 2005 12:29 am   
 
The opposite of #ADD var 1 is #ADD var -1
_________________
Zmud Support Library
Zmud Knowledge Base
Reply with quote
TerrellKl
Novice


Joined: 30 Aug 2005
Posts: 49

PostPosted: Fri Sep 16, 2005 12:57 am   
 
Well i figured that one out..
I tried it earlier
#add @blah -1 and it created a variable called @blah -1
it was later i found out that u dont need the @
#add blah -1 did the job. thanks for the help tho
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Fri Sep 16, 2005 9:12 am   
 
This should do the sorting you wanted. The bolded references may need more percent signs added to be valid at the proper time like %%%%2, but I think that the 3 there now should be correct. Be sure to #SAVE before testing this, I have seen %subregex do some wacky things when it is given a bad code.

#ALIAS sortrec {#FORALL %sort(%subregex(%expanddb(@numbers,"|","="),"(\w+)=(\d+)",%concat(%rightback("00%%%2",3)," %%%1"),1) {#SHOW %word("%i",2) %word("%i",1)}}
_________________
The only good questions are the ones we have never answered before.
Search the Forums
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