|
Shylmysten Wanderer
Joined: 18 Sep 2001 Posts: 93 Location: USA
|
Posted: Sat Dec 21, 2002 1:49 am
zmud script converstion problem from 6.16 to 6.40 |
hey all, been awhile since I posted anything, but Im having a serious problem with one of my scripts. Its a pretty LARGE script and cannot post it all here, but suffice it to say that its not converting over properly - here's the problem.....
I have an alias to Vset 99999 health
which places 99999 into a variable list with a 1 to show that it is full and 0 to show that it is empty so the enter in the variable list will look like this
@vhealth (444|1|99999|1}
However, for some reason now it is entering the variable like this
@vhealth {444|1|(99999|1)}
this is a major problem because when I go to drink health it does not show up in the variable list as a drinkable item and therefor, even though it is in the list, it screws my whole script up.
[Code]
#IF (%isnumber(%1)) {#IF (%ismember(%insert(v,%if(%2=empty,%3,%2),1),@vials)) {#IF (%2=empty) {#IF (%ismember(%1,@{v%3})) {#VAR v%3 %delitem(%1|%item(@{v%3},%ismember(%1,@{v%3})+1),@{v%3})};#VAR v%3 %additem("%1|0",@{v%3})} {#IF (%ismember(%1,@{v%2})) {#VAR v%2 %delitem(%1|%item(@{v%2},%ismember(%1,@{v%2})+1),@{v%2})};#VAR v%2 %additem("%1|1",@{v%2});#IF (%ismember(0,@{v%2})) {#WHILE (%ismember(0,@{v%2}) < %ismember(%1,@{v%2})) {#VAR v%2 %additem(%item(@{v%2},%ismember(0,@{v%2})-1)|0,@{v%2});#VAR v%2 %delitem(%item(@{v%2},%ismember(0,@{v%2})-1)|0,@{v%2})}}};#EC %1 set to %if(%2=empty,%upper(%3) (empty),%upper(%2)).} {#EC %if(%if(%2=empty,%3,%2),%upper(%if(%2=empty,%3,%2)) is not a valid vial type.,Syntax: vset #vial (empty) type)}} {#EC Syntax: vset #vial (empty) type}
If anyone has some ideas why this is happening, or a resolution to this I would surely appreciate the help.
Thanks,
Shyl |
|
|
|
Shylmysten Wanderer
Joined: 18 Sep 2001 Posts: 93 Location: USA
|
Posted: Sat Dec 21, 2002 1:51 am |
quote:
hey all, been awhile since I posted anything, but Im having a serious problem with one of my scripts. Its a pretty LARGE script and cannot post it all here, but suffice it to say that its not converting over properly - here's the problem.....
I have an alias to Vset 99999 health
which places 99999 into a variable list with a 1 to show that it is full and 0 to show that it is empty so the enter in the variable list will look like this
@vhealth (444|1|99999|1}
However, for some reason now it is entering the variable like this
@vhealth {444|1|(99999|1)}
this is a major problem because when I go to drink health it does not show up in the variable list as a drinkable item and therefor, even though it is in the list, it screws my whole script up.
[Code]
#alias vset {
#IF (%isnumber(%1)) {#IF (%ismember(%insert(v,%if(%2=empty,%3,%2),1),@vials)) {#IF (%2=empty) {#IF (%ismember(%1,@{v%3})) {#VAR v%3 %delitem(%1|%item(@{v%3},%ismember(%1,@{v%3})+1),@{v%3})};#VAR v%3 %additem("%1|0",@{v%3})} {#IF (%ismember(%1,@{v%2})) {#VAR v%2 %delitem(%1|%item(@{v%2},%ismember(%1,@{v%2})+1),@{v%2})};#VAR v%2 %additem("%1|1",@{v%2});#IF (%ismember(0,@{v%2})) {#WHILE (%ismember(0,@{v%2}) < %ismember(%1,@{v%2})) {#VAR v%2 %additem(%item(@{v%2},%ismember(0,@{v%2})-1)|0,@{v%2});#VAR v%2 %delitem(%item(@{v%2},%ismember(0,@{v%2})-1)|0,@{v%2})}}};#EC %1 set to %if(%2=empty,%upper(%3) (empty),%upper(%2)).} {#EC %if(%if(%2=empty,%3,%2),%upper(%if(%2=empty,%3,%2)) is not a valid vial type.,Syntax: vset #vial (empty) type)}} {#EC Syntax: vset #vial (empty) type}}
If anyone has some ideas why this is happening, or a resolution to this I would surely appreciate the help.
Thanks,
Shyl
|
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Sat Dec 21, 2002 2:28 am |
As I replied to your previous post...
zMud now supports nested lists. The ()'s around the entry indicate that it is a single item in the list. In order to make the 2 items of that list seperate items in the main list you must add them seperately. |
|
|
|
Shylmysten Wanderer
Joined: 18 Sep 2001 Posts: 93 Location: USA
|
Posted: Sat Dec 21, 2002 9:28 am |
Ah but they are the same item
99999 is the actual item the 0 or 1 that follows is a state of that item empty or full
so the script checks that Item to see whethere it is empty or full and if the 0 is set it will move to the next item that is full or a 1 if its all are 0 it then tells me I have no full items of this type.
Is there any way I can have it strip the () around it or turn the nesting off? Or have it actually read around the ()?
#alias Drink {#IF (!%ismember(%1,@vdrink)) {#t- ingame;drink %0;#t+ ingame} {#IF (%item(@v%1,2)) {#VA drinks %additem(v%1,@drinks);#t- ingame;drink %item(@v%1,1);#t+ ingame} {#EC You have no %upper(%1)}}}
#var vhealth {38452|1|92047|1|116823|1|117455|1|106922|1|68721|1|86463|1|48224|1}
is there anyways to modify the drink alias to read around the ()'s
I'm really not sure how I would go about changing the script to add this all seperately, as its not my script.
Thanks again,
Shyl |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Sat Dec 21, 2002 12:46 pm |
Like Vijilante said, you need to add each item in the list separetly. More specificaly, wherever you see something like this in the script:
#VAR v%3 %additem("%1|0",@{v%3})
you need to change it to:
#VAR v%3 %additem("%1",@{v%3})
#VAR v%3 %additem("0",@{v%3})
Kjata |
|
|
|
|
|
|
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
|
|