|
TerrellKl Novice
Joined: 30 Aug 2005 Posts: 49
|
Posted: 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? |
|
|
|
TerrellKl Novice
Joined: 30 Aug 2005 Posts: 49
|
Posted: 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. |
|
|
|
nexela Wizard
Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: Fri Sep 16, 2005 12:29 am |
The opposite of #ADD var 1 is #ADD var -1
|
|
|
|
TerrellKl Novice
Joined: 30 Aug 2005 Posts: 49
|
Posted: 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 |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: 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 |
|
|
|
|
|