|
Freddybob Newbie
Joined: 04 Feb 2012 Posts: 3
|
Posted: Sat Feb 04, 2012 10:08 pm
Database record help |
Hi im new in this forum so sry for posting wrong or something
Im trying to make a script to summon my pets in a specific order. My database record looks something like this.
Phoenix | 1
Air | 3
Water | 2
untill here everything works fine.. but now i want zmud to send "cast (pet to summon first)" to my mud.. this is where i get stuck. Anyone got a good solution for this? sry if my explaination sux |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4690 Location: Pensacola, FL, USA
|
Posted: Sat Feb 04, 2012 11:20 pm |
Might work, untested.
#LOOP %numitems(@var) {#FORALL %dbkeys(@var) {#IF (@var.%j=%i) {cast %j}}} |
|
_________________ Discord: Shalimarwildcat |
|
|
|
Freddybob Newbie
Joined: 04 Feb 2012 Posts: 3
|
Posted: Sun Feb 05, 2012 5:20 pm |
damn! worked like a charm! thx alot!
now if i can ask another thing..
is there a simple way to change the order from an alias?
for example
"petorder Phoenix 3"
then phoenix canges place with Air?
managed to make a long ass trigger but i then my computer crashed and i lost it. Can remake it but im just looking if there is a simple way to do it rather that my 50 diffrent #if triggers :P |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4690 Location: Pensacola, FL, USA
|
Posted: Sun Feb 05, 2012 5:31 pm |
you can change the value of a givin pet via
#ADDKEY var Phoenix 3
But it would be up to you to maintain a unique value for each... if two items are both at 3, there is no guaranteeing which is cast first. |
|
_________________ Discord: Shalimarwildcat |
|
|
|
Freddybob Newbie
Joined: 04 Feb 2012 Posts: 3
|
Posted: Sun Feb 05, 2012 5:40 pm |
well since im like superlazy when i mud i want everything to be as automated as i can make it:) so i want the script to switch places so no pets get the same number!
guess i have to make my super long and overcomplex trigger then :) thx anyways! |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4690 Location: Pensacola, FL, USA
|
Posted: Sun Feb 05, 2012 5:54 pm |
#ALIAS petswapper {
temp=@var.%1
#ADDKEY var %1 @var.%2
#ADDKEY var %2 @temp
}
just pass it the two pet names |
|
_________________ Discord: Shalimarwildcat |
|
|
|
|
|